diff --git a/.gitignore b/.gitignore index c79bac73423..c9e0aca55ea 100644 --- a/.gitignore +++ b/.gitignore @@ -13,12 +13,15 @@ jmx.log derby.log spring-test/test-output/ .gradle -build .classpath .project argfile* pom.xml +/build +buildSrc/build +/spring-*/build + # IDEA artifacts and output dirs *.iml *.ipr diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71739dc4006..65db556fabd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ truly trivial, e.g. typo fixes, removing compiler warnings, etc. If you're considering anything more than correcting a typo or fixing a minor bug, please discuss it on the [spring-framework-contrib][] mailing list before -submitting a pull request. We're happy to provide guidance but please spend an +submitting a pull request. We're happy to provide guidance, but please spend an hour or two researching the subject on your own including searching the mailing list for prior discussions. @@ -31,26 +31,26 @@ list for prior discussions. If you have not previously done so, please fill out and submit the [SpringSource CLA form][]. You'll receive a token when this process is complete. -Keep track of this, you may be asked for it later! +Keep track of this; you may be asked for it later! Note that emailing/postal mailing a signed copy is _not_ necessary. Submission of the web form is all that is required. -When you've completed the web form, simply add the following in a comment on +Once you've completed the web form, simply add the following in a comment on your pull request: I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement. You do not need to include your token/id. Please add the statement above to all -future pull requests as well, simply so the Spring Framework team knows +future pull requests as well, simply so that the Spring Framework team knows immediately that this process is complete. ## Create your branch from `3.2.x` If your pull request addresses a bug or improvement, please create your branch -Spring Framework's `3.2.x` branch. `master` is reserved for work on new features +from Spring Framework's `3.2.x` branch. `master` is reserved for work on new features for the next major version of the framework. Rest assured that if your pull request is accepted and merged into `3.2.x`, these changes will also eventually be merged into `master`. @@ -72,7 +72,7 @@ Please carefully follow the whitespace and formatting conventions already present in the framework. 1. Tabs, not spaces -1. Unix (LF), not dos (CRLF) line endings +1. Unix (LF), not DOS (CRLF) line endings 1. Eliminate all trailing whitespace 1. Wrap Javadoc at 90 characters 1. Aim to wrap code at 90 characters, but favor readability over wrapping @@ -228,11 +228,11 @@ Most importantly, please format your commit messages in the following way 1. Use imperative statements in the subject line, e.g. "Fix broken Javadoc link" 1. Begin the subject line sentence with a capitalized verb, e.g. "Add, Prune, - Fix, Introduce, Avoid, etc" + Fix, Introduce, Avoid, etc." 1. Do not end the subject line with a period 1. Keep the subject line to 50 characters or less if possible 1. Wrap lines in the body at 72 characters or less -1. Mention associated jira issue(s) at the end of the commit comment, prefixed +1. Mention associated JIRA issue(s) at the end of the commit comment, prefixed with "Issue: " as above 1. In the body of the commit message, explain how things worked before this commit, what has changed, and how things work now diff --git a/build.gradle b/build.gradle index 540694d2ee0..8c0a1b42452 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,10 @@ buildscript { } } -configure(allprojects) { +configure(allprojects) { project -> + group = "org.springframework" + version = qualifyVersionIfNecessary(version) + ext.aspectjVersion = "1.7.1" ext.easymockVersion = "2.5.2" ext.hsqldbVersion = "1.8.0.10" @@ -16,24 +19,21 @@ configure(allprojects) { ext.slf4jVersion = "1.6.1" ext.gradleScriptDir = "${rootProject.projectDir}/gradle" - if (rootProject.hasProperty("VERSION_QUALIFIER")) { - def qualifier = rootProject.getProperty("VERSION_QUALIFIER") - if (qualifier.startsWith("SPR-")) { // topic branch, e.g. SPR-1234 - // replace 3.2.0.BUILD-SNAPSHOT for 3.2.0.SPR-1234-SNAPSHOT - version = version.replace('BUILD', qualifier) - } - } - apply plugin: "propdeps" apply plugin: "java" apply plugin: "propdeps-eclipse" apply plugin: "propdeps-idea" + apply plugin: "test-source-set-dependencies" apply from: "${gradleScriptDir}/ide.gradle" - group = "org.springframework" - - sourceCompatibility=1.5 - targetCompatibility=1.5 + compileJava { + sourceCompatibility=1.5 + targetCompatibility=1.5 + } + compileTestJava { + sourceCompatibility=1.7 + targetCompatibility=1.7 + } [compileJava, compileTestJava]*.options*.compilerArgs = [ "-Xlint:serial", @@ -58,17 +58,26 @@ configure(allprojects) { sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"] - test.systemProperty("java.awt.headless", "true") + test { + systemProperty("java.awt.headless", "true") + systemProperty("testGroups", properties.get("testGroups")) + } repositories { maven { url "http://repo.springsource.org/libs-release" } - maven { url "http://repo.springsource.org/ebr-maven-external" } } dependencies { testCompile("junit:junit:${junitVersion}") testCompile("org.hamcrest:hamcrest-all:1.3") - testCompile("org.easymock:easymock:${easymockVersion}") + testCompile("org.mockito:mockito-core:1.9.5") + if (project.name in ["spring", "spring-jms", "spring-orm", + "spring-orm-hibernate4", "spring-oxm", "spring-struts", + "spring-test", "spring-test-mvc", "spring-tx", "spring-web", + "spring-webmvc", "spring-webmvc-portlet", "spring-webmvc-tiles3"]) { + testCompile("org.easymock:easymock:${easymockVersion}") + testCompile "org.easymock:easymockclassextension:${easymockVersion}" + } } ext.javadocLinks = [ @@ -94,7 +103,7 @@ configure(allprojects) { ] as String[] } -configure(subprojects) { subproject -> +configure(subprojects - project(":spring-build-src")) { subproject -> apply plugin: "merge" apply from: "${gradleScriptDir}/publish-maven.gradle" @@ -143,6 +152,17 @@ configure(subprojects) { subproject -> } } +project("spring-build-src") { + description = "Exposes gradle buildSrc for IDE support" + apply plugin: "groovy" + + dependencies { + compile gradleApi() + groovy localGroovy() + } + + configurations.archives.artifacts.clear() +} project("spring-core") { description = "Spring Core" @@ -214,7 +234,7 @@ project("spring-core") { optional("org.aspectj:aspectjweaver:${aspectjVersion}") optional("net.sf.jopt-simple:jopt-simple:3.0") optional("log4j:log4j:1.2.17") - testCompile("xmlunit:xmlunit:1.2") + testCompile("xmlunit:xmlunit:1.3") testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") } @@ -304,7 +324,7 @@ project("spring-context") { optional("org.aspectj:aspectjweaver:${aspectjVersion}") optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1") testCompile("commons-dbcp:commons-dbcp:1.2.2") - testCompile("javax.inject:com.springsource.org.atinject.tck:1.0.0") + testCompile("javax.inject:javax.inject-tck:1") } test { @@ -324,7 +344,6 @@ project("spring-tx") { optional("javax.resource:connector-api:1.5") optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1") optional("javax.ejb:ejb-api:3.0") - testCompile "org.easymock:easymockclassextension:${easymockVersion}" testCompile("javax.persistence:persistence-api:1.0") testCompile("org.aspectj:aspectjweaver:${aspectjVersion}") } @@ -333,6 +352,14 @@ project("spring-tx") { project("spring-oxm") { description = "Spring Object/XML Marshalling" apply from: "oxm.gradle" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on jibx compilation + // see http://jira.codehaus.org/browse/JIBX-465 + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) @@ -344,7 +371,7 @@ project("spring-oxm") { optional("org.apache.xmlbeans:xmlbeans:2.4.0") optional("org.codehaus.castor:castor-xml:1.3.2") testCompile("org.codehaus.jettison:jettison:1.0.1") - testCompile("xmlunit:xmlunit:1.2") + testCompile("xmlunit:xmlunit:1.3") testCompile("xmlpull:xmlpull:1.1.3.4a") testCompile(files(genCastor.classesDir).builtBy(genCastor)) testCompile(files(genJaxb.classesDir).builtBy(genJaxb)) @@ -449,7 +476,7 @@ project("spring-web") { } optional("log4j:log4j:1.2.17") testCompile(project(":spring-context-support")) // for JafMediaTypeFactory - testCompile("xmlunit:xmlunit:1.2") + testCompile("xmlunit:xmlunit:1.3") } // pick up ContextLoader.properties in src/main @@ -458,6 +485,14 @@ project("spring-web") { project("spring-orm") { description = "Spring Object/Relational Mapping" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on toplink compilation + // TODO: remove this block when we remove toplink + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile("aopalliance:aopalliance:1.0") optional("org.hibernate:hibernate-core:3.3.2.GA") @@ -477,7 +512,6 @@ project("spring-orm") { testCompile("org.eclipse.persistence:org.eclipse.persistence.asm:1.0.1") testCompile("org.eclipse.persistence:org.eclipse.persistence.antlr:1.0.1") testCompile("hsqldb:hsqldb:${hsqldbVersion}") - testCompile(project(":spring-web").sourceSets.test.output) compile(project(":spring-core")) compile(project(":spring-beans")) optional(project(":spring-aop")) @@ -533,7 +567,7 @@ project("spring-webmvc") { testCompile(project(":spring-aop")) testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}") testCompile("rhino:js:1.7R1") - testCompile("xmlunit:xmlunit:1.2") + testCompile("xmlunit:xmlunit:1.3") testCompile("dom4j:dom4j:1.6.1") { exclude group: "xml-apis", module: "xml-apis" } @@ -553,7 +587,6 @@ project("spring-webmvc") { testCompile("commons-io:commons-io:1.3") testCompile("org.hibernate:hibernate-validator:4.3.0.Final") testCompile("org.apache.httpcomponents:httpclient:4.2") - testCompile(project(":spring-web").sourceSets.test.output) } // pick up DispatcherServlet.properties in src/main @@ -565,6 +598,7 @@ project("spring-webmvc-tiles3") { merge.into = project(":spring-webmvc") dependencies { compile(project(":spring-context")) + compile(project(":spring-web")) provided("javax.el:el-api:1.0") provided("javax.servlet:jstl:1.2") provided("javax.servlet.jsp:jsp-api:2.1") @@ -583,7 +617,6 @@ project("spring-webmvc-tiles3") { exclude group: "org.slf4j", module: "jcl-over-slf4j" } provided("javax.servlet:javax.servlet-api:3.0.1") - compile(project(":spring-web").sourceSets*.output) // mock request & response testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}") } } @@ -607,6 +640,10 @@ project("spring-webmvc-portlet") { project("spring-test") { description = "Spring TestContext Framework" + test { + useJUnit() + useTestNG() + } dependencies { compile(project(":spring-core")) optional(project(":spring-beans")) @@ -642,7 +679,7 @@ project("spring-test-mvc") { provided("javax.servlet:javax.servlet-api:3.0.1") optional("org.hamcrest:hamcrest-core:1.3") optional("com.jayway.jsonpath:json-path:0.8.1") - optional("xmlunit:xmlunit:1.2") + optional("xmlunit:xmlunit:1.3") testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}") testCompile("javax.servlet:jstl:1.2") testCompile("org.hibernate:hibernate-validator:4.3.0.Final") @@ -656,7 +693,6 @@ project("spring-test-mvc") { testCompile("javax.activation:activation:1.1") testCompile("javax.mail:mail:1.4") testCompile("javax.xml.bind:jaxb-api:2.2.6") - testCompile("org.easymock:easymockclassextension:${easymockVersion}") testCompile("org.apache.tiles:tiles-request-api:1.0.1") testCompile("org.apache.tiles:tiles-api:3.0.1") testCompile("org.apache.tiles:tiles-core:3.0.1") { @@ -763,18 +799,20 @@ configure(rootProject) { project.sourceSets.main.allJava } - classpath = files( - // ensure servlet 3.x and Hibernate 4.x have precedence on the Javadoc - // classpath over their respective 2.5 and 3.x variants - project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" }, - rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" }, - // ensure the javadoc process can resolve types compiled from .aj sources - project(":spring-aspects").sourceSets.main.output - ) - classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath }) - maxMemory = "1024m" destinationDir = new File(buildDir, "api") + + doFirst { + classpath = files( + // ensure servlet 3.x and Hibernate 4.x have precedence on the Javadoc + // classpath over their respective 2.5 and 3.x variants + project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" }, + rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" }, + // ensure the javadoc process can resolve types compiled from .aj sources + project(":spring-aspects").sourceSets.main.output + ) + classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath }) + } } task docsZip(type: Zip) { @@ -917,3 +955,20 @@ configure(rootProject) { } } } + +/* + * Support publication of artifacts versioned by topic branch. + * CI builds supply `-P BRANCH_NAME=` to gradle at build time. + * If starts with 'SPR-', change version + * from BUILD-SNAPSHOT => -SNAPSHOT + * e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT + */ +def qualifyVersionIfNecessary(version) { + if (rootProject.hasProperty("BRANCH_NAME")) { + def qualifier = rootProject.getProperty("BRANCH_NAME") + if (qualifier.startsWith("SPR-")) { + return version.replace('BUILD', qualifier) + } + } + return version +} diff --git a/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy b/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy similarity index 99% rename from buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy rename to buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy index ffe4f873420..097e65ab93c 100644 --- a/buildSrc/src/main/groovy/org/springframework/build/gradle/merge/MergePlugin.groovy +++ b/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.build.gradle.merge +package org.springframework.build.gradle import org.gradle.api.* import org.gradle.api.artifacts.Configuration diff --git a/buildSrc/src/main/groovy/org/springframework/build/gradle/TestSourceSetDependenciesPlugin.groovy b/buildSrc/src/main/groovy/org/springframework/build/gradle/TestSourceSetDependenciesPlugin.groovy new file mode 100644 index 00000000000..1d6134ab597 --- /dev/null +++ b/buildSrc/src/main/groovy/org/springframework/build/gradle/TestSourceSetDependenciesPlugin.groovy @@ -0,0 +1,57 @@ +/* + * Copyright 2002-2013 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 + * + * http://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.gradle + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ProjectDependency; + + +/** + * Gradle plugin that automatically updates testCompile dependencies to include + * the test source sets of project dependencies. + * + * @author Phillip Webb + */ +class TestSourceSetDependenciesPlugin implements Plugin { + + @Override + public void apply(Project project) { + project.afterEvaluate { + Set projectDependencies = new LinkedHashSet() + collectProjectDependencies(projectDependencies, project) + projectDependencies.each { + project.dependencies.add("testCompile", it.dependencyProject.sourceSets.test.output) + } + } + } + + private void collectProjectDependencies(Set projectDependencies, + Project project) { + for(def configurationName in ["compile", "optional", "provided", "testCompile"]) { + Configuration configuration = project.getConfigurations().findByName(configurationName) + if(configuration) { + configuration.dependencies.findAll { it instanceof ProjectDependency }.each { + projectDependencies.add(it) + collectProjectDependencies(projectDependencies, it.dependencyProject) + } + } + } + } + +} diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/merge.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/merge.properties index 5bfccb3d9b4..9cef804165a 100644 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/merge.properties +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/merge.properties @@ -1 +1 @@ -implementation-class=org.springframework.build.gradle.merge.MergePlugin +implementation-class=org.springframework.build.gradle.MergePlugin diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/test-source-set-dependencies.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/test-source-set-dependencies.properties new file mode 100644 index 00000000000..f5df417ad20 --- /dev/null +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/test-source-set-dependencies.properties @@ -0,0 +1 @@ +implementation-class=org.springframework.build.gradle.TestSourceSetDependenciesPlugin diff --git a/import-into-idea.md b/import-into-idea.md index 4bbac88504a..a2f752e7261 100644 --- a/import-into-idea.md +++ b/import-into-idea.md @@ -13,8 +13,8 @@ _Within your locally cloned spring-framework working directory:_ ## Known issues 1. `spring-aspects` does not compile out of the box due to references to aspect types unknown to IDEA. -See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, you may want to -exclude `spring-aspects` from the overall project to avoid compilation errors. +See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the 'spring-aspects' +module has been excluded from the overall project to avoid compilation errors. 2. While all JUnit tests pass from the command line with Gradle, many will fail when run from IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within IDEA, you will likely need to set the following VM options to avoid out of memory errors: diff --git a/settings.gradle b/settings.gradle index 11ce95641fb..8c99e5a179b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,3 +22,7 @@ include "spring-web" include "spring-webmvc" include "spring-webmvc-portlet" include "spring-webmvc-tiles3" + +// Exposes gradle buildSrc for IDE support +include "buildSrc" +rootProject.children.find{ it.name == "buildSrc" }.name = "spring-build-src" diff --git a/spring-aop/src/main/java/org/springframework/aop/Advisor.java b/spring-aop/src/main/java/org/springframework/aop/Advisor.java index 8fe320c0329..8959552925b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/Advisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/Advisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java b/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java index f79397741ee..46362c2b132 100644 --- a/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java +++ b/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java b/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java index 404a1d08452..8c38ff4b81a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java +++ b/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java b/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java index 37f9cb75006..17f7645e7c3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java +++ b/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java index aa49595d51a..b576aa4b219 100644 --- a/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java index 0ab9dd6b9b2..ffefed7eeec 100644 --- a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java index 36ac7ea99be..6ba69a833da 100644 --- a/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java +++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java b/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java index cf3c87d2d1d..fb8b08e220c 100644 --- a/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java +++ b/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java index af2fb26fc1a..15526c1fc8a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/Pointcut.java b/spring-aop/src/main/java/org/springframework/aop/Pointcut.java index 05addda78bb..489e7beb820 100644 --- a/spring-aop/src/main/java/org/springframework/aop/Pointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/Pointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java index 6fb4d884974..7b7c1e78647 100644 --- a/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java index e49c697f3c0..935f745de46 100644 --- a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java +++ b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java b/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java index 53f308b332c..e2eccfac577 100644 --- a/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java +++ b/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/TargetSource.java b/spring-aop/src/main/java/org/springframework/aop/TargetSource.java index bd3185952f2..9633b4b33b1 100644 --- a/spring-aop/src/main/java/org/springframework/aop/TargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/TargetSource.java @@ -1,5 +1,5 @@ /*< - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java b/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java index 2d09d4f6906..248e2f64167 100644 --- a/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java +++ b/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java index a97872ab320..a8bf94dcae4 100644 --- a/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java b/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java index 4416fe866db..553b0e9d6dd 100644 --- a/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java index 3c169119775..2f1e7aaa6bc 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java index 0ef76eba69d..42a2c6f729f 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java index 7f869ed80d1..fd5b0d64c4a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java index 16308507e17..2155c81cd54 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java index c4ddcaab9ab..7e101ea57d6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java index 49fa6da5eb7..70b6575076b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java index 8d80da138c5..3463e8cc613 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java index c8329e413ad..4505e6f3300 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java index 3838c7bda6c..27618c9b466 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java index a2e8a6a64ca..fbdcf093131 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java index 4cc0b44f744..fa470759cdd 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java index 3316e765824..40049e978e0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java index 58173805d74..7f550a333d1 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java index 1ae00d24210..adb8c4db372 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java index 92721d5c778..5b3f48bce87 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java index 62d14147178..9eff81682b2 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java index a85a138ca26..36bf1151052 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java index 3aefe815c94..ccf2aa610bf 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java index fecd7b2e2a8..81a6c2a3ad1 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java index bf1856b6a43..b9863ab67ad 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java index c4401b17cc9..1c45cbc2f65 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java index 5bea20f88f4..bb623b372b7 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java index 8478f7390db..ef9014a1445 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java index 9f70ed53a07..dbfcbd380e3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java index d05e67b5dad..0dd176354eb 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java b/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java index e8decbf4697..6e58344f80f 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java index 180ea636a36..85e59523a76 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java index b28e6d3e03a..374e40290a6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java index dc3b4f9ea8e..13be36d8f3f 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java index 6d97412f9d5..3da1f13f0a2 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java index b250bf747e6..611376efb92 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java index 9d19ec544b2..73ff37197c0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java b/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java index d9e5b43615b..aa3d70d11e7 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java b/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java index f97d8230eb5..9f75cba9be9 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java index e1cf5f65f32..10f6327e5c1 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java b/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java index 797b5f66987..0d2daf364f5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java b/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java index ffc317ce376..3c822cf2da5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java index 63d87112690..e5f89177b60 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java index 33e09ae1d6b..26a45a46571 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java index ca61dcc557b..13a86ecb899 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java index c002e43a517..80c66905643 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java index 595eb35c65d..9a2e2298e4f 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java index a602cefe37c..5ac4ed7f664 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java b/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java index defb0bada9e..90eeef7b48c 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyConfig.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyConfig.java index e8decfcf94c..fc7ae7b878a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyConfig.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyCreatorSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyCreatorSupport.java index 4adef07407e..e1867efd7e3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyCreatorSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyCreatorSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java index 257f2f2190b..a369f56c824 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java b/spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java index 5062a916c5b..c9ac099b484 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapter.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapter.java index b1f5a6396d2..425c3f87c4c 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapter.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistry.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistry.java index 1c69281c708..9eacf479bad 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistry.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceAdapter.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceAdapter.java index 07257fecb72..a921e6e5095 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceAdapter.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceInterceptor.java index 9b6dfa3fd95..9f8f698faf5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/DefaultAdvisorAdapterRegistry.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/DefaultAdvisorAdapterRegistry.java index da5f7025edf..136f004586b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/DefaultAdvisorAdapterRegistry.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/DefaultAdvisorAdapterRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceAdapter.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceAdapter.java index 222a63129d6..6fc3cdef5ed 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceAdapter.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java index 3aebd504845..83d7b8e851a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java index 386d3a75df1..687a6d5f8ba 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java index 32f3d2d44d1..69b0bd1cc57 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/UnknownAdviceTypeException.java b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/UnknownAdviceTypeException.java index c0e840b055b..e95e513caaa 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/adapter/UnknownAdviceTypeException.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/adapter/UnknownAdviceTypeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java index c9aae651d56..035442282de 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java index b48ae0905ea..88a75e877a6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanFactoryAdvisorRetrievalHelper.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanFactoryAdvisorRetrievalHelper.java index ab056cd6884..e417f92df02 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanFactoryAdvisorRetrievalHelper.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanFactoryAdvisorRetrievalHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java index 7b517282c8d..e91f9db74a4 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java index f84bf4f55db..953a751d320 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/InfrastructureAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/InfrastructureAdvisorAutoProxyCreator.java index d48716f9d00..90034eafbba 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/InfrastructureAdvisorAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/InfrastructureAdvisorAutoProxyCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java index 0adb7d7e2a2..ce350d651b5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/TargetSourceCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/TargetSourceCreator.java index 5acae865f49..67f9638ce45 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/TargetSourceCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/TargetSourceCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java index 510b6d8da1d..c1ef00cbe28 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java index 9667931793f..d972b95cf16 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java index 82db223aa35..0159d307a16 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java index 438fa3cff76..7c29c775bce 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java index 4298008d9be..8f6f3ee479a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java index 93228b1af76..a5d1f508051 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/DebugInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/DebugInterceptor.java index 4f9b95a9197..0a2c2ec8e94 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/DebugInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/DebugInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java index bffad2c4d1f..a4ce58d5282 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java index 9d25008e912..c5443e7dc31 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptor.java index 8f14116ac8c..5ff0f9cba8c 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptor.java index fd3f5375604..4362c5de10d 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleTraceInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleTraceInterceptor.java index ec794cb5fd6..e70f502fd10 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleTraceInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleTraceInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java b/spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java index cc07afc997b..95009495ba3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java +++ b/spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedObject.java b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedObject.java index 9e46d230cd2..4b7046e3595 100644 --- a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedObject.java +++ b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java index 2193d8b6746..34bc7b9b740 100644 --- a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java +++ b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java index e59267d30f3..fdd0253d6ed 100644 --- a/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java +++ b/spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java index 938a7cb7421..3715a9ca702 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java index dc48762686b..74a62a7ba9b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/AbstractGenericPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/AbstractGenericPointcutAdvisor.java index c0fcb7c791b..53494a14ce5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/AbstractGenericPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/AbstractGenericPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/AbstractPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/AbstractPointcutAdvisor.java index 4b362c8407e..8dc2fb0a3ea 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/AbstractPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/AbstractPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java b/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java index 4abb43c8f22..1dea2cb113b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java index 1ec8a012299..b537a6ab8e5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java index 008e9105c90..4de481fcba0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultBeanFactoryPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultBeanFactoryPointcutAdvisor.java index 1324847e126..92fb3c45525 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultBeanFactoryPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultBeanFactoryPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java index f9a7e33e5dd..e1aad6a1701 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java index 64d6651af55..f4b16915f94 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java index ac0199a69ea..5eeeea60d60 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2087 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java index 53211519e38..c27d1872cff 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java index 6a6a70c9851..9427a647deb 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java index e70530b0982..35d765c2977 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java b/spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java index 1279087de17..c8807f76393 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/JdkRegexpMethodPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/JdkRegexpMethodPointcut.java index 82409fc0091..071da29247a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/JdkRegexpMethodPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/JdkRegexpMethodPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java index 75d56678adb..be8b5bca7f8 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java index ddbec48ffeb..69389d0bf57 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java index ef939cfb553..c2f85b58811 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java b/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java index 267083cc703..2bfbcb1c323 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java index 5cc14d909bf..1edb2d746b2 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java b/spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java index 955f92ef03e..461252e6179 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java index 27209a18ac1..6efebf1106b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java b/spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java index 9bafe1bd499..acdbbeff881 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java index 8a2d9a6a272..3192fab5fe9 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java index 86259b7abe3..6fdd24ef92e 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java index ccb8b56637a..91e1b72ee7a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java index 096fd2f46fa..47a35f756e8 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java index f6358585e27..193259ba8db 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java index 37f5b99d46f..dcb6108e871 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/PoolingConfig.java b/spring-aop/src/main/java/org/springframework/aop/target/PoolingConfig.java index ddaad787043..c671f024f5a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/PoolingConfig.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/PoolingConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java index ed372d085ec..81642f6b2e4 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java index 911eb837f11..14560404c47 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java index 844073a5ab8..cd2dfb0c0c0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSourceStats.java b/spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSourceStats.java index 688b8913306..f3801a79dbe 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSourceStats.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSourceStats.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java index 865e4fa6997..7aba951ee57 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/BeanFactoryRefreshableTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/BeanFactoryRefreshableTargetSource.java index 76c17e33378..f2f894dbec0 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/BeanFactoryRefreshableTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/BeanFactoryRefreshableTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/Refreshable.java b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/Refreshable.java index 82d16e7fd48..187544e6d84 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/dynamic/Refreshable.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/dynamic/Refreshable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverAnnotationTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverAnnotationTests.java index 0d523ba87e3..5efbb2f893a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverAnnotationTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java index 73ec4283958..7662195c0fd 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java index 2b09c8a30d0..429350b00d8 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,10 +33,10 @@ import org.springframework.aop.Pointcut; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.DefaultPointcutAdvisor; -import test.beans.IOther; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.beans.subpkg.DeepBean; +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; /** * @author Rob Harrop @@ -66,7 +66,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testMatchExplicit() { - String expression = "execution(int test.beans.TestBean.getAge())"; + String expression = "execution(int org.springframework.tests.sample.beans.TestBean.getAge())"; Pointcut pointcut = getPointcut(expression); ClassFilter classFilter = pointcut.getClassFilter(); @@ -113,6 +113,7 @@ public final class AspectJExpressionPointcutTests { public static class OtherIOther implements IOther { + @Override public void absquatulate() { // Empty } @@ -127,8 +128,8 @@ public final class AspectJExpressionPointcutTests { * @throws SecurityException */ private void testThisOrTarget(String which) throws SecurityException, NoSuchMethodException { - String matchesTestBean = which + "(test.beans.TestBean)"; - String matchesIOther = which + "(test.beans.IOther)"; + String matchesTestBean = which + "(org.springframework.tests.sample.beans.TestBean)"; + String matchesIOther = which + "(org.springframework.tests.sample.beans.IOther)"; AspectJExpressionPointcut testBeanPc = new AspectJExpressionPointcut(); testBeanPc.setExpression(matchesTestBean); @@ -155,7 +156,7 @@ public final class AspectJExpressionPointcutTests { } private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException { - String withinBeansPackage = "within(test.beans."; + String withinBeansPackage = "within(org.springframework.tests.sample.beans."; // Subpackages are matched by ** if (matchSubpackages) { withinBeansPackage += "."; @@ -213,7 +214,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testMatchWithArgs() throws Exception { - String expression = "execution(void test.beans.TestBean.setSomeNumber(Number)) && args(Double)"; + String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)"; Pointcut pointcut = getPointcut(expression); ClassFilter classFilter = pointcut.getClassFilter(); @@ -234,7 +235,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testSimpleAdvice() { - String expression = "execution(int test.beans.TestBean.getAge())"; + String expression = "execution(int org.springframework.tests.sample.beans.TestBean.getAge())"; CallCountingInterceptor interceptor = new CallCountingInterceptor(); @@ -253,7 +254,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testDynamicMatchingProxy() { - String expression = "execution(void test.beans.TestBean.setSomeNumber(Number)) && args(Double)"; + String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)"; CallCountingInterceptor interceptor = new CallCountingInterceptor(); @@ -272,7 +273,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testInvalidExpression() { - String expression = "execution(void test.beans.TestBean.setSomeNumber(Number) && args(Double)"; + String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number) && args(Double)"; try { getPointcut(expression).getClassFilter(); // call to getClassFilter forces resolution @@ -314,7 +315,7 @@ public final class AspectJExpressionPointcutTests { @Test public void testWithUnsupportedPointcutPrimitive() throws Exception { - String expression = "call(int test.beans.TestBean.getAge())"; + String expression = "call(int org.springframework.tests.sample.beans.TestBean.getAge())"; try { getPointcut(expression).getClassFilter(); // call to getClassFilter forces resolution... @@ -354,6 +355,7 @@ class CallCountingInterceptor implements MethodInterceptor { private int count; + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { count++; return methodInvocation.proceed(); diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutMatchingTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutMatchingTests.java index 37140304cbf..057ad77309f 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutMatchingTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.*; import org.junit.Test; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Tests for matching of bean() pointcut designator. @@ -90,6 +90,7 @@ public final class BeanNamePointcutMatchingTests { private static boolean matches(final String beanName, String pcExpression) { @SuppressWarnings("serial") AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut() { + @Override protected String getCurrentProxiedBeanName() { return beanName; } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java index e72e475abee..551756eea73 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -28,8 +28,8 @@ import org.aspectj.lang.reflect.SourceLocation; import org.aspectj.runtime.reflect.Factory; import static org.junit.Assert.*; import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.aop.MethodBeforeAdvice; import org.springframework.aop.framework.AopContext; @@ -79,6 +79,7 @@ public final class MethodInvocationProceedingJoinPointTests { pf.addAdvice(new MethodBeforeAdvice() { private int depth; + @Override public void before(Method method, Object[] args, Object target) throws Throwable { JoinPoint jp = AbstractAspectJAdvice.currentJoinPoint(); assertTrue("Method named in toString", jp.toString().contains(method.getName())); @@ -135,6 +136,7 @@ public final class MethodInvocationProceedingJoinPointTests { ProxyFactory pf = new ProxyFactory(raw); pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR); pf.addAdvice(new MethodBeforeAdvice() { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { SourceLocation sloc = AbstractAspectJAdvice.currentJoinPoint().getSourceLocation(); assertEquals("Same source location must be returned on subsequent requests", sloc, AbstractAspectJAdvice.currentJoinPoint().getSourceLocation()); @@ -167,6 +169,7 @@ public final class MethodInvocationProceedingJoinPointTests { ProxyFactory pf = new ProxyFactory(raw); pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR); pf.addAdvice(new MethodBeforeAdvice() { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { StaticPart staticPart = AbstractAspectJAdvice.currentJoinPoint().getStaticPart(); assertEquals("Same static part must be returned on subsequent requests", staticPart, AbstractAspectJAdvice.currentJoinPoint().getStaticPart()); @@ -186,6 +189,7 @@ public final class MethodInvocationProceedingJoinPointTests { ProxyFactory pf = new ProxyFactory(raw); pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR); pf.addAdvice(new MethodBeforeAdvice() { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { // makeEncSJP, although meant for computing the enclosing join point, // it serves our purpose here diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJAdviceParameterNameDiscovererTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJAdviceParameterNameDiscovererTests.java index d9769685c5d..2b92a5c6611 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJAdviceParameterNameDiscovererTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJAdviceParameterNameDiscovererTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java index c3e1f0c120b..13635c2c6d1 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -29,7 +29,7 @@ import org.junit.Test; import test.annotation.EmptySpringAnnotation; import test.annotation.transaction.Tx; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** @@ -70,7 +70,7 @@ public final class TigerAspectJExpressionPointcutTests { @Test public void testMatchGenericArgument() { - String expression = "execution(* set*(java.util.List) )"; + String expression = "execution(* set*(java.util.List) )"; AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut(); ajexp.setExpression(expression); diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java index c10c50ddf8a..088ba138c35 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java @@ -137,6 +137,7 @@ public class TrickyAspectJPointcutExpressionTests { @Log public static class TestServiceImpl implements TestService { + @Override public String sayHello() { throw new TestException("TestServiceImpl"); } @@ -148,6 +149,7 @@ public class TrickyAspectJPointcutExpressionTests { private int countThrows = 0; + @Override public void before(Method method, Object[] objects, Object o) throws Throwable { countBefore++; } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/TypePatternClassFilterTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/TypePatternClassFilterTests.java index 7ad0b7c7682..0275360441b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/TypePatternClassFilterTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/TypePatternClassFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -22,11 +22,11 @@ import org.junit.Test; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import test.beans.CountingTestBean; -import test.beans.IOther; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.beans.subpkg.DeepBean; +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; /** * Unit tests for the {@link TypePatternClassFilter} class. @@ -45,7 +45,7 @@ public final class TypePatternClassFilterTests { @Test public void testValidPatternMatching() { - TypePatternClassFilter tpcf = new TypePatternClassFilter("test.beans.*"); + TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.*"); assertTrue("Must match: in package", tpcf.matches(TestBean.class)); assertTrue("Must match: in package", tpcf.matches(ITestBean.class)); assertTrue("Must match: in package", tpcf.matches(IOther.class)); @@ -56,7 +56,7 @@ public final class TypePatternClassFilterTests { @Test public void testSubclassMatching() { - TypePatternClassFilter tpcf = new TypePatternClassFilter("test.beans.ITestBean+"); + TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.ITestBean+"); assertTrue("Must match: in package", tpcf.matches(TestBean.class)); assertTrue("Must match: in package", tpcf.matches(ITestBean.class)); assertTrue("Must match: in package", tpcf.matches(CountingTestBean.class)); diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java index f6f82fb4122..273869e8a0a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -58,8 +58,8 @@ import test.aop.DefaultLockable; import test.aop.Lockable; import test.aop.PerTargetAspect; import test.aop.TwoAdviceAspect; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Abstract tests for AspectJAdvisorFactory. @@ -650,7 +650,7 @@ public abstract class AbstractAspectJAdvisorFactoryTests { } - @Aspect("pertypewithin(test.beans.IOther+)") + @Aspect("pertypewithin(org.springframework.tests.sample.beans.IOther+)") public static class PerTypeWithinAspect { public int count; @@ -675,19 +675,23 @@ public abstract class AbstractAspectJAdvisorFactoryTests { return this.count; } + @Override public Object getAspectInstance() { ++this.count; return new PerTypeWithinAspect(); } + @Override public ClassLoader getAspectClassLoader() { return PerTypeWithinAspect.class.getClassLoader(); } + @Override public AspectMetadata getAspectMetadata() { return new AspectMetadata(PerTypeWithinAspect.class, "perTypeWithin"); } + @Override public int getOrder() { return Ordered.LOWEST_PRECEDENCE; } @@ -897,14 +901,17 @@ abstract class AbstractMakeModifiable { public static class ModifiableImpl implements MutableModifable { private boolean modified; + @Override public void acceptChanges() { modified = false; } + @Override public boolean isModified() { return modified; } + @Override public void markDirty() { this.modified = true; } @@ -972,7 +979,7 @@ abstract class AbstractMakeModifiable { @Aspect class MakeITestBeanModifiable extends AbstractMakeModifiable { - @DeclareParents(value = "test.beans.ITestBean+", + @DeclareParents(value = "org.springframework.tests.sample.beans.ITestBean+", defaultImpl=ModifiableImpl.class) public static MutableModifable mixin; @@ -1020,17 +1027,21 @@ class MakeLockable { class CannotBeUnlocked implements Lockable, Comparable { + @Override public void lock() { } + @Override public void unlock() { throw new UnsupportedOperationException(); } + @Override public boolean locked() { return true; } + @Override public int compareTo(Object arg0) { throw new UnsupportedOperationException(); } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java index ebb9f03c437..66d5e0f739e 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -29,8 +29,8 @@ import org.aspectj.lang.annotation.Pointcut; import org.junit.Test; import org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Adrian Colyer @@ -84,6 +84,7 @@ public final class ArgumentBindingTests { public static class TransactionalBean implements ITransactionalBean { + @Override @Transactional public void doInTransaction() { } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectJPointcutAdvisorTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectJPointcutAdvisorTests.java index 1627f57d69c..966d289eb13 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectJPointcutAdvisorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectJPointcutAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import org.springframework.aop.aspectj.AspectJExpressionPointcutTests; import org.springframework.aop.framework.AopConfigException; import test.aop.PerTargetAspect; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectMetadataTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectMetadataTests.java index 472b495a50d..af55e122a63 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectMetadataTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectMetadataTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java index d6c24cd0a10..16d6f0e9e79 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -16,14 +16,16 @@ package org.springframework.aop.aspectj.annotation; +import static org.junit.Assert.assertEquals; + import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; -import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; +import org.springframework.util.SerializationTestUtils; + import test.aop.PerThisAspect; -import test.util.SerializationTestUtils; /** * @author Rob Harrop @@ -111,6 +113,7 @@ public final class AspectProxyFactoryTests { private int age; + @Override public int getAge() { return age; } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactoryTests.java index 085e8c5d9f5..f01d1bb9c6b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java index 6b7d3ff0965..f1ff305aad4 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.aop.aspectj.autoproxy; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; @@ -30,8 +30,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 test.parsing.CollectingReaderEventListener; +import org.springframework.tests.beans.CollectingReaderEventListener; /** * @author Rob Harrop diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java index de10e14b420..08d95808edc 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -194,6 +194,7 @@ public final class AspectJPrecedenceComparatorTests { private Advisor createSpringAOPAfterAdvice(int order) { AfterReturningAdvice advice = new AfterReturningAdvice() { + @Override public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable { } }; diff --git a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests-context.xml index 939493b2eb0..984f5ada7b8 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests-context.xml @@ -20,7 +20,7 @@ - + diff --git a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests.java b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests.java index de575c88426..fec13dbbed1 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,10 @@ package org.springframework.aop.config; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import java.util.HashSet; import java.util.Set; @@ -32,8 +34,7 @@ import org.springframework.beans.factory.parsing.CompositeComponentDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; - -import test.parsing.CollectingReaderEventListener; +import org.springframework.tests.beans.CollectingReaderEventListener; /** * @author Rob Harrop diff --git a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutDuplication.xml b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutDuplication.xml index 472b91f7183..cd01ffd5326 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutDuplication.xml +++ b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutDuplication.xml @@ -14,7 +14,7 @@ - + diff --git a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutMissing.xml b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutMissing.xml index 7654895ccee..850fbc15d1b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutMissing.xml +++ b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests-pointcutMissing.xml @@ -14,7 +14,7 @@ - + diff --git a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests.java b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests.java index fcb34b4012d..7320dd553cc 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,13 +16,15 @@ package org.springframework.aop.config; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Test; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.parsing.BeanDefinitionParsingException; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; /** * @author Mark Fisher @@ -33,7 +35,9 @@ public final class AopNamespaceHandlerPointcutErrorTests { @Test public void testDuplicatePointcutConfig() { try { - new XmlBeanFactory(qualifiedResource(getClass(), "pointcutDuplication.xml")); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + qualifiedResource(getClass(), "pointcutDuplication.xml")); fail("parsing should have caused a BeanDefinitionStoreException"); } catch (BeanDefinitionStoreException ex) { @@ -44,7 +48,9 @@ public final class AopNamespaceHandlerPointcutErrorTests { @Test public void testMissingPointcutConfig() { try { - new XmlBeanFactory(qualifiedResource(getClass(), "pointcutMissing.xml")); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + qualifiedResource(getClass(), "pointcutMissing.xml")); fail("parsing should have caused a BeanDefinitionStoreException"); } catch (BeanDefinitionStoreException ex) { diff --git a/spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java b/spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java index 40209c7d7bf..9e0b3d14ebb 100644 --- a/spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,7 +17,7 @@ package org.springframework.aop.config; import static org.junit.Assert.assertTrue; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java index fc5268c840d..e2abdda7993 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -27,8 +27,8 @@ import java.util.List; import org.junit.Test; import org.springframework.aop.SpringProxy; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -129,6 +129,7 @@ public final class AopProxyUtilsTests { public void testProxiedUserInterfacesWithNoInterface() { Object proxy = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[0], new InvocationHandler() { + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return null; } diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java index 9de89648053..eaaf2d8d42b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -20,8 +20,8 @@ import org.junit.Test; import org.springframework.aop.support.DelegatingIntroductionInterceptor; import org.springframework.util.StopWatch; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Benchmarks for introductions. @@ -42,6 +42,7 @@ public final class IntroductionBenchmarkTests { @SuppressWarnings("serial") public static class SimpleCounterIntroduction extends DelegatingIntroductionInterceptor implements Counter { + @Override public int getCount() { return EXPECTED_COMPARE; } diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java index f5c4a8edcae..139ef6c415e 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.junit.Test; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -42,6 +42,7 @@ public final class MethodInvocationTests { final Object returnValue = new Object(); List is = new LinkedList(); is.add(new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { return returnValue; } diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/NullPrimitiveTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/NullPrimitiveTests.java index 1879f8a4cd4..11b127d0bcb 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/NullPrimitiveTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/NullPrimitiveTests.java @@ -44,6 +44,7 @@ public class NullPrimitiveTests { public void testNullPrimitiveWithJdkProxy() { class SimpleFoo implements Foo { + @Override public int getValue() { return 100; } @@ -52,6 +53,7 @@ public class NullPrimitiveTests { SimpleFoo target = new SimpleFoo(); ProxyFactory factory = new ProxyFactory(target); factory.addAdvice(new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { return null; } @@ -76,6 +78,7 @@ public class NullPrimitiveTests { Bar target = new Bar(); ProxyFactory factory = new ProxyFactory(target); factory.addAdvice(new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { return null; } diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/PrototypeTargetTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/PrototypeTargetTests.java index 814b9025409..d9d43527dec 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/PrototypeTargetTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/PrototypeTargetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,12 +17,13 @@ package org.springframework.aop.framework; import static org.junit.Assert.assertEquals; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.junit.Test; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; /** @@ -37,12 +38,13 @@ public final class PrototypeTargetTests { @Test public void testPrototypeProxyWithPrototypeTarget() { TestBeanImpl.constructionCount = 0; - XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); for (int i = 0; i < 10; i++) { - TestBean tb = (TestBean) xbf.getBean("testBeanPrototype"); + TestBean tb = (TestBean) bf.getBean("testBeanPrototype"); tb.doSomething(); } - TestInterceptor interceptor = (TestInterceptor) xbf.getBean("testInterceptor"); + TestInterceptor interceptor = (TestInterceptor) bf.getBean("testInterceptor"); assertEquals(10, TestBeanImpl.constructionCount); assertEquals(10, interceptor.invocationCount); } @@ -50,12 +52,13 @@ public final class PrototypeTargetTests { @Test public void testSingletonProxyWithPrototypeTarget() { TestBeanImpl.constructionCount = 0; - XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); for (int i = 0; i < 10; i++) { - TestBean tb = (TestBean) xbf.getBean("testBeanSingleton"); + TestBean tb = (TestBean) bf.getBean("testBeanSingleton"); tb.doSomething(); } - TestInterceptor interceptor = (TestInterceptor) xbf.getBean("testInterceptor"); + TestInterceptor interceptor = (TestInterceptor) bf.getBean("testInterceptor"); assertEquals(1, TestBeanImpl.constructionCount); assertEquals(10, interceptor.invocationCount); } @@ -73,6 +76,7 @@ public final class PrototypeTargetTests { constructionCount++; } + @Override public void doSomething() { } } @@ -81,6 +85,7 @@ public final class PrototypeTargetTests { public static class TestInterceptor implements MethodInterceptor { private int invocationCount = 0; + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { invocationCount++; return methodInvocation.proceed(); diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java index f8999fe6744..7f856028885 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -16,28 +16,33 @@ package org.springframework.aop.framework; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import javax.accessibility.Accessible; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.RootPaneContainer; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; -import test.aop.CountingBeforeAdvice; -import test.aop.NopInterceptor; -import test.beans.IOther; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.util.TimeStamped; - import org.springframework.aop.Advisor; 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.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; /** * Also tests AdvisedSupport and ProxyCreatorSupport superclasses. @@ -165,6 +170,7 @@ public final class ProxyFactoryTests { @Test public void testAddRepeatedInterface() { TimeStamped tst = new TimeStamped() { + @Override public long getTimeStamp() { throw new UnsupportedOperationException("getTimeStamp"); } @@ -181,6 +187,7 @@ public final class ProxyFactoryTests { public void testGetsAllInterfaces() throws Exception { // Extend to get new interface class TestBeanSubclass extends TestBean implements Comparable { + @Override public int compareTo(Object arg0) { throw new UnsupportedOperationException("compareTo"); } @@ -188,7 +195,7 @@ public final class ProxyFactoryTests { TestBeanSubclass raw = new TestBeanSubclass(); ProxyFactory factory = new ProxyFactory(raw); //System.out.println("Proxied interfaces are " + StringUtils.arrayToDelimitedString(factory.getProxiedInterfaces(), ",")); - assertEquals("Found correct number of interfaces", 3, factory.getProxiedInterfaces().length); + assertEquals("Found correct number of interfaces", 5, factory.getProxiedInterfaces().length); ITestBean tb = (ITestBean) factory.getProxy(); assertThat("Picked up secondary interface", tb, instanceOf(IOther.class)); @@ -214,6 +221,7 @@ public final class ProxyFactoryTests { @Test public void testInterceptorInclusionMethods() { class MyInterceptor implements MethodInterceptor { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { throw new UnsupportedOperationException(); } @@ -350,6 +358,7 @@ public final class ProxyFactoryTests { this.ts = ts; } + @Override public long getTimeStamp() { return ts; } diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java index ceae4f577e8..633705f0686 100644 --- a/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,19 +16,23 @@ package org.springframework.aop.framework.adapter; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; + import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.Method; import java.rmi.RemoteException; + import javax.transaction.TransactionRolledbackException; import org.aopalliance.intercept.MethodInvocation; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; import org.junit.Test; -import test.aop.MethodCounter; - import org.springframework.aop.ThrowsAdvice; +import org.springframework.tests.aop.advice.MethodCounter; + /** * @author Rod Johnson @@ -47,12 +51,10 @@ public final class ThrowsAdviceInterceptorTests { MyThrowsHandler th = new MyThrowsHandler(); ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); Object ret = new Object(); - MethodInvocation mi = createMock(MethodInvocation.class); - expect(mi.proceed()).andReturn(ret); - replay(mi); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.proceed()).willReturn(ret); assertEquals(ret, ti.invoke(mi)); assertEquals(0, th.getCalls()); - verify(mi); } @Test @@ -61,9 +63,8 @@ public final class ThrowsAdviceInterceptorTests { ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); assertEquals(2, ti.getHandlerMethodCount()); Exception ex = new Exception(); - MethodInvocation mi = createMock(MethodInvocation.class); - expect(mi.proceed()).andThrow(ex); - replay(mi); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.proceed()).willThrow(ex); try { ti.invoke(mi); fail(); @@ -72,7 +73,6 @@ public final class ThrowsAdviceInterceptorTests { assertEquals(ex, caught); } assertEquals(0, th.getCalls()); - verify(mi); } @Test @@ -80,12 +80,10 @@ public final class ThrowsAdviceInterceptorTests { MyThrowsHandler th = new MyThrowsHandler(); ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); FileNotFoundException ex = new FileNotFoundException(); - MethodInvocation mi = createMock(MethodInvocation.class); - expect(mi.getMethod()).andReturn(Object.class.getMethod("hashCode", (Class[]) null)); - expect(mi.getArguments()).andReturn(null); - expect(mi.getThis()).andReturn(new Object()); - expect(mi.proceed()).andThrow(ex); - replay(mi); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.getMethod()).willReturn(Object.class.getMethod("hashCode", (Class[]) null)); + given(mi.getThis()).willReturn(new Object()); + given(mi.proceed()).willThrow(ex); try { ti.invoke(mi); fail(); @@ -95,7 +93,6 @@ public final class ThrowsAdviceInterceptorTests { } assertEquals(1, th.getCalls()); assertEquals(1, th.getCalls("ioException")); - verify(mi); } @Test @@ -104,9 +101,8 @@ public final class ThrowsAdviceInterceptorTests { ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); // Extends RemoteException TransactionRolledbackException ex = new TransactionRolledbackException(); - MethodInvocation mi = createMock(MethodInvocation.class); - expect(mi.proceed()).andThrow(ex); - replay(mi); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.proceed()).willThrow(ex); try { ti.invoke(mi); fail(); @@ -116,7 +112,6 @@ public final class ThrowsAdviceInterceptorTests { } assertEquals(1, th.getCalls()); assertEquals(1, th.getCalls("remoteException")); - verify(mi); } @Test @@ -125,6 +120,7 @@ public final class ThrowsAdviceInterceptorTests { @SuppressWarnings("serial") MyThrowsHandler th = new MyThrowsHandler() { + @Override public void afterThrowing(RemoteException ex) throws Throwable { super.afterThrowing(ex); throw t; @@ -134,9 +130,8 @@ public final class ThrowsAdviceInterceptorTests { ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); // Extends RemoteException TransactionRolledbackException ex = new TransactionRolledbackException(); - MethodInvocation mi = createMock(MethodInvocation.class); - expect(mi.proceed()).andThrow(ex); - replay(mi); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.proceed()).willThrow(ex); try { ti.invoke(mi); fail(); @@ -146,7 +141,6 @@ public final class ThrowsAdviceInterceptorTests { } assertEquals(1, th.getCalls()); assertEquals(1, th.getCalls("remoteException")); - verify(mi); } @SuppressWarnings("serial") diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptorTests.java index 9b3aaf6d9a3..db2751f5137 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,19 +16,17 @@ package org.springframework.aop.interceptor; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; - import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.ProxyFactory; - -import test.beans.DerivedTestBean; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.util.SerializationTestUtils; +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; /** * @author Juergen Hoeller @@ -120,6 +118,7 @@ public final class ConcurrencyThrottleInterceptorTests { this.ex = ex; } + @Override public void run() { if (this.ex != null) { try { diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java index 1fe27b3dfc5..77aad8e9ff1 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,13 @@ package org.springframework.aop.interceptor; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import java.lang.reflect.Method; @@ -83,47 +88,32 @@ public final class CustomizableTraceInterceptorTests { @Test public void testSunnyDayPathLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation methodInvocation = createMock(MethodInvocation.class); + MethodInvocation methodInvocation = mock(MethodInvocation.class); + given(methodInvocation.getMethod()).willReturn(String.class.getMethod("toString", new Class[]{})); + given(methodInvocation.getThis()).willReturn(this); - Method toString = String.class.getMethod("toString", new Class[]{}); - - expect(log.isTraceEnabled()).andReturn(true); - expect(methodInvocation.getMethod()).andReturn(toString).times(4); - expect(methodInvocation.getThis()).andReturn(this).times(2); - log.trace(isA(String.class)); - expect(methodInvocation.proceed()).andReturn(null); - log.trace(isA(String.class)); - - replay(methodInvocation); - replay(log); + Log log = mock(Log.class); + given(log.isTraceEnabled()).willReturn(true); CustomizableTraceInterceptor interceptor = new StubCustomizableTraceInterceptor(log); interceptor.invoke(methodInvocation); - verify(log); - verify(methodInvocation); + verify(log, times(2)).trace(anyString()); } @Test public void testExceptionPathLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation methodInvocation = createMock(MethodInvocation.class); + MethodInvocation methodInvocation = mock(MethodInvocation.class); - Method toString = String.class.getMethod("toString", new Class[]{}); - - expect(log.isTraceEnabled()).andReturn(true); - expect(methodInvocation.getMethod()).andReturn(toString).times(4); - expect(methodInvocation.getThis()).andReturn(this).times(2); - log.trace(isA(String.class)); IllegalArgumentException exception = new IllegalArgumentException(); - expect(methodInvocation.proceed()).andThrow(exception); - log.trace(isA(String.class), eq(exception)); + given(methodInvocation.getMethod()).willReturn(String.class.getMethod("toString", new Class[]{})); + given(methodInvocation.getThis()).willReturn(this); + given(methodInvocation.proceed()).willThrow(exception); - replay(log); - replay(methodInvocation); + Log log = mock(Log.class); + given(log.isTraceEnabled()).willReturn(true); CustomizableTraceInterceptor interceptor = new StubCustomizableTraceInterceptor(log); try { @@ -133,29 +123,22 @@ public final class CustomizableTraceInterceptorTests { catch (IllegalArgumentException expected) { } - verify(log); - verify(methodInvocation); + verify(log).trace(anyString()); + verify(log).trace(anyString(), eq(exception)); } @Test public void testSunnyDayPathLogsCorrectlyWithPrettyMuchAllPlaceholdersMatching() throws Throwable { - Log log = createMock(Log.class); - - MethodInvocation methodInvocation = createMock(MethodInvocation.class); - Method toString = String.class.getMethod("toString", new Class[0]); - Object[] arguments = new Object[]{"$ One \\$", new Long(2)}; + MethodInvocation methodInvocation = mock(MethodInvocation.class); - expect(log.isTraceEnabled()).andReturn(true); - expect(methodInvocation.getMethod()).andReturn(toString).times(7); - expect(methodInvocation.getThis()).andReturn(this).times(2); - expect(methodInvocation.getArguments()).andReturn(arguments).times(2); - log.trace(isA(String.class)); - expect(methodInvocation.proceed()).andReturn("Hello!"); - log.trace(isA(String.class)); + given(methodInvocation.getMethod()).willReturn(String.class.getMethod("toString", new Class[0])); + given(methodInvocation.getThis()).willReturn(this); + given(methodInvocation.getArguments()).willReturn(new Object[]{"$ One \\$", new Long(2)}); + given(methodInvocation.proceed()).willReturn("Hello!"); - replay(methodInvocation); - replay(log); + Log log = mock(Log.class); + given(log.isTraceEnabled()).willReturn(true); CustomizableTraceInterceptor interceptor = new StubCustomizableTraceInterceptor(log); interceptor.setEnterMessage(new StringBuffer() @@ -174,8 +157,7 @@ public final class CustomizableTraceInterceptorTests { .append("' this long.").toString()); interceptor.invoke(methodInvocation); - verify(log); - verify(methodInvocation); + verify(log, times(2)).trace(anyString()); } @@ -189,6 +171,7 @@ public final class CustomizableTraceInterceptorTests { this.log = log; } + @Override protected Log getLoggerForInvocation(MethodInvocation invocation) { return this.log; } diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java index cd7f8b8bda5..d0cee0780eb 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,13 @@ package org.springframework.aop.interceptor; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; @@ -33,40 +38,29 @@ public final class DebugInterceptorTests { @Test public void testSunnyDayPathLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation methodInvocation = createMock(MethodInvocation.class); + MethodInvocation methodInvocation = mock(MethodInvocation.class); - expect(log.isTraceEnabled()).andReturn(true); - log.trace(isA(String.class)); - expect(methodInvocation.proceed()).andReturn(null); - log.trace(isA(String.class)); - - replay(methodInvocation); - replay(log); + Log log = mock(Log.class); + given(log.isTraceEnabled()).willReturn(true); DebugInterceptor interceptor = new StubDebugInterceptor(log); interceptor.invoke(methodInvocation); checkCallCountTotal(interceptor); - verify(methodInvocation); - verify(log); + verify(log, times(2)).trace(anyString()); } @Test public void testExceptionPathStillLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation methodInvocation = createMock(MethodInvocation.class); + MethodInvocation methodInvocation = mock(MethodInvocation.class); - expect(log.isTraceEnabled()).andReturn(true); - log.trace(isA(String.class)); IllegalArgumentException exception = new IllegalArgumentException(); - expect(methodInvocation.proceed()).andThrow(exception); - log.trace(isA(String.class), eq(exception)); + given(methodInvocation.proceed()).willThrow(exception); - replay(methodInvocation); - replay(log); + Log log = mock(Log.class); + given(log.isTraceEnabled()).willReturn(true); DebugInterceptor interceptor = new StubDebugInterceptor(log); try { @@ -76,8 +70,8 @@ public final class DebugInterceptorTests { } checkCallCountTotal(interceptor); - verify(methodInvocation); - verify(log); + verify(log).trace(anyString()); + verify(log).trace(anyString(), eq(exception)); } private void checkCallCountTotal(DebugInterceptor interceptor) { @@ -96,6 +90,7 @@ public final class DebugInterceptorTests { this.log = log; } + @Override protected Log getLoggerForInvocation(MethodInvocation invocation) { return log; } diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisorsTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisorsTests.java index c5f6cf8fe43..3b0bd31e530 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisorsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisorsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.factory.NamedBean; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -38,6 +38,7 @@ public final class ExposeBeanNameAdvisorsTests { this.beanName = beanName; } + @Override public int getAge() { assertEquals(beanName, ExposeBeanNameAdvisors.getBeanName()); return super.getAge(); diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests-context.xml index bea92760ce6..5f00163fb55 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests-context.xml @@ -5,8 +5,8 @@ Tests for throws advice. --> - - + + @@ -14,8 +14,8 @@ INSTANCE - - + + @@ -25,5 +25,5 @@ exposeInvocation,countingBeforeAdvice,nopInterceptor - - + + diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests.java index 72e2cf36933..5405d09831b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,17 @@ package org.springframework.aop.interceptor; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.aopalliance.intercept.MethodInvocation; import org.junit.Test; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; - -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Non-XML tests are in AbstractAopProxyTests @@ -40,7 +41,8 @@ public final class ExposeInvocationInterceptorTests { @Test public void testXmlConfig() { - XmlBeanFactory bf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); ITestBean tb = (ITestBean) bf.getBean("proxy"); String name= "tony"; tb.setName(name); @@ -53,12 +55,14 @@ public final class ExposeInvocationInterceptorTests { abstract class ExposedInvocationTestBean extends TestBean { + @Override public String getName() { MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); assertions(invocation); return super.getName(); } + @Override public void absquatulate() { MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); assertions(invocation); @@ -70,6 +74,7 @@ abstract class ExposedInvocationTestBean extends TestBean { class InvocationCheckExposedInvocationTestBean extends ExposedInvocationTestBean { + @Override protected void assertions(MethodInvocation invocation) { assertTrue(invocation.getThis() == this); assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(), diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java index 5cc35f10ecb..bf2c45fc2c6 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,10 +16,11 @@ package org.springframework.aop.interceptor; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; - -import java.lang.reflect.Method; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; @@ -48,35 +49,24 @@ public final class PerformanceMonitorInterceptorTests { @Test public void testSunnyDayPathLogsPerformanceMetricsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation mi = createMock(MethodInvocation.class); - - Method toString = String.class.getMethod("toString", new Class[0]); - - expect(mi.getMethod()).andReturn(toString); - expect(mi.proceed()).andReturn(null); - log.trace(isA(String.class)); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.getMethod()).willReturn(String.class.getMethod("toString", new Class[0])); - replay(mi, log); + Log log = mock(Log.class); PerformanceMonitorInterceptor interceptor = new PerformanceMonitorInterceptor(true); interceptor.invokeUnderTrace(mi, log); - verify(mi, log); + verify(log).trace(anyString()); } @Test public void testExceptionPathStillLogsPerformanceMetricsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation mi = createMock(MethodInvocation.class); - - Method toString = String.class.getMethod("toString", new Class[0]); - - expect(mi.getMethod()).andReturn(toString); - expect(mi.proceed()).andThrow(new IllegalArgumentException()); - log.trace(isA(String.class)); + MethodInvocation mi = mock(MethodInvocation.class); - replay(mi, log); + given(mi.getMethod()).willReturn(String.class.getMethod("toString", new Class[0])); + given(mi.proceed()).willThrow(new IllegalArgumentException()); + Log log = mock(Log.class); PerformanceMonitorInterceptor interceptor = new PerformanceMonitorInterceptor(true); try { @@ -86,7 +76,7 @@ public final class PerformanceMonitorInterceptorTests { catch (IllegalArgumentException expected) { } - verify(mi, log); + verify(log).trace(anyString()); } } diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java index 7845f1268b6..6efc651d272 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,13 @@ package org.springframework.aop.interceptor; -import static org.easymock.EasyMock.*; import static org.junit.Assert.fail; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import java.lang.reflect.Method; @@ -35,39 +40,27 @@ public final class SimpleTraceInterceptorTests { @Test public void testSunnyDayPathLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation mi = createMock(MethodInvocation.class); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.getMethod()).willReturn(String.class.getMethod("toString", new Class[]{})); + given(mi.getThis()).willReturn(this); - Method toString = String.class.getMethod("toString", new Class[]{}); - - expect(mi.getMethod()).andReturn(toString); - expect(mi.getThis()).andReturn(this); - log.trace(isA(String.class)); - expect(mi.proceed()).andReturn(null); - log.trace(isA(String.class)); - - replay(mi, log); + Log log = mock(Log.class); SimpleTraceInterceptor interceptor = new SimpleTraceInterceptor(true); interceptor.invokeUnderTrace(mi, log); - verify(mi, log); + verify(log, times(2)).trace(anyString()); } + @Test public void testExceptionPathStillLogsCorrectly() throws Throwable { - Log log = createMock(Log.class); - MethodInvocation mi = createMock(MethodInvocation.class); - - Method toString = String.class.getMethod("toString", new Class[]{}); - - expect(mi.getMethod()).andReturn(toString); - expect(mi.getThis()).andReturn(this); - log.trace(isA(String.class)); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.getMethod()).willReturn(String.class.getMethod("toString", new Class[]{})); + given(mi.getThis()).willReturn(this); IllegalArgumentException exception = new IllegalArgumentException(); - expect(mi.proceed()).andThrow(exception); - log.trace(isA(String.class)); + given(mi.proceed()).willThrow(exception); - replay(mi, log); + Log log = mock(Log.class); final SimpleTraceInterceptor interceptor = new SimpleTraceInterceptor(true); @@ -77,7 +70,8 @@ public final class SimpleTraceInterceptorTests { } catch (IllegalArgumentException expected) { } - verify(mi, log); + verify(log).trace(anyString()); + verify(log).trace(anyString(), eq(exception)); } } diff --git a/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java b/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java index 80f62da86b7..9ec42626db3 100644 --- a/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,7 +16,7 @@ package org.springframework.aop.scope; -import static org.easymock.EasyMock.*; +import static org.mockito.Mockito.mock; import org.junit.Test; import org.springframework.beans.factory.config.ConfigurableBeanFactory; @@ -52,14 +52,9 @@ public final class DefaultScopedObjectTests { testBadTargetBeanName(" "); } - private static void testBadTargetBeanName(final String badTargetBeanName) { - ConfigurableBeanFactory factory = createMock(ConfigurableBeanFactory.class); - replay(factory); - + ConfigurableBeanFactory factory = mock(ConfigurableBeanFactory.class); new DefaultScopedObject(factory, badTargetBeanName); - - verify(factory); } } diff --git a/spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyAutowireTests.java b/spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyAutowireTests.java index 83bb13216e0..84c4decb198 100644 --- a/spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyAutowireTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyAutowireTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,10 +17,11 @@ package org.springframework.aop.scope; import static org.junit.Assert.assertSame; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Test; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; /** @@ -36,7 +37,8 @@ public final class ScopedProxyAutowireTests { @Test public void testScopedProxyInheritsAutowireCandidateFalse() { - XmlBeanFactory bf = new XmlBeanFactory(SCOPED_AUTOWIRE_FALSE_CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(SCOPED_AUTOWIRE_FALSE_CONTEXT); TestBean autowired = (TestBean) bf.getBean("autowired"); TestBean unscoped = (TestBean) bf.getBean("unscoped"); assertSame(unscoped, autowired.getChild()); @@ -44,7 +46,8 @@ public final class ScopedProxyAutowireTests { @Test public void testScopedProxyReplacesAutowireCandidateTrue() { - XmlBeanFactory bf = new XmlBeanFactory(SCOPED_AUTOWIRE_TRUE_CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(SCOPED_AUTOWIRE_TRUE_CONTEXT); TestBean autowired = (TestBean) bf.getBean("autowired"); TestBean scoped = (TestBean) bf.getBean("scoped"); assertSame(scoped, autowired.getChild()); diff --git a/spring-aop/src/test/java/org/springframework/aop/support/AbstractRegexpMethodPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/support/AbstractRegexpMethodPointcutTests.java index b230ed72605..03cf0b719e3 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/AbstractRegexpMethodPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/AbstractRegexpMethodPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,15 +16,16 @@ package org.springframework.aop.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.IOException; import org.junit.Before; import org.junit.Test; - -import test.beans.TestBean; -import test.util.SerializationTestUtils; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.util.SerializationTestUtils; /** * @author Rod Johnson diff --git a/spring-aop/src/test/java/org/springframework/aop/support/AopUtilsTests.java b/spring-aop/src/test/java/org/springframework/aop/support/AopUtilsTests.java index 6b86cd7232a..01be11617ea 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/AopUtilsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/AopUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,9 @@ package org.springframework.aop.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; import java.lang.reflect.Method; @@ -26,10 +28,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.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.util.SerializationTestUtils; -import test.aop.NopInterceptor; -import test.beans.TestBean; -import test.util.SerializationTestUtils; /** * @author Rod Johnson @@ -40,6 +42,7 @@ public final class AopUtilsTests { @Test public void testPointcutCanNeverApply() { class TestPointcut extends StaticMethodMatcherPointcut { + @Override public boolean matches(Method method, Class clazzy) { return false; } @@ -58,6 +61,7 @@ public final class AopUtilsTests { @Test public void testPointcutAppliesToOneMethodOnObject() { class TestPointcut extends StaticMethodMatcherPointcut { + @Override public boolean matches(Method method, Class clazz) { return method.getName().equals("hashCode"); } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/ClassFiltersTests.java b/spring-aop/src/test/java/org/springframework/aop/support/ClassFiltersTests.java index 8df910eecb9..51f18dde21f 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/ClassFiltersTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/ClassFiltersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import org.junit.Test; import org.springframework.aop.ClassFilter; import org.springframework.core.NestedRuntimeException; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson diff --git a/spring-aop/src/test/java/org/springframework/aop/support/ClassUtilsTests.java b/spring-aop/src/test/java/org/springframework/aop/support/ClassUtilsTests.java index 1c250e966da..35828d28e0b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/ClassUtilsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/ClassUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.aop.support; import junit.framework.TestCase; import org.springframework.aop.framework.ProxyFactory; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.util.ClassUtils; /** diff --git a/spring-aop/src/test/java/org/springframework/aop/support/ComposablePointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/support/ComposablePointcutTests.java index 41c3e2dd54a..513885ed21f 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/ComposablePointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/ComposablePointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.springframework.aop.MethodMatcher; import org.springframework.aop.Pointcut; import org.springframework.core.NestedRuntimeException; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -35,24 +35,28 @@ import test.beans.TestBean; public final class ComposablePointcutTests { public static MethodMatcher GETTER_METHOD_MATCHER = new StaticMethodMatcher() { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("get"); } }; public static MethodMatcher GET_AGE_METHOD_MATCHER = new StaticMethodMatcher() { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().equals("getAge"); } }; public static MethodMatcher ABSQUATULATE_METHOD_MATCHER = new StaticMethodMatcher() { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().equals("absquatulate"); } }; public static MethodMatcher SETTER_METHOD_MATCHER = new StaticMethodMatcher() { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("set"); } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/ControlFlowPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/support/ControlFlowPointcutTests.java index e6c08c08f28..be21c52d2aa 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/ControlFlowPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/ControlFlowPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,15 +16,16 @@ package org.springframework.aop.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import org.junit.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 test.aop.NopInterceptor; -import test.beans.ITestBean; -import test.beans.TestBean; /** * @author Rod Johnson diff --git a/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java index f74bb4c61e9..1872a457f9a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,11 @@ package org.springframework.aop.support; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; import java.io.Serializable; @@ -26,16 +29,15 @@ import org.junit.Test; import org.springframework.aop.IntroductionAdvisor; import org.springframework.aop.IntroductionInterceptor; import org.springframework.aop.framework.ProxyFactory; - -import test.aop.SerializableNopInterceptor; -import test.beans.INestedTestBean; -import test.beans.ITestBean; -import test.beans.NestedTestBean; -import test.beans.Person; -import test.beans.SerializablePerson; -import test.beans.TestBean; -import test.util.SerializationTestUtils; -import test.util.TimeStamped; +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; /** * @author Rod Johnson @@ -56,17 +58,14 @@ public final class DelegatingIntroductionInterceptorTests { assertTrue(! (raw instanceof TimeStamped)); ProxyFactory factory = new ProxyFactory(raw); - TimeStamped ts = createMock(TimeStamped.class); + TimeStamped ts = mock(TimeStamped.class); long timestamp = 111L; - expect(ts.getTimeStamp()).andReturn(timestamp); - replay(ts); + given(ts.getTimeStamp()).willReturn(timestamp); factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts))); TimeStamped tsp = (TimeStamped) factory.getProxy(); assertTrue(tsp.getTimeStamp() == timestamp); - - verify(ts); } @Test @@ -75,17 +74,14 @@ public final class DelegatingIntroductionInterceptorTests { assertTrue(! (raw instanceof SubTimeStamped)); ProxyFactory factory = new ProxyFactory(raw); - TimeStamped ts = createMock(SubTimeStamped.class); + TimeStamped ts = mock(SubTimeStamped.class); long timestamp = 111L; - expect(ts.getTimeStamp()).andReturn(timestamp); - replay(ts); + given(ts.getTimeStamp()).willReturn(timestamp); factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts), SubTimeStamped.class)); SubTimeStamped tsp = (SubTimeStamped) factory.getProxy(); assertTrue(tsp.getTimeStamp() == timestamp); - - verify(ts); } @Test @@ -94,26 +90,25 @@ public final class DelegatingIntroductionInterceptorTests { assertTrue(! (raw instanceof TimeStamped)); ProxyFactory factory = new ProxyFactory(raw); - TimeStamped ts = createMock(SubTimeStamped.class); + TimeStamped ts = mock(SubTimeStamped.class); long timestamp = 111L; - expect(ts.getTimeStamp()).andReturn(timestamp); - replay(ts); + given(ts.getTimeStamp()).willReturn(timestamp); factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts), TimeStamped.class)); TimeStamped tsp = (TimeStamped) factory.getProxy(); assertTrue(!(tsp instanceof SubTimeStamped)); assertTrue(tsp.getTimeStamp() == timestamp); - - verify(ts); } @Test public void testAutomaticInterfaceRecognitionInDelegate() throws Exception { final long t = 1001L; class Tester implements TimeStamped, ITester { + @Override public void foo() throws Exception { } + @Override public long getTimeStamp() { return t; } @@ -141,8 +136,10 @@ public final class DelegatingIntroductionInterceptorTests { final long t = 1001L; @SuppressWarnings("serial") class TestII extends DelegatingIntroductionInterceptor implements TimeStamped, ITester { + @Override public void foo() throws Exception { } + @Override public long getTimeStamp() { return t; } @@ -206,6 +203,7 @@ public final class DelegatingIntroductionInterceptorTests { String company = "Interface21"; target.setCompany(company); TestBean delegate = new TestBean() { + @Override public ITestBean getSpouse() { return this; } @@ -250,6 +248,7 @@ public final class DelegatingIntroductionInterceptorTests { final long t = 1001L; @SuppressWarnings("serial") class TestII extends DelegatingIntroductionInterceptor implements TimeStamped { + @Override public long getTimeStamp() { return t; } @@ -278,6 +277,7 @@ public final class DelegatingIntroductionInterceptorTests { this.ts = ts; } + @Override public long getTimeStamp() { return ts; } @@ -292,6 +292,7 @@ public final class DelegatingIntroductionInterceptorTests { this.t = t; } + @Override public long getTimeStamp() { return t; } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/JdkRegexpMethodPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/support/JdkRegexpMethodPointcutTests.java index ca4f8839c8e..0848ab58a9a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/JdkRegexpMethodPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/JdkRegexpMethodPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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,6 +21,7 @@ package org.springframework.aop.support; */ public final class JdkRegexpMethodPointcutTests extends AbstractRegexpMethodPointcutTests { + @Override protected AbstractRegexpMethodPointcut getRegexpMethodPointcut() { return new JdkRegexpMethodPointcut(); } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/MethodMatchersTests.java b/spring-aop/src/test/java/org/springframework/aop/support/MethodMatchersTests.java index a55b083a3f3..8f06791335c 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/MethodMatchersTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/MethodMatchersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,17 +16,18 @@ package org.springframework.aop.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; import java.lang.reflect.Method; import org.junit.Test; import org.springframework.aop.MethodMatcher; - -import test.beans.IOther; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.util.SerializationTestUtils; +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; /** * @author Juergen Hoeller @@ -107,6 +108,7 @@ public final class MethodMatchersTests { public StartsWithMatcher(String s) { this.prefix = s; } + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith(prefix); } @@ -114,12 +116,14 @@ public final class MethodMatchersTests { private static class TestDynamicMethodMatcherWhichMatches extends DynamicMethodMatcher { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { return true; } } private static class TestDynamicMethodMatcherWhichDoesNotMatch extends DynamicMethodMatcher { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { return false; } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/NameMatchMethodPointcutTests.java b/spring-aop/src/test/java/org/springframework/aop/support/NameMatchMethodPointcutTests.java index a36856ddd36..5edde823dbc 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/NameMatchMethodPointcutTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/NameMatchMethodPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,18 +16,20 @@ package org.springframework.aop.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.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 test.aop.NopInterceptor; -import test.aop.SerializableNopInterceptor; -import test.beans.Person; -import test.beans.SerializablePerson; -import test.util.SerializationTestUtils; /** * @author Rod Johnson diff --git a/spring-aop/src/test/java/org/springframework/aop/support/PointcutsTests.java b/spring-aop/src/test/java/org/springframework/aop/support/PointcutsTests.java index e7967198669..b24dccc2c9d 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/PointcutsTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/PointcutsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import org.junit.Test; import org.springframework.aop.ClassFilter; import org.springframework.aop.Pointcut; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -53,14 +53,17 @@ public final class PointcutsTests { * Matches only TestBean class, not subclasses */ public static Pointcut allTestBeanMethodsPointcut = new StaticMethodMatcherPointcut() { + @Override public ClassFilter getClassFilter() { return new ClassFilter() { + @Override public boolean matches(Class clazz) { return clazz.equals(TestBean.class); } }; } + @Override public boolean matches(Method m, Class targetClass) { return true; } @@ -73,10 +76,12 @@ public final class PointcutsTests { } public static Pointcut myTestBeanSetterPointcut = new StaticMethodMatcherPointcut() { + @Override public ClassFilter getClassFilter() { return new RootClassFilter(MyTestBean.class); } + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("set"); } @@ -84,10 +89,12 @@ public final class PointcutsTests { // Will match MyTestBeanSubclass public static Pointcut myTestBeanGetterPointcut = new StaticMethodMatcherPointcut() { + @Override public ClassFilter getClassFilter() { return new RootClassFilter(MyTestBean.class); } + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("get"); } @@ -98,10 +105,12 @@ public final class PointcutsTests { } public static Pointcut myTestBeanSubclassGetterPointcut = new StaticMethodMatcherPointcut() { + @Override public ClassFilter getClassFilter() { return new RootClassFilter(MyTestBeanSubclass.class); } + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("get"); } diff --git a/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests-context.xml index 1e3ae07f26a..cbd660d7fe9 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests-context.xml @@ -4,12 +4,12 @@ - + custom 666 - + @@ -21,19 +21,19 @@ - test.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean - settersAdvisor + settersAdvisor - test.beans.Person + org.springframework.tests.sample.beans.Person - + serializableSettersAdvised - settersAdvisor + settersAdvisor @@ -48,11 +48,11 @@ - test.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean true - - settersAndAbsquatulateAdvisor + + settersAndAbsquatulateAdvisor - + diff --git a/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests.java b/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests.java index bab75b7a3d4..4a3d04cbd8f 100644 --- a/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,20 +17,20 @@ package org.springframework.aop.support; import static org.junit.Assert.assertEquals; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Test; import org.springframework.aop.framework.Advised; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; 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 test.aop.NopInterceptor; -import test.aop.SerializableNopInterceptor; -import test.beans.ITestBean; -import test.beans.Person; -import test.beans.TestBean; -import test.util.SerializationTestUtils; /** * @author Rod Johnson @@ -43,7 +43,8 @@ public final class RegexpMethodPointcutAdvisorIntegrationTests { @Test public void testSinglePattern() throws Throwable { - BeanFactory bf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); ITestBean advised = (ITestBean) bf.getBean("settersAdvised"); // Interceptor behind regexp advisor NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor"); @@ -61,7 +62,8 @@ public final class RegexpMethodPointcutAdvisorIntegrationTests { @Test public void testMultiplePatterns() throws Throwable { - BeanFactory bf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); // This is a CGLIB proxy, so we can proxy it to the target class TestBean advised = (TestBean) bf.getBean("settersAndAbsquatulateAdvised"); // Interceptor behind regexp advisor @@ -84,7 +86,8 @@ public final class RegexpMethodPointcutAdvisorIntegrationTests { @Test public void testSerialization() throws Throwable { - BeanFactory bf = new XmlBeanFactory(CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT); // This is a CGLIB proxy, so we can proxy it to the target class Person p = (Person) bf.getBean("serializableSettersAdvised"); // Interceptor behind regexp advisor diff --git a/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests-context.xml index 75be80560ee..07e9e4d3d95 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests-context.xml @@ -3,7 +3,7 @@ - + diff --git a/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests.java b/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests.java index 269d585e9d4..af6b44c0ca1 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,14 @@ package org.springframework.aop.target; import static org.junit.Assert.assertTrue; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; - -import test.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; /** * @author Rob Harrop diff --git a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests-context.xml index 04cc623d30b..33f30be78c1 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests-context.xml @@ -4,15 +4,15 @@ - + 10 - + 20 - - @@ -23,5 +23,4 @@ - - \ No newline at end of file + diff --git a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java index be9b929475f..a4bb0c2554b 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,10 @@ package org.springframework.aop.target; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.After; import org.junit.Before; @@ -25,14 +27,15 @@ import org.junit.Test; import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.DefaultPointcutAdvisor; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; +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 test.aop.SerializableNopInterceptor; -import test.beans.Person; -import test.beans.SerializablePerson; -import test.beans.SideEffectBean; -import test.util.SerializationTestUtils; /** @@ -46,11 +49,12 @@ public final class HotSwappableTargetSourceTests { /** Initial count value set in bean factory XML */ private static final int INITIAL_COUNT = 10; - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; @Before public void setUp() throws Exception { - this.beanFactory = new XmlBeanFactory(CONTEXT); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(CONTEXT); } /** diff --git a/spring-aop/src/test/java/org/springframework/aop/target/LazyCreationTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/LazyCreationTargetSourceTests.java index d6dc8f426cd..2a584f9a5c5 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/LazyCreationTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/LazyCreationTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -32,9 +32,11 @@ public final class LazyCreationTargetSourceTests { @Test public void testCreateLazy() { TargetSource targetSource = new AbstractLazyCreationTargetSource() { + @Override protected Object createObject() { return new InitCountingBean(); } + @Override public Class getTargetClass() { return InitCountingBean.class; } diff --git a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-customTarget.xml b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-customTarget.xml index 9bfe5dfd960..f633c66d5b2 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-customTarget.xml +++ b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-customTarget.xml @@ -3,7 +3,7 @@ - + 10 diff --git a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-singleton.xml b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-singleton.xml index 74b1fe0ec22..10ef6a35aef 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-singleton.xml +++ b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests-singleton.xml @@ -3,7 +3,7 @@ - + 10 diff --git a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests.java index d08d6f5357c..b5bb4a1751c 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,18 @@ package org.springframework.aop.target; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import java.util.Set; import org.junit.Test; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; - -import test.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; /** * @author Juergen Hoeller @@ -43,7 +45,8 @@ public final class LazyInitTargetSourceTests { @Test public void testLazyInitSingletonTargetSource() { - XmlBeanFactory bf = new XmlBeanFactory(SINGLETON_CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(SINGLETON_CONTEXT); bf.preInstantiateSingletons(); ITestBean tb = (ITestBean) bf.getBean("proxy"); @@ -54,7 +57,8 @@ public final class LazyInitTargetSourceTests { @Test public void testCustomLazyInitSingletonTargetSource() { - XmlBeanFactory bf = new XmlBeanFactory(CUSTOM_TARGET_CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CUSTOM_TARGET_CONTEXT); bf.preInstantiateSingletons(); ITestBean tb = (ITestBean) bf.getBean("proxy"); @@ -65,7 +69,8 @@ public final class LazyInitTargetSourceTests { @Test public void testLazyInitFactoryBeanTargetSource() { - XmlBeanFactory bf = new XmlBeanFactory(FACTORY_BEAN_CONTEXT); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(FACTORY_BEAN_CONTEXT); bf.preInstantiateSingletons(); Set set1 = (Set) bf.getBean("proxy1"); @@ -83,6 +88,7 @@ public final class LazyInitTargetSourceTests { @SuppressWarnings("serial") public static class CustomLazyInitTargetSource extends LazyInitTargetSource { + @Override protected void postProcessTargetObject(Object targetObject) { ((ITestBean) targetObject).setName("Rob Harrop"); } diff --git a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java index 3fe1c3ca709..91e1d087f59 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,17 +16,17 @@ package org.springframework.aop.target; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.aop.TargetSource; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; - -import test.beans.SerializablePerson; -import test.beans.TestBean; -import test.util.SerializationTestUtils; +import org.springframework.tests.sample.beans.SerializablePerson; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.util.SerializationTestUtils; /** * Unit tests relating to the abstract {@link AbstractPrototypeBasedTargetSource} @@ -41,10 +41,12 @@ public final class PrototypeBasedTargetSourceTests { public void testSerializability() throws Exception { MutablePropertyValues tsPvs = new MutablePropertyValues(); tsPvs.add("targetBeanName", "person"); - RootBeanDefinition tsBd = new RootBeanDefinition(TestTargetSource.class, tsPvs); + RootBeanDefinition tsBd = new RootBeanDefinition(TestTargetSource.class); + tsBd.setPropertyValues(tsPvs); MutablePropertyValues pvs = new MutablePropertyValues(); - RootBeanDefinition bd = new RootBeanDefinition(SerializablePerson.class, pvs); + RootBeanDefinition bd = new RootBeanDefinition(SerializablePerson.class); + bd.setPropertyValues(pvs); bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE); DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); @@ -70,10 +72,12 @@ public final class PrototypeBasedTargetSourceTests { */ private TestBean thisFieldIsNotSerializable = new TestBean(); + @Override public Object getTarget() throws Exception { return newPrototypeInstance(); } + @Override public void releaseTarget(Object target) throws Exception { // Do nothing } diff --git a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests-context.xml b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests-context.xml index b271b1f5565..961269efde2 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests-context.xml +++ b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests-context.xml @@ -4,22 +4,22 @@ - + 10 - - + + 10 - + prototypeTest - - - + + + - debugInterceptor,test + debugInterceptor,test @@ -20,7 +20,7 @@ getStatsMixin - + @@ -33,23 +33,22 @@ - - + + Rod - - + + Kerry - - + + test - + - - \ No newline at end of file + diff --git a/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java index 2519e89f823..b8976f1958a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,18 @@ package org.springframework.aop.target; -import static org.junit.Assert.*; -import static test.util.TestResourceUtils.qualifiedResource; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; +import static org.springframework.tests.TestResourceUtils.qualifiedResource; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.Resource; - -import test.beans.ITestBean; -import test.beans.SideEffectBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.SideEffectBean; /** @@ -39,11 +41,12 @@ public class ThreadLocalTargetSourceTests { /** Initial count value set in bean factory XML */ private static final int INITIAL_COUNT = 10; - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; @Before public void setUp() throws Exception { - this.beanFactory = new XmlBeanFactory(CONTEXT); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(CONTEXT); } /** @@ -113,6 +116,7 @@ public class ThreadLocalTargetSourceTests { class Runner implements Runnable { public SideEffectBean mine; + @Override public void run() { this.mine = (SideEffectBean) beanFactory.getBean("apartment"); assertEquals(INITIAL_COUNT, mine.getCount() ); diff --git a/spring-aop/src/test/java/org/springframework/aop/target/dynamic/RefreshableTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/dynamic/RefreshableTargetSourceTests.java index ee0913a1146..9732cfa4d98 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/dynamic/RefreshableTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/dynamic/RefreshableTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -19,6 +19,8 @@ package org.springframework.aop.target.dynamic; import static org.junit.Assert.*; import org.junit.Test; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; /** * @author Rob Harrop @@ -75,6 +77,8 @@ public final class RefreshableTargetSourceTests { @Test public void testRefreshOverTime() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CountingRefreshableTargetSource ts = new CountingRefreshableTargetSource(true); ts.setRefreshCheckDelay(100); @@ -116,6 +120,7 @@ public final class RefreshableTargetSourceTests { this.requiresRefresh = requiresRefresh; } + @Override protected Object freshTarget() { this.callCount++; return new Object(); @@ -125,6 +130,7 @@ public final class RefreshableTargetSourceTests { return this.callCount; } + @Override protected boolean requiresRefresh() { return this.requiresRefresh; } diff --git a/spring-context/src/test/java/test/advice/CountingAfterReturningAdvice.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingAfterReturningAdvice.java similarity index 89% rename from spring-context/src/test/java/test/advice/CountingAfterReturningAdvice.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingAfterReturningAdvice.java index 2e9aaa5a15b..5b206516af9 100644 --- a/spring-context/src/test/java/test/advice/CountingAfterReturningAdvice.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingAfterReturningAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.advice; +package org.springframework.tests.aop.advice; import java.lang.reflect.Method; @@ -28,6 +28,7 @@ import org.springframework.aop.AfterReturningAdvice; @SuppressWarnings("serial") public class CountingAfterReturningAdvice extends MethodCounter implements AfterReturningAdvice { + @Override public void afterReturning(Object o, Method m, Object[] args, Object target) throws Throwable { count(m); } diff --git a/src/test/java/test/advice/CountingBeforeAdvice.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java similarity index 89% rename from src/test/java/test/advice/CountingBeforeAdvice.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java index 3dc49faf24f..2e34d50262c 100644 --- a/src/test/java/test/advice/CountingBeforeAdvice.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.advice; +package org.springframework.tests.aop.advice; import java.lang.reflect.Method; @@ -28,6 +28,7 @@ import org.springframework.aop.MethodBeforeAdvice; @SuppressWarnings("serial") public class CountingBeforeAdvice extends MethodCounter implements MethodBeforeAdvice { + @Override public void before(Method m, Object[] args, Object target) throws Throwable { count(m); } diff --git a/spring-context/src/test/java/test/advice/MethodCounter.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/MethodCounter.java similarity index 94% rename from spring-context/src/test/java/test/advice/MethodCounter.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/MethodCounter.java index 8c29886a3df..931b0ec6681 100644 --- a/spring-context/src/test/java/test/advice/MethodCounter.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/MethodCounter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.advice; +package org.springframework.tests.aop.advice; import java.io.Serializable; import java.lang.reflect.Method; diff --git a/spring-context/src/test/java/test/advice/MyThrowsHandler.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/MyThrowsHandler.java similarity index 93% rename from spring-context/src/test/java/test/advice/MyThrowsHandler.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/MyThrowsHandler.java index abe79f9dc32..96edd1280cd 100644 --- a/spring-context/src/test/java/test/advice/MyThrowsHandler.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/MyThrowsHandler.java @@ -1,7 +1,7 @@ /** * */ -package test.advice; +package org.springframework.tests.aop.advice; import java.io.IOException; import java.lang.reflect.Method; diff --git a/spring-context/src/test/java/test/advice/TimestampIntroductionAdvisor.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/TimestampIntroductionAdvisor.java similarity index 84% rename from spring-context/src/test/java/test/advice/TimestampIntroductionAdvisor.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/TimestampIntroductionAdvisor.java index 284cfc51931..0fa9d4b4da9 100644 --- a/spring-context/src/test/java/test/advice/TimestampIntroductionAdvisor.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/TimestampIntroductionAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,12 +14,12 @@ * limitations under the License. */ -package test.advice; +package org.springframework.tests.aop.advice; import org.springframework.aop.support.DelegatingIntroductionInterceptor; import org.springframework.aop.support.DefaultIntroductionAdvisor; +import org.springframework.tests.aop.interceptor.TimestampIntroductionInterceptor; -import test.interceptor.TimestampIntroductionInterceptor; /** * diff --git a/src/test/java/test/interceptor/NopInterceptor.java b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java similarity index 92% rename from src/test/java/test/interceptor/NopInterceptor.java rename to spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java index 79158e74ea4..d152719261c 100644 --- a/src/test/java/test/interceptor/NopInterceptor.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java @@ -1,6 +1,6 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package test.interceptor; +package org.springframework.tests.aop.interceptor; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; @@ -32,6 +32,7 @@ public class NopInterceptor implements MethodInterceptor { /** * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation) */ + @Override public Object invoke(MethodInvocation invocation) throws Throwable { increment(); return invocation.proceed(); diff --git a/spring-context/src/test/java/test/interceptor/SerializableNopInterceptor.java b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/SerializableNopInterceptor.java similarity index 89% rename from spring-context/src/test/java/test/interceptor/SerializableNopInterceptor.java rename to spring-aop/src/test/java/org/springframework/tests/aop/interceptor/SerializableNopInterceptor.java index 3b8350e4c83..8c72878c9df 100644 --- a/spring-context/src/test/java/test/interceptor/SerializableNopInterceptor.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/SerializableNopInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.interceptor; +package org.springframework.tests.aop.interceptor; import java.io.Serializable; @@ -35,10 +35,12 @@ public class SerializableNopInterceptor extends NopInterceptor implements Serial */ private int count; + @Override public int getCount() { return this.count; } + @Override protected void increment() { ++count; } diff --git a/spring-context/src/test/java/test/interceptor/TimestampIntroductionInterceptor.java b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/TimestampIntroductionInterceptor.java similarity index 84% rename from spring-context/src/test/java/test/interceptor/TimestampIntroductionInterceptor.java rename to spring-aop/src/test/java/org/springframework/tests/aop/interceptor/TimestampIntroductionInterceptor.java index 83761c2d3c2..de4dfecff6b 100644 --- a/spring-context/src/test/java/test/interceptor/TimestampIntroductionInterceptor.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/interceptor/TimestampIntroductionInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,15 +14,14 @@ * limitations under the License. */ -package test.interceptor; +package org.springframework.tests.aop.interceptor; import org.springframework.aop.support.DelegatingIntroductionInterceptor; - -import test.util.TimeStamped; +import org.springframework.tests.TimeStamped; @SuppressWarnings("serial") public class TimestampIntroductionInterceptor extends DelegatingIntroductionInterceptor - implements TimeStamped { + implements TimeStamped { private long ts; @@ -37,6 +36,7 @@ public class TimestampIntroductionInterceptor extends DelegatingIntroductionInte this.ts = ts; } + @Override public long getTimeStamp() { return ts; } diff --git a/spring-aop/src/test/java/test/beans/Person.java b/spring-aop/src/test/java/org/springframework/tests/sample/beans/Person.java similarity index 77% rename from spring-aop/src/test/java/test/beans/Person.java rename to spring-aop/src/test/java/org/springframework/tests/sample/beans/Person.java index d1a441945ee..38e0903e2e6 100644 --- a/spring-aop/src/test/java/test/beans/Person.java +++ b/spring-aop/src/test/java/org/springframework/tests/sample/beans/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; /** * @@ -23,14 +23,16 @@ package test.beans; public interface Person { String getName(); + void setName(String name); + int getAge(); + void setAge(int i); /** - * Test for non-property method matching. - * If the parameter is a Throwable, it will be thrown rather than - * returned. + * Test for non-property method matching. If the parameter is a Throwable, it will be + * thrown rather than returned. */ Object echo(Object o) throws Throwable; -} \ No newline at end of file +} diff --git a/spring-web/src/test/java/org/springframework/beans/SerializablePerson.java b/spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java similarity index 90% rename from spring-web/src/test/java/org/springframework/beans/SerializablePerson.java rename to spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java index 13c2c5447a5..2730d50c8ec 100644 --- a/spring-web/src/test/java/org/springframework/beans/SerializablePerson.java +++ b/spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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.beans; +package org.springframework.tests.sample.beans; import java.io.Serializable; @@ -31,22 +31,27 @@ public class SerializablePerson implements Person, Serializable { private String name; private int age; + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override public Object echo(Object o) throws Throwable { if (o instanceof Throwable) { throw (Throwable) o; diff --git a/spring-aop/src/test/java/test/beans/subpkg/DeepBean.java b/spring-aop/src/test/java/org/springframework/tests/sample/beans/subpkg/DeepBean.java similarity index 88% rename from spring-aop/src/test/java/test/beans/subpkg/DeepBean.java rename to spring-aop/src/test/java/org/springframework/tests/sample/beans/subpkg/DeepBean.java index 211e1010234..45546b4cfde 100644 --- a/spring-aop/src/test/java/test/beans/subpkg/DeepBean.java +++ b/spring-aop/src/test/java/org/springframework/tests/sample/beans/subpkg/DeepBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.beans.subpkg; +package org.springframework.tests.sample.beans.subpkg; import org.springframework.aop.aspectj.AspectJExpressionPointcutTests; diff --git a/spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java b/spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java deleted file mode 100644 index 7a7baa3ef25..00000000000 --- a/spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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 test.aop; - -import java.lang.reflect.Method; - -import org.springframework.aop.MethodBeforeAdvice; - -/** - * Simple before advice example that we can use for counting checks. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class CountingBeforeAdvice extends MethodCounter implements MethodBeforeAdvice { - - public void before(Method m, Object[] args, Object target) throws Throwable { - count(m); - } - -} diff --git a/spring-aop/src/test/java/test/aop/DefaultLockable.java b/spring-aop/src/test/java/test/aop/DefaultLockable.java index 82c59d8bc54..1fddaca9f19 100644 --- a/spring-aop/src/test/java/test/aop/DefaultLockable.java +++ b/spring-aop/src/test/java/test/aop/DefaultLockable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -25,14 +25,17 @@ public class DefaultLockable implements Lockable { private boolean locked; + @Override public void lock() { this.locked = true; } + @Override public void unlock() { this.locked = false; } + @Override public boolean locked() { return this.locked; } diff --git a/spring-aop/src/test/java/test/aop/Lockable.java b/spring-aop/src/test/java/test/aop/Lockable.java index 135a9914246..039b06e8a7d 100644 --- a/spring-aop/src/test/java/test/aop/Lockable.java +++ b/spring-aop/src/test/java/test/aop/Lockable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aop/src/test/java/test/aop/MethodCounter.java b/spring-aop/src/test/java/test/aop/MethodCounter.java deleted file mode 100644 index 745b7289cbb..00000000000 --- a/spring-aop/src/test/java/test/aop/MethodCounter.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.aop; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.HashMap; - -/** - * Abstract superclass for counting advices etc. - * - * @author Rod Johnson - * @author Chris Beams - */ -@SuppressWarnings("serial") -public class MethodCounter implements Serializable { - - /** Method name --> count, does not understand overloading */ - private HashMap map = new HashMap(); - - private int allCount; - - protected void count(Method m) { - count(m.getName()); - } - - 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); - ++allCount; - } - - public int getCalls(String methodName) { - Integer i = map.get(methodName); - return (i != null ? i.intValue() : 0); - } - - public int getCalls() { - return allCount; - } - - /** - * A bit simplistic: just wants the same class. - * Doesn't worry about counts. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - return (other != null && other.getClass() == this.getClass()); - } - - public int hashCode() { - return getClass().hashCode(); - } - -} diff --git a/spring-aop/src/test/java/test/aop/NopInterceptor.java b/spring-aop/src/test/java/test/aop/NopInterceptor.java deleted file mode 100644 index 1dc341d427b..00000000000 --- a/spring-aop/src/test/java/test/aop/NopInterceptor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.aop; - -import org.aopalliance.intercept.MethodInterceptor; -import org.aopalliance.intercept.MethodInvocation; - -/** - * Trivial interceptor that can be introduced in a chain to display it. - * - * @author Rod Johnson - */ -public class NopInterceptor implements MethodInterceptor { - - private int count; - - /** - * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation) - */ - public Object invoke(MethodInvocation invocation) throws Throwable { - increment(); - return invocation.proceed(); - } - - public int getCount() { - return this.count; - } - - protected void increment() { - ++count; - } - - public boolean equals(Object other) { - if (!(other instanceof NopInterceptor)) { - return false; - } - if (this == other) { - return true; - } - return this.count == ((NopInterceptor) other).count; - } - -} diff --git a/spring-aop/src/test/java/test/aop/PerTargetAspect.java b/spring-aop/src/test/java/test/aop/PerTargetAspect.java index cee24201381..3896f2dc7ab 100644 --- a/spring-aop/src/test/java/test/aop/PerTargetAspect.java +++ b/spring-aop/src/test/java/test/aop/PerTargetAspect.java @@ -25,6 +25,7 @@ public class PerTargetAspect implements Ordered { ++count; } + @Override public int getOrder() { return this.order; } diff --git a/spring-aop/src/test/java/test/aop/SerializableNopInterceptor.java b/spring-aop/src/test/java/test/aop/SerializableNopInterceptor.java deleted file mode 100644 index 3b306743b27..00000000000 --- a/spring-aop/src/test/java/test/aop/SerializableNopInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.aop; - -import java.io.Serializable; - - - -/** - * Subclass of NopInterceptor that is serializable and - * can be used to test proxy serialization. - * - * @author Rod Johnson - * @author Chris Beams - */ -@SuppressWarnings("serial") -public class SerializableNopInterceptor extends NopInterceptor implements Serializable { - - /** - * We must override this field and the related methods as - * otherwise count won't be serialized from the non-serializable - * NopInterceptor superclass. - */ - private int count; - - public int getCount() { - return this.count; - } - - protected void increment() { - ++count; - } - -} \ No newline at end of file diff --git a/spring-aop/src/test/java/test/beans/Colour.java b/spring-aop/src/test/java/test/beans/Colour.java deleted file mode 100644 index 8793fd3f94b..00000000000 --- a/spring-aop/src/test/java/test/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} \ No newline at end of file diff --git a/spring-aop/src/test/java/test/beans/DerivedTestBean.java b/spring-aop/src/test/java/test/beans/DerivedTestBean.java deleted file mode 100644 index 8cb213cefe4..00000000000 --- a/spring-aop/src/test/java/test/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-aop/src/test/java/test/beans/ITestBean.java b/spring-aop/src/test/java/test/beans/ITestBean.java deleted file mode 100644 index 74f371b0547..00000000000 --- a/spring-aop/src/test/java/test/beans/ITestBean.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import java.io.IOException; - -/** - * Interface used for {@link test.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-aop/src/test/java/test/beans/NestedTestBean.java b/spring-aop/src/test/java/test/beans/NestedTestBean.java deleted file mode 100644 index a630f8662a7..00000000000 --- a/spring-aop/src/test/java/test/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-aop/src/test/java/test/beans/TestBean.java b/spring-aop/src/test/java/test/beans/TestBean.java deleted file mode 100644 index 8f14fd61a2c..00000000000 --- a/spring-aop/src/test/java/test/beans/TestBean.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-aop/src/test/java/test/parsing/CollectingReaderEventListener.java b/spring-aop/src/test/java/test/parsing/CollectingReaderEventListener.java deleted file mode 100644 index 4d9355f616f..00000000000 --- a/spring-aop/src/test/java/test/parsing/CollectingReaderEventListener.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.parsing; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.parsing.AliasDefinition; -import org.springframework.beans.factory.parsing.ComponentDefinition; -import org.springframework.beans.factory.parsing.DefaultsDefinition; -import org.springframework.beans.factory.parsing.ImportDefinition; -import org.springframework.beans.factory.parsing.ReaderEventListener; - -/** - * @author Rob Harrop - * @author Juergen Hoeller - * @author Chris Beams - */ -public class CollectingReaderEventListener implements ReaderEventListener { - - private final List defaults = new LinkedList(); - - private final Map componentDefinitions = new LinkedHashMap(8); - - private final Map aliasMap = new LinkedHashMap(8); - - private final List imports = new LinkedList(); - - - public void defaultsRegistered(DefaultsDefinition defaultsDefinition) { - this.defaults.add(defaultsDefinition); - } - - public List getDefaults() { - return Collections.unmodifiableList(this.defaults); - } - - public void componentRegistered(ComponentDefinition componentDefinition) { - this.componentDefinitions.put(componentDefinition.getName(), componentDefinition); - } - - public ComponentDefinition getComponentDefinition(String name) { - return (ComponentDefinition) this.componentDefinitions.get(name); - } - - public ComponentDefinition[] getComponentDefinitions() { - Collection collection = this.componentDefinitions.values(); - return collection.toArray(new ComponentDefinition[collection.size()]); - } - - @SuppressWarnings("unchecked") - public void aliasRegistered(AliasDefinition aliasDefinition) { - List aliases = (List) this.aliasMap.get(aliasDefinition.getBeanName()); - if(aliases == null) { - aliases = new ArrayList(); - this.aliasMap.put(aliasDefinition.getBeanName(), aliases); - } - aliases.add(aliasDefinition); - } - - public List getAliases(String beanName) { - List aliases = (List) this.aliasMap.get(beanName); - return aliases == null ? null : Collections.unmodifiableList(aliases); - } - - public void importProcessed(ImportDefinition importDefinition) { - this.imports.add(importDefinition); - } - - public List getImports() { - return Collections.unmodifiableList(this.imports); - } - -} diff --git a/spring-aop/src/test/java/test/util/SerializationTestUtils.java b/spring-aop/src/test/java/test/util/SerializationTestUtils.java deleted file mode 100644 index 132bd33d4eb..00000000000 --- a/spring-aop/src/test/java/test/util/SerializationTestUtils.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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 test.util; - -import java.awt.*; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; - -import static org.junit.Assert.*; -import org.junit.Test; -import test.beans.TestBean; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * Contains {@link org.junit.Test} methods to test itself. - * - * @author Rod Johnson - * @author Chris Beams - */ -public final class SerializationTestUtils { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - return o2; - } - - - @Test(expected=NotSerializableException.class) - public void testWithNonSerializableObject() throws IOException { - TestBean o = new TestBean(); - assertFalse(o instanceof Serializable); - assertFalse(isSerializable(o)); - - testSerialization(o); - } - - @Test - public void testWithSerializableObject() throws Exception { - int x = 5; - int y = 10; - Point p = new Point(x, y); - assertTrue(p instanceof Serializable); - - testSerialization(p); - - assertTrue(isSerializable(p)); - - Point p2 = (Point) serializeAndDeserialize(p); - assertNotSame(p, p2); - assertEquals(x, (int) p2.getX()); - assertEquals(y, (int) p2.getY()); - } - -} diff --git a/spring-aspects/aspects.gradle b/spring-aspects/aspects.gradle index 34cadf35380..0432414467b 100644 --- a/spring-aspects/aspects.gradle +++ b/spring-aspects/aspects.gradle @@ -8,6 +8,10 @@ configurations { ajInpath } +// exclude spring-aspects as a module within IDEA until IDEA-64446 is resolved +tasks.getByName("idea").onlyIf { false } +tasks.getByName("ideaModule").onlyIf { false } + task compileJava(overwrite: true) { dependsOn JavaPlugin.PROCESS_RESOURCES_TASK_NAME dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileJava") diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj index 5abf0e29893..760cea9dc1e 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj index 42a27944d42..390e1dc989c 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj index 0a7303eca84..5cd0140d464 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj index 06e32f4bfb8..5313df9ed16 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/ConfigurableObject.java b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/ConfigurableObject.java index 9aca558660f..869b7a72d8a 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/ConfigurableObject.java +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/ConfigurableObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/GenericInterfaceDrivenDependencyInjectionAspect.aj b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/GenericInterfaceDrivenDependencyInjectionAspect.aj index d91b05d1170..351c11d7d9e 100644 --- a/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/GenericInterfaceDrivenDependencyInjectionAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/GenericInterfaceDrivenDependencyInjectionAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj index ca4d14a66bf..a9a6da82e98 100644 --- a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj index 0687b3c54c9..be3957a3a08 100644 --- a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AspectJCachingConfiguration.java b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AspectJCachingConfiguration.java index ec6bda35ebe..740ddaddcae 100644 --- a/spring-aspects/src/main/java/org/springframework/cache/aspectj/AspectJCachingConfiguration.java +++ b/spring-aspects/src/main/java/org/springframework/cache/aspectj/AspectJCachingConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj b/spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj index aa6ad3a9cb6..e373607d558 100644 --- a/spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj +++ b/spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj b/spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj index 56bf0829390..1c50c64bbe6 100644 --- a/spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj +++ b/spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/mock/staticmock/MockStaticEntityMethods.java b/spring-aspects/src/main/java/org/springframework/mock/staticmock/MockStaticEntityMethods.java index 07aee0364ab..913d147b3e1 100644 --- a/spring-aspects/src/main/java/org/springframework/mock/staticmock/MockStaticEntityMethods.java +++ b/spring-aspects/src/main/java/org/springframework/mock/staticmock/MockStaticEntityMethods.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.mock.staticmock; import java.lang.annotation.ElementType; diff --git a/spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj b/spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj index 491f666992e..3594725aaee 100644 --- a/spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2012 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 + * + * http://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.orm.jpa.aspectj; import javax.persistence.EntityManager; diff --git a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AbstractTransactionAspect.aj b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AbstractTransactionAspect.aj index 3daa4761163..ed0956ef9fe 100644 --- a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AbstractTransactionAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AbstractTransactionAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj index 36ac0eb2cb1..1fe8de9030b 100644 --- a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj +++ b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AspectJTransactionManagementConfiguration.java b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AspectJTransactionManagementConfiguration.java index 54c30a1af0a..582de644628 100644 --- a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AspectJTransactionManagementConfiguration.java +++ b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/AspectJTransactionManagementConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/AutoProxyWithCodeStyleAspectsTests.java b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/AutoProxyWithCodeStyleAspectsTests.java index d5667cd1555..e6f8cb8459e 100644 --- a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/AutoProxyWithCodeStyleAspectsTests.java +++ b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/AutoProxyWithCodeStyleAspectsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj index 374bc00909a..0758d3a403a 100644 --- a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj +++ b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-aspects/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-aspects/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-aspects/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/beans/IOther.java b/spring-aspects/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/beans/ITestBean.java b/spring-aspects/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-aspects/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/beans/TestBean.java b/spring-aspects/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeacf..00000000000 --- a/spring-aspects/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see org.springframework.beans.ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see org.springframework.beans.IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java index b92077767bb..6ff04cf7b87 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java +++ b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import junit.framework.TestCase; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.UnsatisfiedDependencyException; import org.springframework.beans.factory.annotation.Autowire; diff --git a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/SpringConfiguredWithAutoProxyingTests.java b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/SpringConfiguredWithAutoProxyingTests.java index 16e2522d934..1c678ba6b19 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/SpringConfiguredWithAutoProxyingTests.java +++ b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/SpringConfiguredWithAutoProxyingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/XmlBeanConfigurerTests.java b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/XmlBeanConfigurerTests.java index 47d3fef664a..c5cc835a3da 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/XmlBeanConfigurerTests.java +++ b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/XmlBeanConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/beanConfigurerTests-beans.xml b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/beanConfigurerTests-beans.xml index 89aa3964eae..bd6439bb546 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/beanConfigurerTests-beans.xml +++ b/spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/beanConfigurerTests-beans.xml @@ -37,7 +37,7 @@ autowire-candidate="false"/> - + diff --git a/spring-aspects/src/test/java/org/springframework/cache/aspectj/AbstractAnnotationTest.java b/spring-aspects/src/test/java/org/springframework/cache/aspectj/AbstractAnnotationTest.java deleted file mode 100644 index b3f9d4937b7..00000000000 --- a/spring-aspects/src/test/java/org/springframework/cache/aspectj/AbstractAnnotationTest.java +++ /dev/null @@ -1,596 +0,0 @@ -/* - * Copyright 2010-2011 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 - * - * http://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 static org.junit.Assert.*; - -import java.util.Collection; -import java.util.UUID; - -import org.junit.Before; -import org.junit.Test; -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.context.ApplicationContext; - -/** - * Abstract annotation test (containing several reusable methods). - * - * @author Costin Leau - * @author Chris Beams - */ -public abstract class AbstractAnnotationTest { - - protected ApplicationContext ctx; - - protected CacheableService cs; - - protected CacheableService ccs; - - protected CacheManager cm; - - /** @return a refreshed application context */ - protected abstract ApplicationContext getApplicationContext(); - - @Before - public void setup() { - ctx = getApplicationContext(); - cs = ctx.getBean("service", CacheableService.class); - ccs = ctx.getBean("classService", CacheableService.class); - cm = ctx.getBean(CacheManager.class); - Collection cn = cm.getCacheNames(); - assertTrue(cn.contains("default")); - } - - public void testCacheable(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - Object r3 = service.cache(o1); - - assertSame(r1, r2); - assertSame(r1, r3); - } - - public void testEvict(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - assertSame(r1, r2); - service.invalidate(o1); - Object r3 = service.cache(o1); - Object r4 = service.cache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - } - - public void testEvictEarly(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - assertSame(r1, r2); - try { - service.evictEarly(o1); - } catch (RuntimeException ex) { - // expected - } - - Object r3 = service.cache(o1); - Object r4 = service.cache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - } - - public void testEvictException(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - assertSame(r1, r2); - try { - service.evictWithException(o1); - } catch (RuntimeException ex) { - // expected - } - // exception occurred, eviction skipped, data should still be in the cache - Object r3 = service.cache(o1); - assertSame(r1, r3); - } - - public void testEvictWKey(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - assertSame(r1, r2); - service.evict(o1, null); - Object r3 = service.cache(o1); - Object r4 = service.cache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - } - - public void testEvictWKeyEarly(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - assertSame(r1, r2); - - try { - service.invalidateEarly(o1, null); - } catch (Exception ex) { - // expected - } - Object r3 = service.cache(o1); - Object r4 = service.cache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - } - - public void testEvictAll(CacheableService service) throws Exception { - Object o1 = new Object(); - - Object r1 = service.cache(o1); - Object r2 = service.cache(o1); - - Object o2 = new Object(); - Object r10 = service.cache(o2); - - assertSame(r1, r2); - assertNotSame(r1, r10); - service.evictAll(new Object()); - Cache cache = cm.getCache("default"); - assertNull(cache.get(o1)); - assertNull(cache.get(o2)); - - Object r3 = service.cache(o1); - Object r4 = service.cache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - } - - public void testConditionalExpression(CacheableService service) throws Exception { - Object r1 = service.conditional(4); - Object r2 = service.conditional(4); - - assertNotSame(r1, r2); - - Object r3 = service.conditional(3); - Object r4 = service.conditional(3); - - assertSame(r3, r4); - } - - public void testKeyExpression(CacheableService service) throws Exception { - Object r1 = service.key(5, 1); - Object r2 = service.key(5, 2); - - assertSame(r1, r2); - - Object r3 = service.key(1, 5); - Object r4 = service.key(2, 5); - - assertNotSame(r3, r4); - } - - public void testNullValue(CacheableService service) throws Exception { - Object key = new Object(); - assertNull(service.nullValue(key)); - int nr = service.nullInvocations().intValue(); - assertNull(service.nullValue(key)); - assertEquals(nr, service.nullInvocations().intValue()); - assertNull(service.nullValue(new Object())); - assertEquals(nr + 1, service.nullInvocations().intValue()); - } - - public void testMethodName(CacheableService service, String keyName) throws Exception { - Object key = new Object(); - Object r1 = service.name(key); - assertSame(r1, service.name(key)); - Cache cache = cm.getCache("default"); - // assert the method name is used - assertNotNull(cache.get(keyName)); - } - - public void testCheckedThrowable(CacheableService service) throws Exception { - String arg = UUID.randomUUID().toString(); - try { - service.throwChecked(arg); - fail("Excepted exception"); - } catch (Exception ex) { - assertEquals(arg, ex.getMessage()); - } - } - - public void testUncheckedThrowable(CacheableService service) throws Exception { - try { - service.throwUnchecked(Long.valueOf(1)); - fail("Excepted exception"); - } catch (RuntimeException ex) { - assertTrue("Excepted different exception type and got " + ex.getClass(), - ex instanceof UnsupportedOperationException); - // expected - } - } - - public void testNullArg(CacheableService service) { - Object r1 = service.cache(null); - assertSame(r1, service.cache(null)); - } - - public void testCacheUpdate(CacheableService service) { - Object o = new Object(); - Cache cache = cm.getCache("default"); - assertNull(cache.get(o)); - Object r1 = service.update(o); - assertSame(r1, cache.get(o).get()); - - o = new Object(); - assertNull(cache.get(o)); - Object r2 = service.update(o); - assertSame(r2, cache.get(o).get()); - } - - public void testConditionalCacheUpdate(CacheableService service) { - Integer one = Integer.valueOf(1); - Integer three = Integer.valueOf(3); - - Cache cache = cm.getCache("default"); - assertEquals(one, Integer.valueOf(service.conditionalUpdate(one).toString())); - assertNull(cache.get(one)); - - assertEquals(three, Integer.valueOf(service.conditionalUpdate(three).toString())); - assertEquals(three, Integer.valueOf(cache.get(three).get().toString())); - } - - public void testMultiCache(CacheableService service) { - Object o1 = new Object(); - Object o2 = new Object(); - - Cache primary = cm.getCache("primary"); - Cache secondary = cm.getCache("secondary"); - - assertNull(primary.get(o1)); - assertNull(secondary.get(o1)); - Object r1 = service.multiCache(o1); - assertSame(r1, primary.get(o1).get()); - assertSame(r1, secondary.get(o1).get()); - - Object r2 = service.multiCache(o1); - Object r3 = service.multiCache(o1); - - assertSame(r1, r2); - assertSame(r1, r3); - - assertNull(primary.get(o2)); - assertNull(secondary.get(o2)); - Object r4 = service.multiCache(o2); - assertSame(r4, primary.get(o2).get()); - assertSame(r4, secondary.get(o2).get()); - } - - public void testMultiEvict(CacheableService service) { - Object o1 = new Object(); - - Object r1 = service.multiCache(o1); - Object r2 = service.multiCache(o1); - - Cache primary = cm.getCache("primary"); - Cache secondary = cm.getCache("secondary"); - - assertSame(r1, r2); - assertSame(r1, primary.get(o1).get()); - assertSame(r1, secondary.get(o1).get()); - - service.multiEvict(o1); - assertNull(primary.get(o1)); - assertNull(secondary.get(o1)); - - Object r3 = service.multiCache(o1); - Object r4 = service.multiCache(o1); - assertNotSame(r1, r3); - assertSame(r3, r4); - - assertSame(r3, primary.get(o1).get()); - assertSame(r4, secondary.get(o1).get()); - } - - public void testMultiPut(CacheableService service) { - Object o = Integer.valueOf(1); - - Cache primary = cm.getCache("primary"); - Cache secondary = cm.getCache("secondary"); - - assertNull(primary.get(o)); - assertNull(secondary.get(o)); - Object r1 = service.multiUpdate(o); - assertSame(r1, primary.get(o).get()); - assertSame(r1, secondary.get(o).get()); - - o = Integer.valueOf(2); - assertNull(primary.get(o)); - assertNull(secondary.get(o)); - Object r2 = service.multiUpdate(o); - assertSame(r2, primary.get(o).get()); - assertSame(r2, secondary.get(o).get()); - } - - public void testMultiCacheAndEvict(CacheableService service) { - String methodName = "multiCacheAndEvict"; - - Cache primary = cm.getCache("primary"); - Cache secondary = cm.getCache("secondary"); - Object key = Integer.valueOf(1); - - secondary.put(key, key); - - assertNull(secondary.get(methodName)); - assertSame(key, secondary.get(key).get()); - - Object r1 = service.multiCacheAndEvict(key); - assertSame(r1, service.multiCacheAndEvict(key)); - - // assert the method name is used - assertSame(r1, primary.get(methodName).get()); - assertNull(secondary.get(methodName)); - assertNull(secondary.get(key)); - } - - public void testMultiConditionalCacheAndEvict(CacheableService service) { - Cache primary = cm.getCache("primary"); - Cache secondary = cm.getCache("secondary"); - Object key = Integer.valueOf(1); - - secondary.put(key, key); - - assertNull(primary.get(key)); - assertSame(key, secondary.get(key).get()); - - Object r1 = service.multiConditionalCacheAndEvict(key); - Object r3 = service.multiConditionalCacheAndEvict(key); - - assertTrue(!r1.equals(r3)); - assertNull(primary.get(key)); - - Object key2 = Integer.valueOf(3); - Object r2 = service.multiConditionalCacheAndEvict(key2); - assertSame(r2, service.multiConditionalCacheAndEvict(key2)); - - // assert the method name is used - assertSame(r2, primary.get(key2).get()); - assertNull(secondary.get(key2)); - } - - @Test - public void testCacheable() throws Exception { - testCacheable(cs); - } - - @Test - public void testInvalidate() throws Exception { - testEvict(cs); - } - - @Test - public void testEarlyInvalidate() throws Exception { - testEvictEarly(cs); - } - - @Test - public void testEvictWithException() throws Exception { - testEvictException(cs); - } - - @Test - public void testEvictAll() throws Exception { - testEvictAll(cs); - } - - @Test - public void testInvalidateWithKey() throws Exception { - testEvictWKey(cs); - } - - @Test - public void testEarlyInvalidateWithKey() throws Exception { - testEvictWKeyEarly(cs); - } - - @Test - public void testConditionalExpression() throws Exception { - testConditionalExpression(cs); - } - - @Test - public void testKeyExpression() throws Exception { - testKeyExpression(cs); - } - - @Test - public void testClassCacheCacheable() throws Exception { - testCacheable(ccs); - } - - @Test - public void testClassCacheInvalidate() throws Exception { - testEvict(ccs); - } - - @Test - public void testClassEarlyInvalidate() throws Exception { - testEvictEarly(ccs); - } - - @Test - public void testClassEvictAll() throws Exception { - testEvictAll(ccs); - } - - @Test - public void testClassEvictWithException() throws Exception { - testEvictException(ccs); - } - - @Test - public void testClassCacheInvalidateWKey() throws Exception { - testEvictWKey(ccs); - } - - @Test - public void testClassEarlyInvalidateWithKey() throws Exception { - testEvictWKeyEarly(ccs); - } - - @Test - public void testNullValue() throws Exception { - testNullValue(cs); - } - - @Test - public void testClassNullValue() throws Exception { - Object key = new Object(); - assertNull(ccs.nullValue(key)); - int nr = ccs.nullInvocations().intValue(); - assertNull(ccs.nullValue(key)); - assertEquals(nr, ccs.nullInvocations().intValue()); - assertNull(ccs.nullValue(new Object())); - // the check method is also cached - assertEquals(nr, ccs.nullInvocations().intValue()); - assertEquals(nr + 1, AnnotatedClassCacheableService.nullInvocations.intValue()); - } - - @Test - public void testMethodName() throws Exception { - testMethodName(cs, "name"); - } - - @Test - public void testClassMethodName() throws Exception { - testMethodName(ccs, "namedefault"); - } - - @Test - public void testNullArg() throws Exception { - testNullArg(cs); - } - - @Test - public void testClassNullArg() throws Exception { - testNullArg(ccs); - } - - @Test - public void testCheckedException() throws Exception { - testCheckedThrowable(cs); - } - - @Test - public void testClassCheckedException() throws Exception { - testCheckedThrowable(ccs); - } - - @Test - public void testUncheckedException() throws Exception { - testUncheckedThrowable(cs); - } - - @Test - public void testClassUncheckedException() throws Exception { - testUncheckedThrowable(ccs); - } - - @Test - public void testUpdate() { - testCacheUpdate(cs); - } - - @Test - public void testClassUpdate() { - testCacheUpdate(ccs); - } - - @Test - public void testConditionalUpdate() { - testConditionalCacheUpdate(cs); - } - - @Test - public void testClassConditionalUpdate() { - testConditionalCacheUpdate(ccs); - } - - @Test - public void testMultiCache() { - testMultiCache(cs); - } - - @Test - public void testClassMultiCache() { - testMultiCache(ccs); - } - - @Test - public void testMultiEvict() { - testMultiEvict(cs); - } - - @Test - public void testClassMultiEvict() { - testMultiEvict(ccs); - } - - @Test - public void testMultiPut() { - testMultiPut(cs); - } - - @Test - public void testClassMultiPut() { - testMultiPut(ccs); - } - - @Test - public void testMultiCacheAndEvict() { - testMultiCacheAndEvict(cs); - } - - @Test - public void testClassMultiCacheAndEvict() { - testMultiCacheAndEvict(ccs); - } - - @Test - public void testMultiConditionalCacheAndEvict() { - testMultiConditionalCacheAndEvict(cs); - } - - @Test - public void testClassMultiConditionalCacheAndEvict() { - testMultiConditionalCacheAndEvict(ccs); - } -} \ No newline at end of file diff --git a/spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTest.java b/spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTests.java similarity index 53% rename from spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTest.java rename to spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTests.java index 81a7793fc8f..c85d84d0833 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTest.java +++ b/spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,15 @@ package org.springframework.cache.aspectj; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + import org.junit.Assert; import org.junit.Test; +import org.springframework.cache.Cache; +import org.springframework.cache.config.AbstractAnnotationTests; +import org.springframework.cache.config.CacheableService; import org.springframework.context.ApplicationContext; import org.springframework.context.support.GenericXmlApplicationContext; @@ -25,7 +32,7 @@ import org.springframework.context.support.GenericXmlApplicationContext; /** * @author Costin Leau */ -public class AspectJAnnotationTest extends AbstractAnnotationTest { +public class AspectJAnnotationTests extends AbstractAnnotationTests { @Override @@ -38,4 +45,30 @@ public class AspectJAnnotationTest extends AbstractAnnotationTest { AnnotationCacheAspect aspect = ctx.getBean("org.springframework.cache.config.internalCacheAspect", AnnotationCacheAspect.class); Assert.assertSame(ctx.getBean("keyGenerator"), aspect.getKeyGenerator()); } + + public void testMultiEvict(CacheableService service) { + Object o1 = new Object(); + + Object r1 = service.multiCache(o1); + Object r2 = service.multiCache(o1); + + Cache primary = cm.getCache("primary"); + Cache secondary = cm.getCache("secondary"); + + assertSame(r1, r2); + assertSame(r1, primary.get(o1).get()); + assertSame(r1, secondary.get(o1).get()); + + service.multiEvict(o1); + assertNull(primary.get(o1)); + assertNull(secondary.get(o1)); + + Object r3 = service.multiCache(o1); + Object r4 = service.multiCache(o1); + assertNotSame(r1, r3); + assertSame(r3, r4); + + assertSame(r3, primary.get(o1).get()); + assertSame(r4, secondary.get(o1).get()); + } } diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java b/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java index a6d1b4f7bda..52a1b4265e1 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/CacheableService.java b/spring-aspects/src/test/java/org/springframework/cache/config/CacheableService.java index 09e2fc4c4b1..81dd758d19d 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/CacheableService.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/CacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java b/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java index 33cc40d0a44..6d83d91c02d 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2013 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,83 +33,100 @@ public class DefaultCacheableService implements CacheableService { private final AtomicLong counter = new AtomicLong(); private final AtomicLong nullInvocations = new AtomicLong(); + @Override @Cacheable("default") public Long cache(Object arg1) { return counter.getAndIncrement(); } + @Override @CacheEvict("default") public void invalidate(Object arg1) { } + @Override @CacheEvict("default") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } + @Override @CacheEvict(value = "default", allEntries = true) public void evictAll(Object arg1) { } + @Override @CacheEvict(value = "default", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @CacheEvict(value = "default", key = "#p0") public void evict(Object arg1, Object arg2) { } + @Override @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @Cacheable(value = "default", condition = "#classField == 3") public Long conditional(int classField) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#p0") public Long key(Object arg1, Object arg2) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName") public Long name(Object arg1) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Long rootVars(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut("default") public Long update(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut(value = "default", condition = "#arg.equals(3)") public Long conditionalUpdate(Object arg) { return Long.valueOf(arg.toString()); } + @Override @Cacheable("default") public Long nullValue(Object arg1) { nullInvocations.incrementAndGet(); return null; } + @Override public Number nullInvocations() { return nullInvocations.get(); } + @Override @Cacheable("default") public Long throwChecked(Object arg1) throws Exception { throw new Exception(arg1.toString()); } + @Override @Cacheable("default") public Long throwUnchecked(Object arg1) { throw new UnsupportedOperationException(arg1.toString()); @@ -117,28 +134,34 @@ public class DefaultCacheableService implements CacheableService { // multi annotations + @Override @Caching(cacheable = { @Cacheable("primary"), @Cacheable("secondary") }) public Long multiCache(Object arg1) { return counter.getAndIncrement(); } + @Override +//FIXME @Caching(evict = { @CacheEvict("primary"), @CacheEvict(value = "secondary", key = "#p0"), @CacheEvict(value = "primary", key = "#p0 + 'A'") }) @Caching(evict = { @CacheEvict("primary"), @CacheEvict(value = "secondary", key = "#p0") }) public Long multiEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", key = "#root.methodName") }, evict = { @CacheEvict("secondary") }) public Long multiCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", condition = "#p0 == 3") }, evict = { @CacheEvict("secondary") }) public Long multiConditionalCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(put = { @CachePut("primary"), @CachePut("secondary") }) public Long multiUpdate(Object arg1) { return Long.valueOf(arg1.toString()); } -} \ No newline at end of file +} diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/SomeKeyGenerator.java b/spring-aspects/src/test/java/org/springframework/cache/config/SomeKeyGenerator.java index 13364bdbd17..b4cc29458b2 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/SomeKeyGenerator.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/SomeKeyGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControlTest.java b/spring-aspects/src/test/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControlTest.java index 3bd1741699c..5a531301c9a 100644 --- a/spring-aspects/src/test/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControlTest.java +++ b/spring-aspects/src/test/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControlTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -16,16 +16,18 @@ package org.springframework.mock.staticmock; -import javax.persistence.PersistenceException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl.expectReturn; +import static org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl.expectThrow; +import static org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl.playback; -import junit.framework.Assert; +import javax.persistence.PersistenceException; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import static org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl.*; - /** * Test for static entity mocking framework. @@ -43,7 +45,7 @@ public class AnnotationDrivenStaticEntityMockingControlTest { Person.countPeople(); expectReturn(expectedCount); playback(); - Assert.assertEquals(expectedCount, Person.countPeople()); + assertEquals(expectedCount, Person.countPeople()); } @Test(expected=PersistenceException.class) @@ -61,7 +63,7 @@ public class AnnotationDrivenStaticEntityMockingControlTest { Person.findPerson(id); expectReturn(found); playback(); - Assert.assertEquals(found, Person.findPerson(id)); + assertEquals(found, Person.findPerson(id)); } @@ -81,10 +83,10 @@ public class AnnotationDrivenStaticEntityMockingControlTest { expectReturn(0); playback(); - Assert.assertEquals(found1, Person.findPerson(id1)); - Assert.assertEquals(found2, Person.findPerson(id2)); - Assert.assertEquals(found1, Person.findPerson(id1)); - Assert.assertEquals(0, Person.countPeople()); + assertEquals(found1, Person.findPerson(id1)); + assertEquals(found2, Person.findPerson(id2)); + assertEquals(found1, Person.findPerson(id1)); + assertEquals(0, Person.countPeople()); } // Note delegation is used when tests are invalid and should fail, as otherwise @@ -94,7 +96,7 @@ public class AnnotationDrivenStaticEntityMockingControlTest { public void testArgMethodNoMatchExpectReturn() { try { new Delegate().testArgMethodNoMatchExpectReturn(); - Assert.fail(); + fail(); } catch (IllegalArgumentException expected) { } } @@ -105,7 +107,7 @@ public class AnnotationDrivenStaticEntityMockingControlTest { } private void called(Person found, long id) { - Assert.assertEquals(found, Person.findPerson(id)); + assertEquals(found, Person.findPerson(id)); } @Test diff --git a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Delegate.java b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Delegate.java index 946e33aa01e..d4b3206bc36 100644 --- a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Delegate.java +++ b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Delegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -16,12 +16,12 @@ package org.springframework.mock.staticmock; +import static org.junit.Assert.assertEquals; + import java.rmi.RemoteException; import javax.persistence.PersistenceException; -import junit.framework.Assert; - import org.junit.Ignore; import org.junit.Test; import org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl; @@ -40,7 +40,7 @@ public class Delegate { Person.findPerson(id); AnnotationDrivenStaticEntityMockingControl.expectReturn(found); AnnotationDrivenStaticEntityMockingControl.playback(); - Assert.assertEquals(found, Person.findPerson(id + 1)); + assertEquals(found, Person.findPerson(id + 1)); } @Test @@ -50,7 +50,7 @@ public class Delegate { Person.findPerson(id); AnnotationDrivenStaticEntityMockingControl.expectThrow(new PersistenceException()); AnnotationDrivenStaticEntityMockingControl.playback(); - Assert.assertEquals(found, Person.findPerson(id + 1)); + assertEquals(found, Person.findPerson(id + 1)); } @Test @@ -62,7 +62,7 @@ public class Delegate { Person.countPeople(); AnnotationDrivenStaticEntityMockingControl.expectReturn(25); AnnotationDrivenStaticEntityMockingControl.playback(); - Assert.assertEquals(found, Person.findPerson(id)); + assertEquals(found, Person.findPerson(id)); } @Test diff --git a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person.java b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person.java index a3b15c59c63..ca98b77f923 100644 --- a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person.java +++ b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person_Roo_Entity.aj b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person_Roo_Entity.aj index 9e13013bb1f..a6a62cdbb64 100644 --- a/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person_Roo_Entity.aj +++ b/spring-aspects/src/test/java/org/springframework/mock/staticmock/Person_Roo_Entity.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java index 6bfe60205ea..b95ee6b8078 100644 --- a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java +++ b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -29,10 +29,11 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.Matchers.startsWith; - +import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.*; /** @@ -54,6 +55,8 @@ public class AnnotationAsyncExecutionAspectTests { @Test public void asyncMethodGetsRoutedAsynchronously() { + Assume.group(TestGroup.PERFORMANCE); + ClassWithoutAsyncAnnotation obj = new ClassWithoutAsyncAnnotation(); obj.incrementAsync(); executor.waitForCompletion(); @@ -84,6 +87,8 @@ public class AnnotationAsyncExecutionAspectTests { @Test public void voidMethodInAsyncClassGetsRoutedAsynchronously() { + Assume.group(TestGroup.PERFORMANCE); + ClassWithAsyncAnnotation obj = new ClassWithAsyncAnnotation(); obj.increment(); executor.waitForCompletion(); diff --git a/spring-aspects/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java b/spring-aspects/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java deleted file mode 100644 index 0c0b3cb81cf..00000000000 --- a/spring-aspects/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.transaction; - -import org.springframework.transaction.support.AbstractPlatformTransactionManager; -import org.springframework.transaction.support.DefaultTransactionStatus; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -@SuppressWarnings("serial") -public class CallCountingTransactionManager extends AbstractPlatformTransactionManager { - - public TransactionDefinition lastDefinition; - public int begun; - public int commits; - public int rollbacks; - public int inflight; - - protected Object doGetTransaction() { - return new Object(); - } - - protected void doBegin(Object transaction, TransactionDefinition definition) { - this.lastDefinition = definition; - ++begun; - ++inflight; - } - - protected void doCommit(DefaultTransactionStatus status) { - ++commits; - --inflight; - } - - protected void doRollback(DefaultTransactionStatus status) { - ++rollbacks; - --inflight; - } - - public void clear() { - begun = commits = rollbacks = inflight = 0; - } - -} diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithPrivateAnnotatedMember.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithPrivateAnnotatedMember.java index f718e093855..938265b97c4 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithPrivateAnnotatedMember.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithPrivateAnnotatedMember.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -12,8 +12,6 @@ * 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. - * - * Created on 11 Sep 2006 by Adrian Colyer */ package org.springframework.transaction.aspectj; diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithProtectedAnnotatedMember.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithProtectedAnnotatedMember.java index 18763dcc742..07abf06c64d 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithProtectedAnnotatedMember.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ClassWithProtectedAnnotatedMember.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -12,8 +12,6 @@ * 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. - * - * Created on 11 Sep 2006 by Adrian Colyer */ package org.springframework.transaction.aspectj; diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ITransactional.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ITransactional.java index 7e8ef63d165..44c3ea36b38 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ITransactional.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/ITransactional.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2012 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 + * + * http://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.transaction.aspectj; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/MethodAnnotationOnClassWithNoInterface.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/MethodAnnotationOnClassWithNoInterface.java index 437a1a4f07c..3631b05550a 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/MethodAnnotationOnClassWithNoInterface.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/MethodAnnotationOnClassWithNoInterface.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2012 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 + * + * http://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.transaction.aspectj; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests-context.xml b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests-context.xml index 6af0f02db37..0d08cdcb56f 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests-context.xml +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests-context.xml @@ -3,7 +3,7 @@ - + diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java index 407a5e2e991..70892e39493 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import java.lang.reflect.Method; import junit.framework.AssertionFailedError; import org.springframework.test.AbstractDependencyInjectionSpringContextTests; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAttribute; diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionalAnnotationOnlyOnClassWithNoInterface.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionalAnnotationOnlyOnClassWithNoInterface.java index 93bd225f7ca..bca935ce3f5 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionalAnnotationOnlyOnClassWithNoInterface.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionalAnnotationOnlyOnClassWithNoInterface.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2012 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 + * + * http://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.transaction.aspectj; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java b/spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java index 9fbac3fef8a..ef170a1baaf 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java index 6890b9e706b..f806b9f6a5e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java index ca62f6fa3ca..c683f50ab8a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataElement.java b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataElement.java index 70b3667bee8..6b6229d4165 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanMetadataElement.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanMetadataElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java b/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java index 070fdbf8dea..628ee8e78a5 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/BeansException.java b/spring-beans/src/main/java/org/springframework/beans/BeansException.java index 2aae901c722..efbed41edf5 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeansException.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeansException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/ConversionNotSupportedException.java b/spring-beans/src/main/java/org/springframework/beans/ConversionNotSupportedException.java index fc44cd572d4..5151193e8fe 100644 --- a/spring-beans/src/main/java/org/springframework/beans/ConversionNotSupportedException.java +++ b/spring-beans/src/main/java/org/springframework/beans/ConversionNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java index 76c295490e0..54467cd3ea8 100644 --- a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java +++ b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java @@ -41,8 +41,8 @@ import static org.springframework.beans.PropertyDescriptorUtils.*; /** * Decorator for a standard {@link BeanInfo} object, e.g. as created by - * {@link Introspector#getBeanInfo(Class)}, designed to discover and register non-void - * returning setter methods. For example: + * {@link Introspector#getBeanInfo(Class)}, designed to discover and register static + * and/or non-void returning setter methods. For example: *

{@code
  * public class Bean {
  *     private Foo foo;
@@ -102,37 +102,40 @@ class ExtendedBeanInfo implements BeanInfo {
 					new SimpleNonIndexedPropertyDescriptor(pd));
 		}
 
-		for (Method method : findNonVoidWriteMethods(delegate.getMethodDescriptors())) {
-			handleNonVoidWriteMethod(method);
+		for (Method method : findCandidateWriteMethods(delegate.getMethodDescriptors())) {
+			handleCandidateWriteMethod(method);
 		}
 	}
 
 
-	private List findNonVoidWriteMethods(MethodDescriptor[] methodDescriptors) {
+	private List findCandidateWriteMethods(MethodDescriptor[] methodDescriptors) {
 		List matches = new ArrayList();
 		for (MethodDescriptor methodDescriptor : methodDescriptors) {
 			Method method = methodDescriptor.getMethod();
-			if (isNonVoidWriteMethod(method)) {
+			if (isCandidateWriteMethod(method)) {
 				matches.add(method);
 			}
 		}
 		return matches;
 	}
 
-	public static boolean isNonVoidWriteMethod(Method method) {
+	public static boolean isCandidateWriteMethod(Method method) {
 		String methodName = method.getName();
 		Class[] parameterTypes = method.getParameterTypes();
 		int nParams = parameterTypes.length;
 		if (methodName.length() > 3 && methodName.startsWith("set") &&
 				Modifier.isPublic(method.getModifiers()) &&
-				!void.class.isAssignableFrom(method.getReturnType()) &&
+				(
+						!void.class.isAssignableFrom(method.getReturnType()) ||
+						Modifier.isStatic(method.getModifiers())
+				) &&
 				(nParams == 1 || (nParams == 2 && parameterTypes[0].equals(int.class)))) {
 			return true;
 		}
 		return false;
 	}
 
-	private void handleNonVoidWriteMethod(Method method) throws IntrospectionException {
+	private void handleCandidateWriteMethod(Method method) throws IntrospectionException {
 		int nParams = method.getParameterTypes().length;
 		String propertyName = propertyNameFor(method);
 		Class propertyType = method.getParameterTypes()[nParams-1];
diff --git a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java
index 7e462119226..183ffe4e2a3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java
@@ -51,7 +51,7 @@ public class ExtendedBeanInfoFactory implements Ordered, BeanInfoFactory {
 	 */
 	private boolean supports(Class beanClass) {
 		for (Method method : beanClass.getMethods()) {
-			if (ExtendedBeanInfo.isNonVoidWriteMethod(method)) {
+			if (ExtendedBeanInfo.isCandidateWriteMethod(method)) {
 				return true;
 			}
 		}
diff --git a/spring-beans/src/main/java/org/springframework/beans/FatalBeanException.java b/spring-beans/src/main/java/org/springframework/beans/FatalBeanException.java
index d1d30a5e2fa..84fe47bb239 100644
--- a/spring-beans/src/main/java/org/springframework/beans/FatalBeanException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/FatalBeanException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java b/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java
index 20260432a27..0f0c5931627 100644
--- a/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/GenericTypeAwarePropertyDescriptor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java b/spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java
index 51ff5161f18..96db41d162b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/Mergeable.java b/spring-beans/src/main/java/org/springframework/beans/Mergeable.java
index dc142e0f994..cba64d94f89 100644
--- a/spring-beans/src/main/java/org/springframework/beans/Mergeable.java
+++ b/spring-beans/src/main/java/org/springframework/beans/Mergeable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java b/spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java
index 467c595ed60..e079bb0f56e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
index 7a21fbf0e1f..390b3f8a12f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
+++ b/spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/NotReadablePropertyException.java b/spring-beans/src/main/java/org/springframework/beans/NotReadablePropertyException.java
index cba93573fe0..2001d09eed9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/NotReadablePropertyException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/NotReadablePropertyException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java b/spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java
index 2a5042c94f1..de734c28c30 100644
--- a/spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/NullValueInNestedPathException.java b/spring-beans/src/main/java/org/springframework/beans/NullValueInNestedPathException.java
index 6ed4d3c578a..f1ad856b3ff 100644
--- a/spring-beans/src/main/java/org/springframework/beans/NullValueInNestedPathException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/NullValueInNestedPathException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java
index b2eafd44339..68bdde7412f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java
index 80168252ac9..621bae5325b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java
index 9fa559a8e94..9da1ed0658b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java b/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
index 9768d25a26e..1919a47122b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java
index c14de75ed1d..549334393f3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistry.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistry.java
index 9eb3af78af7..f76df2a2d84 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
index 6b3aa68b6d1..81854100d4e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java b/spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java
index 9584b49107b..82830a198cd 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java b/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
index f08d0291089..feecaf0e590 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/PropertyValues.java b/spring-beans/src/main/java/org/springframework/beans/PropertyValues.java
index 6ecb77e16d5..8af2c77ff79 100644
--- a/spring-beans/src/main/java/org/springframework/beans/PropertyValues.java
+++ b/spring-beans/src/main/java/org/springframework/beans/PropertyValues.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java b/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java
index bac7fc93ba1..d1b7c48130c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanClassLoaderAware.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanClassLoaderAware.java
index b27aa6f4325..ab584354b85 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanClassLoaderAware.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanClassLoaderAware.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java
index bd5998cc7f2..2ffe909a941 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationNotAllowedException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationNotAllowedException.java
index cb270e619c1..480ff828575 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationNotAllowedException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationNotAllowedException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCurrentlyInCreationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCurrentlyInCreationException.java
index 9e3d1a59060..050444bb4ef 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanCurrentlyInCreationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanCurrentlyInCreationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java
index 1ba73bbde06..47a2ec8c14b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanExpressionException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanExpressionException.java
index f4b5be3df28..b935abfbb4b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanExpressionException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanExpressionException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java
index 0debc41c7df..2d18e67b1ac 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryAware.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryAware.java
index 1a7df36df23..a283217c248 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryAware.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactoryAware.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanInitializationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanInitializationException.java
index aaace2cf34b..c52d0ae7661 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanInitializationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanInitializationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsAbstractException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsAbstractException.java
index 46a99fc5a24..f7020130e84 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsAbstractException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsAbstractException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java
index 43b2bddc756..af47ab3f80d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java
index b853cec073a..3b2914e6c9d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java b/spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java
index e620437b532..772da666e2d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/DisposableBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/DisposableBean.java
index 536c2e695c8..5554afc2b3d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/DisposableBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/DisposableBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java
index d16bd68551e..84763c37f6c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBeanNotInitializedException.java b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBeanNotInitializedException.java
index 791b30557e6..9e8e0e20735 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBeanNotInitializedException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/FactoryBeanNotInitializedException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/HierarchicalBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/HierarchicalBeanFactory.java
index d48bdba6d73..7e6a347afc2 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/HierarchicalBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/HierarchicalBeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/InitializingBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/InitializingBean.java
index 420aefb2c0b..365bf99bf1a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/InitializingBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/InitializingBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java
index 6f8d57ff85a..5f5b643f156 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/ListableBeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java
index 78640789b05..40f807dd543 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/SmartFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/SmartFactoryBean.java
index a8e20e049c4..143936f7b76 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/SmartFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/SmartFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java b/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java
index f700515bec4..5a455420d32 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryLocator.java b/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryLocator.java
index ef2e40e34cf..b917de2a174 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryLocator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryLocator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryReference.java
index efe23a7479d..35c3d3f51fa 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/access/BeanFactoryReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/access/BootstrapException.java b/spring-beans/src/main/java/org/springframework/beans/factory/access/BootstrapException.java
index 2fb454543e5..d2a72bc368e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/access/BootstrapException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/access/BootstrapException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java b/spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java
index 00fb3e690b0..1dc32578192 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/access/el/SpringBeanELResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/access/el/SpringBeanELResolver.java
index 6b439391e98..e97329df74d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/access/el/SpringBeanELResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/access/el/SpringBeanELResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedBeanDefinition.java
index 811898742dd..7eef126d8d6 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedBeanDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java
index 205fed0aebc..dc594157ae4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Required.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Required.java
index 46ef046864f..bb342c7854c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Required.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Required.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java
index 5939524eea8..5c1ad4b751b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java
index 2040f6f4201..e71eb1a8991 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java
index 4102753bfc8..b0b4142ec65 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java
index d14e2f3c0b0..c9d442c3355 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java
index 47db66447eb..8cfbb7645ff 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanFactoryPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java
index 52d03678bc7..9739a62f8f1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReference.java
index b396d2367bf..80c22d87dbd 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java
index e7c232d97b8..bbe7ddf804d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java
index ebaa3a44bba..d0e93c8b0c8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java
index 956448d332f..2dc8ec6faee 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java
index 4d013fae16b..1e59e7d134c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
index 9eff79944ca..03e5716fdd7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -234,6 +234,8 @@ public class CustomEditorConfigurer implements BeanFactoryPostProcessor, BeanCla
 			this.sharedEditor = sharedEditor;
 		}
 
+		@Override
+		@SuppressWarnings("deprecation")
 		public void registerCustomEditors(PropertyEditorRegistry registry) {
 			if (!(registry instanceof PropertyEditorRegistrySupport)) {
 				throw new IllegalArgumentException("Cannot registered shared editor " +
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareBeanPostProcessor.java
index df8cb8447f7..76de13907fd 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareBeanPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java
index b0583f58865..31edfa91449 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
index 7eca9097c16..f508e3fff11 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java
index 299b588fc6e..736868bed36 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java
index b544f2f1e2b..1615a8125f6 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java
index a202e5a9585..c1fd6a8e6bf 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java
index 8032c163350..b9b822e2e2e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
index 197c2ad306d..bf9474138f1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java
index d9c775743dd..7477e197cb8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
index 55ab063ef66..836098ff8cd 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java
index 7e299321f04..8777fa61e07 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
index 1fb0c2005ac..e8f2b72b6c7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java
index 2d94806085c..79d0234c37d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java
index fe77b35478f..13f5a9be56d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
index 3f79e9ff5a4..e4f27fec8b2 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
index d37d64258c3..828cdc8257c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java
index ff5da625e46..d281d86cd44 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java
index 7e3d6b68a21..2d01b986a1d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java
index 0f162026543..49c5f9f7b57 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java
index b5a99a8890c..72357a8cc7b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java
index 4462ef760f9..76f3a2fd8a7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java
index e58a4276bbd..ffc1cb2a1e1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java
index 71a155efe47..9ff54665c78 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java
index 6726bbac41a..66dfae23d90 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
index 4f9882f293f..3c4b68e3399 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java
index f11e44e4f9b..4611365c077 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java
index 42f1bc82e07..9f78a2909d4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java
index 0bbbb4deee1..649b17123a3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java
index 6d602ea28ab..2f940269eb4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java
index 4da479b2341..e21707376ed 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java
index 88c2bcf9f4b..0b0fe96658c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
index 615839c2133..b07e211d163 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java
index 964f7d83e66..6846390e1b9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java
index 3906928b5fd..cd2c41e1153 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
index 6ea25abcc6b..f8ffd5798b5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
index 2b354882df4..6a2cb27e495 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
index 542f1d5b62a..db7ccda8001 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java
index 813e8d4b6f1..f5d1e777812 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
index 4a13bc1b2dc..aa9bbe94e8b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java
index fd50469024a..326e1fb58c4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java
index f14db8c8bca..330b699096b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java
index 57f4ddbb801..04e96a75781 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java
index a09d69ddedf..b03ca67dcd5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
index da0103b6547..161eae7e99b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java
index d3206fdc998..82fddd21066 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/InstantiationStrategy.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/InstantiationStrategy.java
index 6be1f2399c6..884ee9c3d9a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/InstantiationStrategy.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/InstantiationStrategy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/LookupOverride.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/LookupOverride.java
index 9c1e9292e29..560943d309e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/LookupOverride.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/LookupOverride.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java
index bac4697f187..e7e7ec7dca3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java
index bac7a2a4fc8..5c9aa550113 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java
index e4459d02967..4529b714417 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java
index b947affe435..95b444721b8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java
index 7efcba32043..654cadc9fc6 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java
index c29fbaaa7d0..ecc984a7cec 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java
index d336ef8855c..fc64caf6480 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java
index 0fa1b59046f..d3c630491b9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MethodReplacer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
index 8927b9b0737..7b7822f0df0 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java
index 261ccc04163..e570a24c573 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
index 6efe58e1e1f..ac001c639e9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
index 7287049bc34..edb954ae7f8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java
index 0e129d6e38a..e46145f2968 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfo.java b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfo.java
index 4ec68342d55..67f32d5d2c4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfo.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfoResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfoResolver.java
index ab648bdbb98..c306cb70bb1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfoResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanWiringInfoResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java
index 9782f086beb..91c94990ccf 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSimpleBeanDefinitionParser.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSimpleBeanDefinitionParser.java
index 99bd416cb91..0bfcb375dab 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSimpleBeanDefinitionParser.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSimpleBeanDefinitionParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSingleBeanDefinitionParser.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSingleBeanDefinitionParser.java
index f86dc30f70b..ec5d3687400 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSingleBeanDefinitionParser.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSingleBeanDefinitionParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDecorator.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDecorator.java
index b1713f24e8e..c5e4d9128a7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDecorator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDecorator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDocumentReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDocumentReader.java
index ecf5980def2..37ef1b40904 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDocumentReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDocumentReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
index 359975c1ce7..de4c3e695ed 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
@@ -716,6 +716,7 @@ public class BeanDefinitionParserDelegate {
 		}
 	}
 
+	@SuppressWarnings("deprecation")
 	public int getAutowireMode(String attValue) {
 		String att = attValue;
 		if (DEFAULT_VALUE.equals(att)) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java
index a833a3c5144..d7fcfc9e4d9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java
index c6d9f5140a2..9900aa16517 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java
index 4450b30bd74..07bfe7afa93 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentDefaultsDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentDefaultsDefinition.java
index b927112b63b..874eeaf0348 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentDefaultsDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentDefaultsDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentLoader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentLoader.java
index 348f4f6dc4a..a7ebdb9c579 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentLoader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandler.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandler.java
index 823e3015cec..8da64b6070f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandler.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerResolver.java
index 12e95b0b428..d8ccc410506 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/ResourceEntityResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/ResourceEntityResolver.java
index 63e5a39f2d1..b7e440d6471 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/ResourceEntityResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/ResourceEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -77,7 +77,7 @@ public class ResourceEntityResolver extends DelegatingEntityResolver {
 			try {
 				String decodedSystemId = URLDecoder.decode(systemId);
 				String givenUrl = new URL(decodedSystemId).toString();
-				String systemRootUrl = new File("").toURL().toString();
+				String systemRootUrl = new File("").toURI().toURL().toString();
 				// Try relative to resource base if currently in system root.
 				if (givenUrl.startsWith(systemRootUrl)) {
 					resourcePath = givenUrl.substring(systemRootUrl.length());
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java
index ab933ffc9be..a7ca4fbd54e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
index 259c592ef71..27d861bcb83 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java
index 064ffd30cb7..39676dc24d8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java
index c819bbb7a6b..16b58500bc1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionStoreException.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionStoreException.java
index cba28b06415..ceec57615e7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionStoreException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionStoreException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java
index 2ff16bbbaee..fb6889226cc 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java
index 6e51f97fe5c..aee26b0ded1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java
index 2c87af1f7a4..e45a34149ec 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
index 42420f9fd01..68ab64d576c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
index 59dba77c36b..a6214171a57 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
index 433e126749b..5d5eea0de18 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java
index 934fa37bb35..985ba1723c1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
index b78db5ea5ef..cbf10da7a4b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
index 03e1d9c8f2e..36718b20e9d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
index 81134a69313..14871687ded 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
index 3e3072f0ec6..c946c621fb5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java
index 2fb351b55f2..a57b69eaede 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java
index 982f9438d61..92f47df1f1b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java
index efa3908b2dc..220f381e88e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java
index 753ba19c5b9..25af77b5dd3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java
index 886a1075c93..0c4c971fead 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
index a608128bee0..977c2b0a6cb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
index 19f8bf5393f..24467400fac 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
index 716872c5e2a..c8875b388b3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
index f05dd439612..da9c1eea94e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java
index 2059c660c47..632f60127cf 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java
index 84febdf01d8..f5ac6d6a487 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
index be8bf5c69ca..c5f9755d85a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java
index fd938eef804..3662903df83 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java b/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
index 486d13ed74a..a9ed9984aa0 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java b/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java
index 89490a664af..2c64bf5252f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java b/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java
index 13a81da8092..4d7ff960135 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java b/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
index 950f22cb06e..afe74eac66e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java b/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java
index 9ad02dade06..406e3b6faa1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
index 3483077e854..94dd439bfb0 100644
--- a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
+++ b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
@@ -13,6 +13,7 @@ import org.w3c.dom.Element;
 
 public class ComponentBeanDefinitionParser extends AbstractBeanDefinitionParser {
 
+	@Override
 	protected AbstractBeanDefinition parseInternal(Element element,
 			ParserContext parserContext) {
 		return parseComponentElement(element);
diff --git a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
index d85622e12bd..97e77c5740f 100644
--- a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
+++ b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2010 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -15,28 +15,29 @@
  */
 package com.foo;
 
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
 import java.util.List;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.ClassPathResource;
 
-import static org.junit.Assert.*;
-import static org.hamcrest.CoreMatchers.*;
-
 /**
  * @author Costin Leau
  */
 public class ComponentBeanDefinitionParserTest {
 
-	private static XmlBeanFactory bf;
+	private static DefaultListableBeanFactory bf;
 
 	@BeforeClass
 	public static void setUpBeforeClass() throws Exception {
-		bf = new XmlBeanFactory(new ClassPathResource(
-				"com/foo/component-config.xml"));
+		bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("com/foo/component-config.xml"));
 	}
 
 	@AfterClass
@@ -71,4 +72,4 @@ public class ComponentBeanDefinitionParserTest {
 		assertThat("Karate-1", equalTo(components.get(0).getName()));
 		assertThat("Sport-1", equalTo(components.get(1).getName()));
 	}
-}
\ No newline at end of file
+}
diff --git a/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java b/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
index e62eab786e1..ac47c4efea9 100644
--- a/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
+++ b/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
@@ -16,6 +16,7 @@ public class ComponentFactoryBean implements FactoryBean {
 		this.children = children;
 	}
 
+	@Override
 	public Component getObject() throws Exception {
 		if (this.children != null && this.children.size() > 0) {
 			for (Component child : children) {
@@ -25,10 +26,12 @@ public class ComponentFactoryBean implements FactoryBean {
 		return this.parent;
 	}
 
+	@Override
 	public Class getObjectType() {
 		return Component.class;
 	}
 
+	@Override
 	public boolean isSingleton() {
 		return true;
 	}
diff --git a/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java b/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
index 3ccc7f167b5..b29eeca0614 100644
--- a/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
+++ b/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
@@ -3,6 +3,7 @@ package com.foo;
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
+	@Override
 	public void init() {
 		registerBeanDefinitionParser("component",
 				new ComponentBeanDefinitionParser());
diff --git a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
index 4132763825c..51ea30bb548 100644
--- a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
index fb6831eb8c2..9d53409e73f 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -29,10 +29,10 @@ import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.propertyeditors.CustomDateEditor;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.ResourceEditor;
+import org.springframework.tests.sample.beans.DerivedTestBean;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.DerivedTestBean;
-import test.beans.ITestBean;
-import test.beans.TestBean;
 
 /**
  * Unit tests for {@link BeanUtils}.
@@ -360,18 +360,22 @@ public final class BeanUtilsTests {
 
 		private String value;
 
+		@Override
 		public String getKey() {
 			return key;
 		}
 
+		@Override
 		public void setKey(String aKey) {
 			key = aKey;
 		}
 
+		@Override
 		public String getValue() {
 			return value;
 		}
 
+		@Override
 		public void setValue(String aValue) {
 			value = aValue;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
index c9966af03ba..73bdeaee1c6 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java
index 3946cccb25e..8c7d8da1e89 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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,8 +17,8 @@
 package org.springframework.beans;
 
 import org.junit.Test;
-import test.beans.CustomEnum;
-import test.beans.GenericBean;
+import org.springframework.tests.sample.beans.CustomEnum;
+import org.springframework.tests.sample.beans.GenericBean;
 
 import static org.junit.Assert.*;
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
index c1f3b5e3acc..3d310bdc686 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -30,15 +30,15 @@ import java.util.Set;
 
 import static org.junit.Assert.*;
 import org.junit.Test;
-import test.beans.GenericBean;
-import test.beans.GenericIntegerBean;
-import test.beans.GenericSetOfIntegerBean;
-import test.beans.TestBean;
 
 import org.springframework.beans.propertyeditors.CustomNumberEditor;
 import org.springframework.beans.propertyeditors.StringTrimmerEditor;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
+import org.springframework.tests.sample.beans.GenericBean;
+import org.springframework.tests.sample.beans.GenericIntegerBean;
+import org.springframework.tests.sample.beans.GenericSetOfIntegerBean;
+import org.springframework.tests.sample.beans.TestBean;
 
 /**
  * @author Juergen Hoeller
@@ -507,6 +507,7 @@ public class BeanWrapperGenericsTests {
 
 		private Map>> mapOfListOfListOfInteger;
 
+		@Override
 		public Map getMapOfInteger() {
 			return mapOfInteger;
 		}
@@ -515,10 +516,12 @@ public class BeanWrapperGenericsTests {
 			this.mapOfInteger = mapOfInteger;
 		}
 
+		@Override
 		public Map> getMapOfListOfInteger() {
 			return mapOfListOfInteger;
 		}
 
+		@Override
 		public void setMapOfListOfInteger(Map> mapOfListOfInteger) {
 			this.mapOfListOfInteger = mapOfListOfInteger;
 		}
@@ -591,6 +594,7 @@ public class BeanWrapperGenericsTests {
 
 		private double version;
 
+		@Override
 		public Double getVersion() {
 			return this.version;
 		}
@@ -613,10 +617,12 @@ public class BeanWrapperGenericsTests {
 
 	  private Long id;
 
+	  @Override
 	  public Long getId() {
 		  return id;
 	  }
 
+	  @Override
 	  public void setId(Long aId) {
 		  this.id = aId;
 	  }
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
index d420e860c54..9d4e022a64a 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -49,6 +49,13 @@ import org.springframework.beans.propertyeditors.CustomNumberEditor;
 import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
 import org.springframework.beans.propertyeditors.StringTrimmerEditor;
 import org.springframework.beans.support.DerivedFromProtectedBaseBean;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+import org.springframework.tests.sample.beans.BooleanTestBean;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.IndexedTestBean;
+import org.springframework.tests.sample.beans.NumberTestBean;
+import org.springframework.tests.sample.beans.TestBean;
 import org.springframework.core.convert.ConversionFailedException;
 import org.springframework.core.convert.TypeDescriptor;
 import org.springframework.core.convert.support.DefaultConversionService;
@@ -56,11 +63,6 @@ import org.springframework.core.convert.support.GenericConversionService;
 import org.springframework.util.StopWatch;
 import org.springframework.util.StringUtils;
 
-import test.beans.BooleanTestBean;
-import test.beans.ITestBean;
-import test.beans.IndexedTestBean;
-import test.beans.NumberTestBean;
-import test.beans.TestBean;
 
 /**
  * @author Rod Johnson
@@ -329,6 +331,7 @@ public final class BeanWrapperTests {
 		TestBean tb = new TestBean();
 		BeanWrapper bw = new BeanWrapperImpl(tb);
 		bw.registerCustomEditor(String.class, new PropertyEditorSupport() {
+			@Override
 			public void setValue(Object value) {
 				super.setValue(value.toString());
 			}
@@ -500,6 +503,7 @@ public final class BeanWrapperTests {
 		PropsTester pt = new PropsTester();
 		BeanWrapper bw = new BeanWrapperImpl(pt);
 		bw.registerCustomEditor(String.class, "stringArray", new PropertyEditorSupport() {
+			@Override
 			public void setAsText(String text) {
 				setValue(text.substring(1));
 			}
@@ -559,6 +563,7 @@ public final class BeanWrapperTests {
 		TestBean tb = new TestBean();
 		BeanWrapper bw = new BeanWrapperImpl(tb);
 		bw.registerCustomEditor(String.class, "name", new PropertyEditorSupport() {
+			@Override
 			public void setValue(Object value) {
 				if (value instanceof String[]) {
 					setValue(StringUtils.arrayToDelimitedString(((String[]) value), "-"));
@@ -636,6 +641,7 @@ public final class BeanWrapperTests {
 		PropsTester pt = new PropsTester();
 		BeanWrapper bw = new BeanWrapperImpl(pt);
 		bw.registerCustomEditor(int.class, new PropertyEditorSupport() {
+			@Override
 			public void setAsText(String text) {
 				setValue(new Integer(Integer.parseInt(text) + 1));
 			}
@@ -1022,6 +1028,7 @@ public final class BeanWrapperTests {
 		IndexedTestBean bean = new IndexedTestBean();
 		BeanWrapper bw = new BeanWrapperImpl(bean);
 		bw.registerCustomEditor(TestBean.class, new PropertyEditorSupport() {
+			@Override
 			public void setAsText(String text) throws IllegalArgumentException {
 				if (!StringUtils.hasLength(text)) {
 					throw new IllegalArgumentException();
@@ -1055,6 +1062,7 @@ public final class BeanWrapperTests {
 		IndexedTestBean bean = new IndexedTestBean();
 		BeanWrapper bw = new BeanWrapperImpl(bean);
 		bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() {
+			@Override
 			public void setAsText(String text) throws IllegalArgumentException {
 				if (!StringUtils.hasLength(text)) {
 					throw new IllegalArgumentException();
@@ -1078,6 +1086,7 @@ public final class BeanWrapperTests {
 		IndexedTestBean bean = new IndexedTestBean();
 		BeanWrapper bw = new BeanWrapperImpl(bean);
 		bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() {
+			@Override
 			public void setAsText(String text) throws IllegalArgumentException {
 				if (!StringUtils.hasLength(text)) {
 					throw new IllegalArgumentException();
@@ -1132,10 +1141,8 @@ public final class BeanWrapperTests {
 
 	@Test
 	public void testLargeMatchingPrimitiveArray() {
-		if (LogFactory.getLog(BeanWrapperTests.class).isTraceEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(LogFactory.getLog(BeanWrapperTests.class));
 
 		PrimitiveArrayBean tb = new PrimitiveArrayBean();
 		BeanWrapper bw = new BeanWrapperImpl(tb);
@@ -1191,6 +1198,7 @@ public final class BeanWrapperTests {
 		PrimitiveArrayBean tb = new PrimitiveArrayBean();
 		BeanWrapper bw = new BeanWrapperImpl(tb);
 		bw.registerCustomEditor(int.class, "array", new PropertyEditorSupport() {
+			@Override
 			public void setValue(Object value) {
 				if (value instanceof Integer) {
 					super.setValue(new Integer(((Integer) value).intValue() + 1));
@@ -1209,6 +1217,7 @@ public final class BeanWrapperTests {
 		PrimitiveArrayBean tb = new PrimitiveArrayBean();
 		BeanWrapper bw = new BeanWrapperImpl(tb);
 		bw.registerCustomEditor(int.class, "array[1]", new PropertyEditorSupport() {
+			@Override
 			public void setValue(Object value) {
 				if (value instanceof Integer) {
 					super.setValue(new Integer(((Integer) value).intValue() + 1));
@@ -1541,6 +1550,24 @@ public final class BeanWrapperTests {
 		assertEquals(TestEnum.TEST_VALUE, consumer.getEnumValue());
 	}
 
+	@Test
+	public void cornerSpr10115() {
+		Spr10115Bean foo = new Spr10115Bean();
+		BeanWrapperImpl bwi = new BeanWrapperImpl();
+		bwi.setWrappedInstance(foo);
+		bwi.setPropertyValue("prop1", "val1");
+		assertEquals("val1", Spr10115Bean.prop1);
+	}
+
+
+	static class Spr10115Bean {
+		private static String prop1;
+
+		public static void setProp1(String prop1) {
+			Spr10115Bean.prop1 = prop1;
+		}
+	}
+
 
 	private static class Foo {
 
@@ -1821,6 +1848,7 @@ public final class BeanWrapperTests {
 			this.frozen = true;
 		}
 
+		@Override
 		public V put(K key, V value) {
 			if (this.frozen) {
 				throw new UnsupportedOperationException();
@@ -1830,16 +1858,19 @@ public final class BeanWrapperTests {
 			}
 		}
 
+		@Override
 		public Set> entrySet() {
 			this.accessed = true;
 			return super.entrySet();
 		}
 
+		@Override
 		public Set keySet() {
 			this.accessed = true;
 			return super.keySet();
 		}
 
+		@Override
 		public int size() {
 			this.accessed = true;
 			return super.size();
diff --git a/spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java b/spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java
index 4675d22dbff..a4fe92acc96 100644
--- a/spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -22,9 +22,9 @@ import java.beans.PropertyDescriptor;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import org.junit.Test;
-import test.beans.TestBean;
 
 import org.springframework.core.OverridingClassLoader;
+import org.springframework.tests.sample.beans.TestBean;
 
 import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.*;
@@ -44,7 +44,7 @@ public final class CachedIntrospectionResultsTests {
 		assertTrue(CachedIntrospectionResults.classCache.containsKey(TestBean.class));
 
 		ClassLoader child = new OverridingClassLoader(getClass().getClassLoader());
-		Class tbClass = child.loadClass("test.beans.TestBean");
+		Class tbClass = child.loadClass("org.springframework.tests.sample.beans.TestBean");
 		assertFalse(CachedIntrospectionResults.classCache.containsKey(tbClass));
 		CachedIntrospectionResults.acceptClassLoader(child);
 		bw = new BeanWrapperImpl(tbClass);
diff --git a/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java b/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
index 2a0cf025b09..95c3fbb8cc9 100644
--- a/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -115,6 +115,7 @@ public final class ConcurrentBeanWrapperTests {
 			this.test = test;
 		}
 
+		@Override
 		public void run() {
 			try {
 				for (int i = 0; i < 100; i++) {
diff --git a/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java b/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
index 5e05fc91db3..aaf6e56092d 100644
--- a/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -27,9 +27,9 @@ import java.lang.reflect.Method;
 import org.junit.Test;
 
 import org.springframework.core.JdkVersion;
+import org.springframework.tests.sample.beans.TestBean;
 import org.springframework.util.ClassUtils;
 
-import test.beans.TestBean;
 
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.lessThan;
@@ -214,6 +214,7 @@ public class ExtendedBeanInfoTests {
 	@Test
 	public void cornerSpr9453() throws IntrospectionException {
 		final class Bean implements Spr9453> {
+			@Override
 			public Class getProp() {
 				return null;
 			}
@@ -589,7 +590,9 @@ public class ExtendedBeanInfoTests {
 			public Number setFoo(String foo) { return null; }
 		}
 		class C extends B {
+			@Override
 			public String getFoo() { return null; }
+			@Override
 			public Integer setFoo(String foo) { return null; }
 		}
 
@@ -861,6 +864,7 @@ public class ExtendedBeanInfoTests {
 	}
 
 	interface TextBookOperations extends BookOperations {
+		@Override
 		TextBook getBook();
 	}
 
@@ -870,6 +874,7 @@ public class ExtendedBeanInfoTests {
 	}
 
 	class LawLibrary extends Library implements TextBookOperations {
+		@Override
 		public LawBook getBook() { return null; }
 	}
 
@@ -941,4 +946,28 @@ public class ExtendedBeanInfoTests {
 			assertThat(hasIndexedWriteMethodForProperty(bi, "address"), is(true));
 		}
 	}
+
+	@Test
+	public void shouldSupportStaticWriteMethod() throws IntrospectionException {
+		{
+			BeanInfo bi = Introspector.getBeanInfo(WithStaticWriteMethod.class);
+			assertThat(hasReadMethodForProperty(bi, "prop1"), is(false));
+			assertThat(hasWriteMethodForProperty(bi, "prop1"), is(false));
+			assertThat(hasIndexedReadMethodForProperty(bi, "prop1"), is(false));
+			assertThat(hasIndexedWriteMethodForProperty(bi, "prop1"), is(false));
+		}
+		{
+			BeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(WithStaticWriteMethod.class));
+			assertThat(hasReadMethodForProperty(bi, "prop1"), is(false));
+			assertThat(hasWriteMethodForProperty(bi, "prop1"), is(true));
+			assertThat(hasIndexedReadMethodForProperty(bi, "prop1"), is(false));
+			assertThat(hasIndexedWriteMethodForProperty(bi, "prop1"), is(false));
+		}
+	}
+
+	static class WithStaticWriteMethod {
+		@SuppressWarnings("unused")
+		public static void setProp1(String prop1) {
+		}
+	}
 }
diff --git a/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java b/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
index 2b114defc7c..bc53e02ae2f 100644
--- a/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java
index dd52eea7b82..7c728a55a29 100644
--- a/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -182,10 +182,12 @@ class RequiredTestBean implements BeanNameAware, BeanFactoryAware {
 		this.jobTitle = jobTitle;
 	}
 
+	@Override
 	@Required
 	public void setBeanName(String name) {
 	}
 
+	@Override
 	@Required
 	public void setBeanFactory(BeanFactory beanFactory) {
 	}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-leaf.xml b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-leaf.xml
index bf756e1bbc5..71586ad8d36 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-leaf.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-leaf.xml
@@ -3,7 +3,7 @@
 
 
 
-	
+	
 		custom
 		25
 	
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-middle.xml b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-middle.xml
index 2d124050745..c5fa5b28581 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-middle.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-middle.xml
@@ -4,17 +4,16 @@
 
 
 	
-		
+	
 		custom
 		666
 	
-	
+
 	
-	
+	
+
+
 
-		
-	
-	
\ No newline at end of file
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-root.xml b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-root.xml
index ff33aa02125..28f8d652776 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-root.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests-root.xml
@@ -6,19 +6,19 @@
 	
-	
+	
 
-	
+	
 
 	
-	
+	
 		custom
 		25
 	
 
-	
+	
 
-	
+	
 		false
 	
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
index 636fbda545f..553f9cef46d 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,27 +16,29 @@
 
 package org.springframework.beans.factory;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
+
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
 import org.junit.Before;
 import org.junit.Test;
-
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.support.StaticListableBeanFactory;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.cglib.proxy.NoOp;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.IndexedTestBean;
+import org.springframework.tests.sample.beans.TestBean;
+import org.springframework.tests.sample.beans.factory.DummyFactory;
 import org.springframework.util.ObjectUtils;
 
-import test.beans.DummyFactory;
-import test.beans.ITestBean;
-import test.beans.IndexedTestBean;
-import test.beans.TestBean;
-
-import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
 
 /**
  * @author Rod Johnson
@@ -60,10 +62,17 @@ public final class BeanFactoryUtilsTests {
 	public void setUp() {
 		// Interesting hierarchical factory to test counts.
 		// Slow to read so we cache it.
-		XmlBeanFactory grandParent = new XmlBeanFactory(ROOT_CONTEXT);
-		XmlBeanFactory parent = new XmlBeanFactory(MIDDLE_CONTEXT, grandParent);
-		XmlBeanFactory child = new XmlBeanFactory(LEAF_CONTEXT, parent);
-		this.dependentBeansBF = new XmlBeanFactory(DEPENDENT_BEANS_CONTEXT);
+
+
+		DefaultListableBeanFactory grandParent = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(grandParent).loadBeanDefinitions(ROOT_CONTEXT);
+		DefaultListableBeanFactory parent = new DefaultListableBeanFactory(grandParent);
+		new XmlBeanDefinitionReader(parent).loadBeanDefinitions(MIDDLE_CONTEXT);
+		DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent);
+		new XmlBeanDefinitionReader(child).loadBeanDefinitions(LEAF_CONTEXT);
+
+		this.dependentBeansBF = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader((BeanDefinitionRegistry) this.dependentBeansBF).loadBeanDefinitions(DEPENDENT_BEANS_CONTEXT);
 		dependentBeansBF.preInstantiateSingletons();
 		this.listableBeanFactory = child;
 	}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
index 3ba946c9626..27d839a8913 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,9 +16,6 @@
 
 package org.springframework.beans.factory;
 
-import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
-
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -30,13 +27,21 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.junit.Before;
 import org.junit.Test;
+
 import org.springframework.beans.PropertyEditorRegistrar;
 import org.springframework.beans.PropertyEditorRegistry;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.beans.propertyeditors.CustomDateEditor;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+
+import static org.junit.Assert.*;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 /**
  * @author Guillaume Poirier
@@ -70,8 +75,12 @@ public final class ConcurrentBeanFactoryTests {
 
 	@Before
 	public void setUp() throws Exception {
-		XmlBeanFactory factory = new XmlBeanFactory(CONTEXT);
+		Assume.group(TestGroup.PERFORMANCE);
+
+		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(factory).loadBeanDefinitions(CONTEXT);
 		factory.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+			@Override
 			public void registerCustomEditors(PropertyEditorRegistry registry) {
 				registry.registerCustomEditor(Date.class, new CustomDateEditor((DateFormat) DATE_FORMAT.clone(), false));
 			}
@@ -125,6 +134,7 @@ public final class ConcurrentBeanFactoryTests {
 
 	private class TestRun extends Thread {
 
+		@Override
 		public void run() {
 			try {
 				for (int i = 0; i < 10000; i++) {
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
index d52f73e510b..acf9f65a05a 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,6 +16,17 @@
 
 package org.springframework.beans.factory;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.Closeable;
 import java.lang.reflect.Field;
 import java.net.MalformedURLException;
@@ -32,19 +43,13 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+
 import javax.security.auth.Subject;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.junit.Ignore;
 import org.junit.Test;
-import test.beans.DerivedTestBean;
-import test.beans.DummyFactory;
-import test.beans.ITestBean;
-import test.beans.LifecycleBean;
-import test.beans.NestedTestBean;
-import test.beans.TestBean;
-
 import org.springframework.beans.BeansException;
 import org.springframework.beans.MutablePropertyValues;
 import org.springframework.beans.NotWritablePropertyException;
@@ -70,7 +75,6 @@ import org.springframework.beans.factory.support.ManagedList;
 import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.factory.xml.ConstructorDependenciesBean;
-import org.springframework.beans.factory.xml.DependenciesBean;
 import org.springframework.beans.propertyeditors.CustomNumberEditor;
 import org.springframework.core.MethodParameter;
 import org.springframework.core.convert.converter.Converter;
@@ -78,11 +82,18 @@ import org.springframework.core.convert.support.DefaultConversionService;
 import org.springframework.core.convert.support.GenericConversionService;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+import org.springframework.tests.sample.beans.DependenciesBean;
+import org.springframework.tests.sample.beans.DerivedTestBean;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.LifecycleBean;
+import org.springframework.tests.sample.beans.NestedTestBean;
+import org.springframework.tests.sample.beans.SideEffectBean;
+import org.springframework.tests.sample.beans.TestBean;
+import org.springframework.tests.sample.beans.factory.DummyFactory;
 import org.springframework.util.StopWatch;
 
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.*;
-
 /**
  * Tests properties population and autowire behavior.
  *
@@ -547,7 +558,9 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("spouse", new RuntimeBeanReference("self"));
-		lbf.registerBeanDefinition("self", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("self", bd);
 		TestBean self = (TestBean) lbf.getBean("self");
 		assertEquals(self, self.getSpouse());
 	}
@@ -558,7 +571,9 @@ public class DefaultListableBeanFactoryTests {
 			DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 			MutablePropertyValues pvs = new MutablePropertyValues();
 			pvs.add("ag", "foobar");
-			lbf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
+			RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+			bd.setPropertyValues(pvs);
+			lbf.registerBeanDefinition("tb", bd);
 			lbf.getBean("tb");
 			fail("Should throw exception on invalid property");
 		}
@@ -836,6 +851,7 @@ public class DefaultListableBeanFactoryTests {
 	public void testCustomEditor() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+			@Override
 			public void registerCustomEditors(PropertyEditorRegistry registry) {
 				NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
 				registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
@@ -843,7 +859,9 @@ public class DefaultListableBeanFactoryTests {
 		});
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("myFloat", "1,1");
-		lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("testBean", bd);
 		TestBean testBean = (TestBean) lbf.getBean("testBean");
 		assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
 	}
@@ -853,6 +871,7 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		GenericConversionService conversionService = new DefaultConversionService();
 		conversionService.addConverter(new Converter() {
+			@Override
 			public Float convert(String source) {
 				try {
 					NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
@@ -866,7 +885,9 @@ public class DefaultListableBeanFactoryTests {
 		lbf.setConversionService(conversionService);
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("myFloat", "1,1");
-		lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("testBean", bd);
 		TestBean testBean = (TestBean) lbf.getBean("testBean");
 		assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
 	}
@@ -875,6 +896,7 @@ public class DefaultListableBeanFactoryTests {
 	public void testCustomEditorWithBeanReference() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+			@Override
 			public void registerCustomEditors(PropertyEditorRegistry registry) {
 				NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
 				registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
@@ -882,7 +904,9 @@ public class DefaultListableBeanFactoryTests {
 		});
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("myFloat", new RuntimeBeanReference("myFloat"));
-		lbf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("testBean", bd);
 		lbf.registerSingleton("myFloat", "1,1");
 		TestBean testBean = (TestBean) lbf.getBean("testBean");
 		assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
@@ -985,7 +1009,8 @@ public class DefaultListableBeanFactoryTests {
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("name", "Tony");
 		pvs.add("age", "48");
-		RootBeanDefinition bd = new RootBeanDefinition(DependenciesBean.class, pvs);
+		RootBeanDefinition bd = new RootBeanDefinition(DependenciesBean.class);
+		bd.setPropertyValues(pvs);
 		bd.setDependencyCheck(RootBeanDefinition.DEPENDENCY_CHECK_OBJECTS);
 		bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
 		lbf.registerBeanDefinition("test", bd);
@@ -1034,7 +1059,8 @@ public class DefaultListableBeanFactoryTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1046,7 +1072,8 @@ public class DefaultListableBeanFactoryTests {
 	public void testArrayPropertyWithOptionalAutowiring() throws MalformedURLException {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1059,7 +1086,8 @@ public class DefaultListableBeanFactoryTests {
 		bf.registerSingleton("integer1", new Integer(4));
 		bf.registerSingleton("integer2", new Integer(5));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1071,7 +1099,8 @@ public class DefaultListableBeanFactoryTests {
 	public void testArrayConstructorWithOptionalAutowiring() {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1086,7 +1115,8 @@ public class DefaultListableBeanFactoryTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1102,7 +1132,8 @@ public class DefaultListableBeanFactoryTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(ArrayBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("arrayBean", rbd);
 		ArrayBean ab = (ArrayBean) bf.getBean("arrayBean");
 
@@ -1116,7 +1147,7 @@ public class DefaultListableBeanFactoryTests {
 		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
 		lbf.registerBeanDefinition("rod", bd);
 		assertEquals(1, lbf.getBeanDefinitionCount());
-		Object registered = lbf.autowire(NoDependencies.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false);
+		Object registered = lbf.autowire(NoDependencies.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false);
 		assertEquals(1, lbf.getBeanDefinitionCount());
 		assertTrue(registered instanceof NoDependencies);
 	}
@@ -1126,11 +1157,12 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("name", "Rod");
-		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
 		lbf.registerBeanDefinition("rod", bd);
 		assertEquals(1, lbf.getBeanDefinitionCount());
 		// Depends on age, name and spouse (TestBean)
-		Object registered = lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, true);
+		Object registered = lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true);
 		assertEquals(1, lbf.getBeanDefinitionCount());
 		DependenciesBean kerry = (DependenciesBean) registered;
 		TestBean rod = (TestBean) lbf.getBean("rod");
@@ -1142,10 +1174,11 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("name", "Rod");
-		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
 		lbf.registerBeanDefinition("rod", bd);
 		assertEquals(1, lbf.getBeanDefinitionCount());
-		Object registered = lbf.autowire(ConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false);
+		Object registered = lbf.autowire(ConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
 		assertEquals(1, lbf.getBeanDefinitionCount());
 		ConstructorDependency kerry = (ConstructorDependency) registered;
 		TestBean rod = (TestBean) lbf.getBean("rod");
@@ -1160,7 +1193,7 @@ public class DefaultListableBeanFactoryTests {
 		RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class);
 		lbf.registerBeanDefinition("rod2", bd2);
 		try {
-			lbf.autowire(ConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false);
+			lbf.autowire(ConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
 			fail("Should have thrown UnsatisfiedDependencyException");
 		}
 		catch (UnsatisfiedDependencyException ex) {
@@ -1175,11 +1208,12 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.addPropertyValue(new PropertyValue("name", "Rod"));
-		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
 		lbf.registerBeanDefinition("rod", bd);
 		assertEquals(1, lbf.getBeanDefinitionCount());
 		try {
-			lbf.autowire(UnsatisfiedConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, true);
+			lbf.autowire(UnsatisfiedConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, true);
 			fail("Should have unsatisfied constructor dependency on SideEffectBean");
 		}
 		catch (UnsatisfiedDependencyException ex) {
@@ -1462,7 +1496,9 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("age", "99");
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("test", bd);
 		TestBean tb = new TestBean();
 		assertEquals(0, tb.getAge());
 		lbf.applyBeanPropertyValues(tb, "test");
@@ -1474,7 +1510,9 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("age", "99");
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(null, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition();
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("test", bd);
 		TestBean tb = new TestBean();
 		assertEquals(0, tb.getAge());
 		lbf.applyBeanPropertyValues(tb, "test");
@@ -1488,7 +1526,9 @@ public class DefaultListableBeanFactoryTests {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("age", "99");
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		lbf.registerBeanDefinition("test", bd);
 		TestBean tb = new TestBean();
 		assertEquals(0, tb.getAge());
 		lbf.configureBean(tb, "test");
@@ -1504,7 +1544,9 @@ public class DefaultListableBeanFactoryTests {
 		lbf.registerBeanDefinition("spouse", bd);
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("age", "99");
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_NAME));
+		RootBeanDefinition tbd = new RootBeanDefinition(TestBean.class);
+		tbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_NAME);
+		lbf.registerBeanDefinition("test", tbd);
 		TestBean tb = new TestBean();
 		lbf.configureBean(tb, "test");
 		assertSame(lbf, tb.getBeanFactory());
@@ -1518,7 +1560,8 @@ public class DefaultListableBeanFactoryTests {
 		for (int i = 0; i < 1000; i++) {
 			MutablePropertyValues pvs = new MutablePropertyValues();
 			pvs.addPropertyValue(new PropertyValue("spouse", new RuntimeBeanReference("bean" + (i < 99 ? i + 1 : 0))));
-			RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
+			RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+			bd.setPropertyValues(pvs);
 			lbf.registerBeanDefinition("bean" + i, bd);
 		}
 		lbf.preInstantiateSingletons();
@@ -1532,7 +1575,9 @@ public class DefaultListableBeanFactoryTests {
 	@Test
 	public void testCircularReferenceThroughAutowiring() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(ConstructorDependencyBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR));
+		RootBeanDefinition bd = new RootBeanDefinition(ConstructorDependencyBean.class);
+		bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		lbf.registerBeanDefinition("test", bd);
 		try {
 			lbf.preInstantiateSingletons();
 			fail("Should have thrown UnsatisfiedDependencyException");
@@ -1544,7 +1589,9 @@ public class DefaultListableBeanFactoryTests {
 	@Test
 	public void testCircularReferenceThroughFactoryBeanAutowiring() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(ConstructorDependencyFactoryBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR));
+		RootBeanDefinition bd = new RootBeanDefinition(ConstructorDependencyFactoryBean.class);
+		bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		lbf.registerBeanDefinition("test", bd);
 		try {
 			lbf.preInstantiateSingletons();
 			fail("Should have thrown UnsatisfiedDependencyException");
@@ -1556,7 +1603,9 @@ public class DefaultListableBeanFactoryTests {
 	@Test
 	public void testCircularReferenceThroughFactoryBeanTypeCheck() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(ConstructorDependencyFactoryBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR));
+		RootBeanDefinition bd = new RootBeanDefinition(ConstructorDependencyFactoryBean.class);
+		bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		lbf.registerBeanDefinition("test", bd);
 		try {
 			lbf.getBeansOfType(String.class);
 			fail("Should have thrown UnsatisfiedDependencyException");
@@ -1568,9 +1617,12 @@ public class DefaultListableBeanFactoryTests {
 	@Test
 	public void testAvoidCircularReferenceThroughAutowiring() {
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
-		lbf.registerBeanDefinition("test", new RootBeanDefinition(ConstructorDependencyFactoryBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR));
-		lbf.registerBeanDefinition("string",
-				new RootBeanDefinition(String.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR));
+		RootBeanDefinition bd = new RootBeanDefinition(ConstructorDependencyFactoryBean.class);
+		bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		lbf.registerBeanDefinition("test", bd);
+		RootBeanDefinition bd2 = new RootBeanDefinition(String.class);
+		bd2.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		lbf.registerBeanDefinition("string", bd2);
 		lbf.preInstantiateSingletons();
 	}
 
@@ -1690,10 +1742,8 @@ public class DefaultListableBeanFactoryTests {
 
 	@Test
 	public void testPrototypeCreationIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1710,10 +1760,8 @@ public class DefaultListableBeanFactoryTests {
 
 	@Test
 	public void testPrototypeCreationWithDependencyCheckIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(LifecycleBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1756,10 +1804,8 @@ public class DefaultListableBeanFactoryTests {
 	@Test
 	@Ignore  // TODO re-enable when ConstructorResolver TODO sorted out
 	public void testPrototypeCreationWithConstructorArgumentsIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1806,10 +1852,8 @@ public class DefaultListableBeanFactoryTests {
 
 	@Test
 	public void testPrototypeCreationWithResolvedConstructorArgumentsIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1830,10 +1874,8 @@ public class DefaultListableBeanFactoryTests {
 
 	@Test
 	public void testPrototypeCreationWithPropertiesIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1879,10 +1921,8 @@ public class DefaultListableBeanFactoryTests {
 	 */
 	@Test
 	public void testPrototypeCreationWithResolvedPropertiesIsFastEnough() {
-		if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
-			// Skip this test: Trace logging blows the time limit.
-			return;
-		}
+		Assume.group(TestGroup.PERFORMANCE);
+		Assume.notLogging(factoryLog);
 		DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
 		RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
 		rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1907,9 +1947,11 @@ public class DefaultListableBeanFactoryTests {
 		RootBeanDefinition bd = new RootBeanDefinition(BeanWithDisposableBean.class);
 		lbf.registerBeanDefinition("test", bd);
 		lbf.addBeanPostProcessor(new BeanPostProcessor() {
+			@Override
 			public Object postProcessBeforeInitialization(Object bean, String beanName) {
 				return new TestBean();
 			}
+			@Override
 			public Object postProcessAfterInitialization(Object bean, String beanName) {
 				return bean;
 			}
@@ -1926,9 +1968,11 @@ public class DefaultListableBeanFactoryTests {
 		RootBeanDefinition bd = new RootBeanDefinition(BeanWithCloseable.class);
 		lbf.registerBeanDefinition("test", bd);
 		lbf.addBeanPostProcessor(new BeanPostProcessor() {
+			@Override
 			public Object postProcessBeforeInitialization(Object bean, String beanName) {
 				return new TestBean();
 			}
+			@Override
 			public Object postProcessAfterInitialization(Object bean, String beanName) {
 				return bean;
 			}
@@ -1946,9 +1990,11 @@ public class DefaultListableBeanFactoryTests {
 		bd.setDestroyMethodName("close");
 		lbf.registerBeanDefinition("test", bd);
 		lbf.addBeanPostProcessor(new BeanPostProcessor() {
+			@Override
 			public Object postProcessBeforeInitialization(Object bean, String beanName) {
 				return new TestBean();
 			}
+			@Override
 			public Object postProcessAfterInitialization(Object bean, String beanName) {
 				return bean;
 			}
@@ -2117,6 +2163,7 @@ public class DefaultListableBeanFactoryTests {
 		lbf.registerBeanDefinition("test", bd);
 		final String nameSetOnField = "nameSetOnField";
 		lbf.addBeanPostProcessor(new InstantiationAwareBeanPostProcessorAdapter() {
+			@Override
 			public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
 				TestBean tb = (TestBean) bean;
 				try {
@@ -2156,6 +2203,7 @@ public class DefaultListableBeanFactoryTests {
 
 		TestSecuredBean bean = (TestSecuredBean) Subject.doAsPrivileged(subject,
 				new PrivilegedAction() {
+					@Override
 					public Object run() {
 						return lbf.getBean("test");
 					}
@@ -2189,6 +2237,7 @@ public class DefaultListableBeanFactoryTests {
 	 */
 	@Test(timeout=1000)
 	public void testByTypeLookupIsFastEnough() {
+		Assume.group(TestGroup.PERFORMANCE);
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 
 		for (int i = 0; i < 1000; i++) {
@@ -2244,14 +2293,17 @@ public class DefaultListableBeanFactoryTests {
 		public ConstructorDependencyFactoryBean(String dependency) {
 		}
 
+		@Override
 		public Object getObject() {
 			return "test";
 		}
 
+		@Override
 		public Class getObjectType() {
 			return String.class;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
@@ -2262,6 +2314,7 @@ public class DefaultListableBeanFactoryTests {
 
 		private static boolean closed;
 
+		@Override
 		public void destroy() {
 			closed = true;
 		}
@@ -2272,6 +2325,7 @@ public class DefaultListableBeanFactoryTests {
 
 		private static boolean closed;
 
+		@Override
 		public void close() {
 			closed = true;
 		}
@@ -2316,14 +2370,17 @@ public class DefaultListableBeanFactoryTests {
 
 	public static class FactoryBeanThatShouldntBeCalled implements FactoryBean {
 
+		@Override
 		public Object getObject() {
 			throw new IllegalStateException();
 		}
 
+		@Override
 		public Class getObjectType() {
 			return null;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return false;
 		}
@@ -2334,15 +2391,18 @@ public class DefaultListableBeanFactoryTests {
 
 		public boolean initialized = false;
 
+		@Override
 		public Object getObject() throws Exception {
 			this.initialized = true;
 			return "";
 		}
 
+		@Override
 		public Class getObjectType() {
 			return String.class;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
@@ -2353,23 +2413,28 @@ public class DefaultListableBeanFactoryTests {
 
 		public boolean initialized = false;
 
+		@Override
 		public Object getObject() throws Exception {
 			this.initialized = true;
 			return "";
 		}
 
+		@Override
 		public Class getObjectType() {
 			return String.class;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
 
+		@Override
 		public boolean isPrototype() {
 			return false;
 		}
 
+		@Override
 		public boolean isEagerInit() {
 			return true;
 		}
@@ -2452,6 +2517,7 @@ public class DefaultListableBeanFactoryTests {
 			this.numberFormat = numberFormat;
 		}
 
+		@Override
 		@SuppressWarnings("unchecked")
 		public Object convertIfNecessary(Object value, Class requiredType) {
 			if (value instanceof String && Float.class.isAssignableFrom(requiredType)) {
@@ -2470,11 +2536,13 @@ public class DefaultListableBeanFactoryTests {
 			}
 		}
 
+		@Override
 		@SuppressWarnings("unchecked")
 		public Object convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) {
 			return convertIfNecessary(value, requiredType);
 		}
 
+		@Override
 		@SuppressWarnings("unchecked")
 		public Object convertIfNecessary(Object value, Class requiredType, Field field) {
 			return convertIfNecessary(value, requiredType);
@@ -2490,6 +2558,7 @@ public class DefaultListableBeanFactoryTests {
 			this.name = name;
 		}
 
+		@Override
 		public String getName() {
 			return this.name;
 		}
@@ -2540,29 +2609,6 @@ public class DefaultListableBeanFactoryTests {
 		}
 	}
 
-	/**
-	 * Bean that changes state on a business invocation, so that
-	 * we can check whether it's been invoked
-	 * @author Rod Johnson
-	 */
-	private static class SideEffectBean {
-
-		private int count;
-
-		public void setCount(int count) {
-			this.count = count;
-		}
-
-		public int getCount() {
-			return this.count;
-		}
-
-		public void doWork() {
-			++count;
-		}
-
-	}
-
 	private static class KnowsIfInstantiated {
 
 		private static boolean instantiated;
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
index 5b4c200f58d..6f2704b1f72 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -22,9 +22,10 @@ import static org.junit.Assert.assertThat;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.config.AbstractFactoryBean;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.ClassPathResource;
 
 /**
@@ -37,7 +38,8 @@ public class FactoryBeanLookupTests {
 
 	@Before
 	public void setUp() {
-		beanFactory = new XmlBeanFactory(
+		beanFactory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory).loadBeanDefinitions(
 				new ClassPathResource("FactoryBeanLookupTests-context.xml", this.getClass()));
 	}
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java
index c1e5f9acfed..62c85b60b2b 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,15 @@
 
 package org.springframework.beans.factory;
 
-import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import org.junit.Test;
 import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
 import org.springframework.util.Assert;
 
@@ -38,14 +41,16 @@ public final class FactoryBeanTests {
 
 	@Test
 	public void testFactoryBeanReturnsNull() throws Exception {
-		XmlBeanFactory factory = new XmlBeanFactory(RETURNS_NULL_CONTEXT);
+		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(factory).loadBeanDefinitions(RETURNS_NULL_CONTEXT);
 		Object result = factory.getBean("factoryBean");
 		assertNull(result);
 	}
 
 	@Test
 	public void testFactoryBeansWithAutowiring() throws Exception {
-		XmlBeanFactory factory = new XmlBeanFactory(WITH_AUTOWIRING_CONTEXT);
+		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);
 
 		BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
 		ppc.postProcessBeanFactory(factory);
@@ -62,7 +67,8 @@ public final class FactoryBeanTests {
 
 	@Test
 	public void testFactoryBeansWithIntermediateFactoryBeanAutowiringFailure() throws Exception {
-		XmlBeanFactory factory = new XmlBeanFactory(WITH_AUTOWIRING_CONTEXT);
+		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);
 
 		BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
 		ppc.postProcessBeanFactory(factory);
@@ -77,14 +83,17 @@ public final class FactoryBeanTests {
 
 	public static class NullReturningFactoryBean implements FactoryBean {
 
+		@Override
 		public Object getObject() {
 			return null;
 		}
 
+		@Override
 		public Class getObjectType() {
 			return null;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
@@ -103,6 +112,7 @@ public final class FactoryBeanTests {
 			return beta;
 		}
 
+		@Override
 		public void afterPropertiesSet() {
 			Assert.notNull(beta, "'beta' property is required");
 		}
@@ -131,6 +141,7 @@ public final class FactoryBeanTests {
 			return name;
 		}
 
+		@Override
 		public void afterPropertiesSet() {
 			Assert.notNull(gamma, "'gamma' property is required");
 		}
@@ -149,14 +160,17 @@ public final class FactoryBeanTests {
 			this.beta = beta;
 		}
 
+		@Override
 		public Object getObject() {
 			return this.beta;
 		}
 
+		@Override
 		public Class getObjectType() {
 			return null;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java
index 15dd2bcf93a..e422accf4b7 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -23,9 +23,9 @@ import java.util.Arrays;
 import org.junit.Test;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry;
+import org.springframework.tests.sample.beans.DerivedTestBean;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.DerivedTestBean;
-import test.beans.TestBean;
 
 /**
  * @author Juergen Hoeller
@@ -43,6 +43,7 @@ public final class SharedBeanRegistryTests {
 		assertSame(tb, beanRegistry.getSingleton("tb"));
 
 		TestBean tb2 = (TestBean) beanRegistry.getSingleton("tb2", new ObjectFactory() {
+			@Override
 			public Object getObject() throws BeansException {
 				return new TestBean();
 			}
diff --git a/spring-context/src/test/java/org/springframework/beans/factory/access/beans1.xml b/spring-beans/src/test/java/org/springframework/beans/factory/access/beans1.xml
similarity index 100%
rename from spring-context/src/test/java/org/springframework/beans/factory/access/beans1.xml
rename to spring-beans/src/test/java/org/springframework/beans/factory/access/beans1.xml
diff --git a/spring-context/src/test/java/org/springframework/beans/factory/access/beans2.xml b/spring-beans/src/test/java/org/springframework/beans/factory/access/beans2.xml
similarity index 100%
rename from spring-context/src/test/java/org/springframework/beans/factory/access/beans2.xml
rename to spring-beans/src/test/java/org/springframework/beans/factory/access/beans2.xml
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
index a24c78d9893..7181f0b8a12 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,6 +16,14 @@
 
 package org.springframework.beans.factory.annotation;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.Serializable;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
@@ -25,23 +33,22 @@ import java.util.List;
 import java.util.Map;
 
 import org.junit.Test;
-import test.beans.ITestBean;
-import test.beans.IndexedTestBean;
-import test.beans.NestedTestBean;
-import test.beans.TestBean;
-
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.FactoryBean;
 import org.springframework.beans.factory.ObjectFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.support.AutowireCandidateQualifier;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.support.GenericBeanDefinition;
 import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.IndexedTestBean;
+import org.springframework.tests.sample.beans.NestedTestBean;
+import org.springframework.tests.sample.beans.TestBean;
 import org.springframework.util.SerializationTestUtils;
 
-import static org.junit.Assert.*;
 
 /**
  * Unit tests for {@link AutowiredAnnotationBeanPostProcessor}.
@@ -608,7 +615,9 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 		AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
 		bpp.setBeanFactory(bf);
 		bf.addBeanPostProcessor(bpp);
-		bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ObjectFactoryInjectionBean.class, false));
+		RootBeanDefinition annotatedBeanDefinition = new RootBeanDefinition(ObjectFactoryInjectionBean.class);
+		annotatedBeanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
+		bf.registerBeanDefinition("annotatedBean", annotatedBeanDefinition);
 		bf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class));
 
 		ObjectFactoryInjectionBean bean = (ObjectFactoryInjectionBean) bf.getBean("annotatedBean");
@@ -989,6 +998,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 		public ExtendedResourceInjectionBean() {
 		}
 
+		@Override
 		@Autowired @Required
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -1068,6 +1078,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 
 		private ITestBean testBean4;
 
+		@Override
 		@Autowired(required = false)
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -1114,6 +1125,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 
 		private ITestBean testBean4;
 
+		@Override
 		@Autowired(required = false)
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -1185,6 +1197,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 			throw new UnsupportedOperationException();
 		}
 
+		@Override
 		@Autowired
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -1447,14 +1460,17 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
 
 	public static class StringFactoryBean implements FactoryBean {
 
+		@Override
 		public String getObject() throws Exception {
 			return "";
 		}
 
+		@Override
 		public Class getObjectType() {
 			return String.class;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java
index 4f96efc8d3c..4fbb7b8cb1d 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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,7 +17,7 @@
 package org.springframework.beans.factory.annotation;
 
 import static org.junit.Assert.assertEquals;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import org.junit.Test;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
@@ -69,6 +69,7 @@ public final class CustomAutowireConfigurerTests {
 
 	public static class CustomResolver implements AutowireCandidateResolver {
 
+		@Override
 		public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
 			if (!bdHolder.getBeanDefinition().isAutowireCandidate()) {
 				return false;
@@ -82,6 +83,7 @@ public final class CustomAutowireConfigurerTests {
 			return false;
 		}
 
+		@Override
 		public Object getSuggestedValue(DependencyDescriptor descriptor) {
 			return null;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
index fdaa110f360..a18a25e05ae 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -24,19 +24,20 @@ import javax.inject.Named;
 import javax.inject.Provider;
 
 import org.junit.Test;
-import test.beans.ITestBean;
-import test.beans.IndexedTestBean;
-import test.beans.NestedTestBean;
-import test.beans.TestBean;
 
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.FactoryBean;
+import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.support.AutowireCandidateQualifier;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.support.GenericBeanDefinition;
 import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.IndexedTestBean;
+import org.springframework.tests.sample.beans.NestedTestBean;
+import org.springframework.tests.sample.beans.TestBean;
 import org.springframework.util.SerializationTestUtils;
 
 import static org.junit.Assert.*;
@@ -406,7 +407,9 @@ public class InjectAnnotationBeanPostProcessorTests {
 		AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
 		bpp.setBeanFactory(bf);
 		bf.addBeanPostProcessor(bpp);
-		bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ObjectFactoryQualifierFieldInjectionBean.class, false));
+		RootBeanDefinition annotatedBeanDefinition = new RootBeanDefinition(ObjectFactoryQualifierFieldInjectionBean.class);
+		annotatedBeanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
+		bf.registerBeanDefinition("annotatedBean", annotatedBeanDefinition);
 		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
 		bd.addQualifier(new AutowireCandidateQualifier(Qualifier.class, "testBean"));
 		bf.registerBeanDefinition("testBean", bd);
@@ -426,7 +429,9 @@ public class InjectAnnotationBeanPostProcessorTests {
 		AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
 		bpp.setBeanFactory(bf);
 		bf.addBeanPostProcessor(bpp);
-		bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ObjectFactoryQualifierMethodInjectionBean.class, false));
+		RootBeanDefinition annotatedBeanDefinition = new RootBeanDefinition(ObjectFactoryQualifierMethodInjectionBean.class);
+		annotatedBeanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
+		bf.registerBeanDefinition("annotatedBean", annotatedBeanDefinition);
 		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
 		bd.addQualifier(new AutowireCandidateQualifier(Qualifier.class, "testBean"));
 		bf.registerBeanDefinition("testBean", bd);
@@ -609,6 +614,7 @@ public class InjectAnnotationBeanPostProcessorTests {
 		public ExtendedResourceInjectionBean() {
 		}
 
+		@Override
 		@Inject @Required
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -662,6 +668,7 @@ public class InjectAnnotationBeanPostProcessorTests {
 
 		private ITestBean testBean4;
 
+		@Override
 		@Inject
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -708,6 +715,7 @@ public class InjectAnnotationBeanPostProcessorTests {
 
 		private ITestBean testBean4;
 
+		@Override
 		@Inject
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -779,6 +787,7 @@ public class InjectAnnotationBeanPostProcessorTests {
 			throw new UnsupportedOperationException();
 		}
 
+		@Override
 		@Inject
 		public void setTestBean2(TestBean testBean2) {
 			super.setTestBean2(testBean2);
@@ -1074,14 +1083,17 @@ public class InjectAnnotationBeanPostProcessorTests {
 
 	public static class StringFactoryBean implements FactoryBean {
 
+		@Override
 		public String getObject() throws Exception {
 			return "";
 		}
 
+		@Override
 		public Class getObjectType() {
 			return String.class;
 		}
 
+		@Override
 		public boolean isSingleton() {
 			return true;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/CommonsLogFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/CommonsLogFactoryBeanTests.java
index e92f28b8169..c01585a153a 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/CommonsLogFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/CommonsLogFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -27,6 +27,7 @@ import org.junit.Test;
  * @author Rick Evans
  * @author Chris Beams
  */
+@SuppressWarnings("deprecation")
 public final class CommonsLogFactoryBeanTests {
 
 	@Test
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
index 265fea19a60..252ee0ddb80 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomEditorConfigurerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -27,7 +27,6 @@ import java.util.Map;
 
 import static org.junit.Assert.*;
 import org.junit.Test;
-import test.beans.TestBean;
 
 import org.springframework.beans.FatalBeanException;
 import org.springframework.beans.MutablePropertyValues;
@@ -36,6 +35,7 @@ import org.springframework.beans.PropertyEditorRegistry;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.propertyeditors.CustomDateEditor;
+import org.springframework.tests.sample.beans.TestBean;
 
 /**
  * Unit tests for {@link CustomEditorConfigurer}.
@@ -53,6 +53,7 @@ public final class CustomEditorConfigurerTests {
 		final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
 		cec.setPropertyEditorRegistrars(new PropertyEditorRegistrar[] {
 				new PropertyEditorRegistrar() {
+					@Override
 					public void registerCustomEditors(PropertyEditorRegistry registry) {
 						registry.registerCustomEditor(Date.class, new CustomDateEditor(df, true));
 					}
@@ -61,10 +62,14 @@ public final class CustomEditorConfigurerTests {
 
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("date", "2.12.1975");
-		bf.registerBeanDefinition("tb1", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd1 = new RootBeanDefinition(TestBean.class);
+		bd1.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb1", bd1);
 		pvs = new MutablePropertyValues();
 		pvs.add("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
-		bf.registerBeanDefinition("tb2", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class);
+		bd2.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb2", bd2);
 
 		TestBean tb1 = (TestBean) bf.getBean("tb1");
 		assertEquals(df.parse("2.12.1975"), tb1.getDate());
@@ -84,10 +89,14 @@ public final class CustomEditorConfigurerTests {
 
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("date", "2.12.1975");
-		bf.registerBeanDefinition("tb1", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd1 = new RootBeanDefinition(TestBean.class);
+		bd1.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb1", bd1);
 		pvs = new MutablePropertyValues();
 		pvs.add("someMap[myKey]", new TypedStringValue("2.12.1975", Date.class));
-		bf.registerBeanDefinition("tb2", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class);
+		bd2.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb2", bd2);
 
 		TestBean tb1 = (TestBean) bf.getBean("tb1");
 		assertEquals(df.parse("2.12.1975"), tb1.getDate());
@@ -106,7 +115,9 @@ public final class CustomEditorConfigurerTests {
 
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("date", "2.12.1975");
-		bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb", bd);
 
 		TestBean tb = (TestBean) bf.getBean("tb");
 		DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
@@ -124,7 +135,9 @@ public final class CustomEditorConfigurerTests {
 
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("date", "2.12.1975");
-		bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb", bd);
 
 		TestBean tb = (TestBean) bf.getBean("tb");
 		DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
@@ -142,7 +155,9 @@ public final class CustomEditorConfigurerTests {
 
 		MutablePropertyValues pvs = new MutablePropertyValues();
 		pvs.add("stringArray", "xxx");
-		bf.registerBeanDefinition("tb", new RootBeanDefinition(TestBean.class, pvs));
+		RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+		bd.setPropertyValues(pvs);
+		bf.registerBeanDefinition("tb", bd);
 
 		TestBean tb = (TestBean) bf.getBean("tb");
 		assertTrue(tb.getStringArray() != null && tb.getStringArray().length == 1);
@@ -189,6 +204,7 @@ public final class CustomEditorConfigurerTests {
 
 	public static class MyTestEditor extends PropertyEditorSupport {
 
+		@Override
 		public void setAsText(String text) {
 			setValue(new String[] {"test"});
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
index 0e31d83c101..65e6debd15f 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -16,8 +16,8 @@
 
 package org.springframework.beans.factory.config;
 
-import static org.easymock.EasyMock.*;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -45,24 +45,20 @@ public final class CustomScopeConfigurerTests {
 
 	@Test
 	public void testWithNoScopes() throws Exception {
-		Scope scope = createMock(Scope.class);
-		replay(scope);
+		Scope scope = mock(Scope.class);
 		CustomScopeConfigurer figurer = new CustomScopeConfigurer();
 		figurer.postProcessBeanFactory(factory);
-		verify(scope);
 	}
 
 	@Test
 	public void testSunnyDayWithBonaFideScopeInstance() throws Exception {
-		Scope scope = createMock(Scope.class);
-		replay(scope);
+		Scope scope = mock(Scope.class);
 		factory.registerScope(FOO_SCOPE, scope);
 		Map scopes = new HashMap();
 		scopes.put(FOO_SCOPE, scope);
 		CustomScopeConfigurer figurer = new CustomScopeConfigurer();
 		figurer.setScopes(scopes);
 		figurer.postProcessBeanFactory(factory);
-		verify(scope);
 	}
 
 	@Test
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/DeprecatedBeanWarnerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/DeprecatedBeanWarnerTests.java
index 6ae7cf74005..4ed025b09b6 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/DeprecatedBeanWarnerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/DeprecatedBeanWarnerTests.java
@@ -38,6 +38,7 @@ public class DeprecatedBeanWarnerTests {
 
 
 	@Test
+	@SuppressWarnings("deprecation")
 	public void postProcess() {
 		beanFactory = new DefaultListableBeanFactory();
 		BeanDefinition def = new RootBeanDefinition(MyDeprecatedBean.class);
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests-context.xml
index b9c8625b2f8..2e2d9fd435f 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests-context.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests-context.xml
@@ -3,7 +3,7 @@
 
 
 
-	
+	
 		
 			
 				
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests.java
index 0c328ce481d..66226340aa4 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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,7 +17,7 @@
 package org.springframework.beans.factory.config;
 
 import static org.junit.Assert.assertEquals;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import java.sql.Connection;
 
@@ -25,8 +25,8 @@ import org.junit.Test;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.TestBean;
 
 /**
  * Unit tests for {@link FieldRetrievingFactoryBean}.
@@ -119,7 +119,7 @@ public final class FieldRetrievingFactoryBeanTests {
 	@Test
 	public void testWithConstantOnClassWithPackageLevelVisibility() throws Exception {
 		FieldRetrievingFactoryBean fr = new FieldRetrievingFactoryBean();
-		fr.setBeanName("test.beans.PackageLevelVisibleBean.CONSTANT");
+		fr.setBeanName("org.springframework.tests.sample.beans.PackageLevelVisibleBean.CONSTANT");
 		fr.afterPropertiesSet();
 		assertEquals("Wuby", fr.getObject());
 	}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java
index 616b025ad39..a35b1e2948e 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/MethodInvokingFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
index e02b77f2a1d..dc56161776d 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,19 +16,25 @@
 
 package org.springframework.beans.factory.config;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
+
 import java.util.Date;
+
 import javax.inject.Provider;
 
-import static org.easymock.EasyMock.*;
 import org.junit.After;
-import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
-import static test.util.TestResourceUtils.*;
-
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.ObjectFactory;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
 import org.springframework.util.SerializationTestUtils;
 
@@ -43,11 +49,12 @@ public class ObjectFactoryCreatingFactoryBeanTests {
 	private static final Resource CONTEXT =
 		qualifiedResource(ObjectFactoryCreatingFactoryBeanTests.class, "context.xml");
 
-	private XmlBeanFactory beanFactory;
+	private DefaultListableBeanFactory beanFactory;
 
 	@Before
 	public void setUp() {
-		this.beanFactory = new XmlBeanFactory(CONTEXT);
+		this.beanFactory = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(CONTEXT);
 		this.beanFactory.setSerializationId("test");
 	}
 
@@ -105,9 +112,8 @@ public class ObjectFactoryCreatingFactoryBeanTests {
 		final String targetBeanName = "singleton";
 		final String expectedSingleton = "Alicia Keys";
 
-		BeanFactory beanFactory = createMock(BeanFactory.class);
-		expect(beanFactory.getBean(targetBeanName)).andReturn(expectedSingleton);
-		replay(beanFactory);
+		BeanFactory beanFactory = mock(BeanFactory.class);
+		given(beanFactory.getBean(targetBeanName)).willReturn(expectedSingleton);
 
 		ObjectFactoryCreatingFactoryBean factory = new ObjectFactoryCreatingFactoryBean();
 		factory.setTargetBeanName(targetBeanName);
@@ -116,8 +122,6 @@ public class ObjectFactoryCreatingFactoryBeanTests {
 		ObjectFactory objectFactory = factory.getObject();
 		Object actualSingleton = objectFactory.getObject();
 		assertSame(expectedSingleton, actualSingleton);
-
-		verify(beanFactory);
 	}
 
 	@Test
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java
index e4446440b81..cc43afb4da0 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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,7 +17,7 @@
 package org.springframework.beans.factory.config;
 
 import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import java.util.Properties;
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests-context.xml
index b33b3c9c65a..490aab87909 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests-context.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests-context.xml
@@ -3,19 +3,19 @@
 
 
 
-	
+	
 		10
 		
-			
+			
 				11
 			
 		
   
 	
-	
+	
 		98
 		
-			
+			
 				99
 			
 		
@@ -23,7 +23,7 @@
 
 	
 		
-			
+			
 				12
 			
 		
@@ -46,10 +46,10 @@
 	
 		tb
 		spouse
-		test.beans.TestBean
+		org.springframework.tests.sample.beans.TestBean
 	
 
-	
+	
 		
 		
 			
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests.java
index 5a564500eb3..ce21ee90954 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPathFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,15 +16,19 @@
 
 package org.springframework.beans.factory.config;
 
-import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import org.junit.Test;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.ITestBean;
-import test.beans.TestBean;
 
 /**
  * Unit tests for {@link PropertyPathFactoryBean}.
@@ -39,7 +43,8 @@ public class PropertyPathFactoryBeanTests {
 
 	@Test
 	public void testPropertyPathFactoryBeanWithSingletonResult() {
-		XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT);
+		DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONTEXT);
 		assertEquals(new Integer(12), xbf.getBean("propertyPath1"));
 		assertEquals(new Integer(11), xbf.getBean("propertyPath2"));
 		assertEquals(new Integer(10), xbf.getBean("tb.age"));
@@ -53,7 +58,8 @@ public class PropertyPathFactoryBeanTests {
 
 	@Test
 	public void testPropertyPathFactoryBeanWithPrototypeResult() {
-		XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT);
+		DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONTEXT);
 		assertNull(xbf.getType("tb.spouse"));
 		assertEquals(TestBean.class, xbf.getType("propertyPath3"));
 		Object result1 = xbf.getBean("tb.spouse");
@@ -72,14 +78,16 @@ public class PropertyPathFactoryBeanTests {
 
 	@Test
 	public void testPropertyPathFactoryBeanWithNullResult() {
-		XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT);
+		DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONTEXT);
 		assertNull(xbf.getType("tb.spouse.spouse"));
 		assertNull(xbf.getBean("tb.spouse.spouse"));
 	}
 
 	@Test
 	public void testPropertyPathFactoryBeanAsInnerBean() {
-		XmlBeanFactory xbf = new XmlBeanFactory(CONTEXT);
+		DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONTEXT);
 		TestBean spouse = (TestBean) xbf.getBean("otb.spouse");
 		TestBean tbWithInner = (TestBean) xbf.getBean("tbWithInner");
 		assertSame(spouse, tbWithInner.getSpouse());
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurerTests.java
index c0c65711bc2..63e49fb18bf 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2013 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,8 +36,8 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.TestBean;
 
 
 /**
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
index 1f080734bc3..1212913cb1b 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -22,7 +22,7 @@ import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.springframework.beans.factory.support.BeanDefinitionBuilder.genericBeanDefinition;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,9 +48,9 @@ import org.springframework.beans.factory.support.ManagedMap;
 import org.springframework.beans.factory.support.ManagedSet;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.IndexedTestBean;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.IndexedTestBean;
-import test.beans.TestBean;
 
 /**
  * Unit tests for various {@link PropertyResourceConfigurer} implementations including:
@@ -371,7 +371,8 @@ public final class PropertyResourceConfigurerTests {
 			pvs2.add("name", "name${var}${var}${");
 			pvs2.add("spouse", new RuntimeBeanReference("${ref}"));
 			pvs2.add("someMap", singletonMap);
-			RootBeanDefinition parent = new RootBeanDefinition(TestBean.class, pvs1);
+			RootBeanDefinition parent = new RootBeanDefinition(TestBean.class);
+			parent.setPropertyValues(pvs1);
 			ChildBeanDefinition bd = new ChildBeanDefinition("${parent}", pvs2);
 			factory.registerBeanDefinition("parent1", parent);
 			factory.registerBeanDefinition("tb1", bd);
@@ -382,7 +383,8 @@ public final class PropertyResourceConfigurerTests {
 			pvs.add("name", "name${var}${var}${");
 			pvs.add("spouse", new RuntimeBeanReference("${ref}"));
 			pvs.add("someMap", singletonMap);
-			RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
+			RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
+			bd.setPropertyValues(pvs);
 			factory.registerBeanDefinition("tb1", bd);
 		}
 
@@ -412,7 +414,9 @@ public final class PropertyResourceConfigurerTests {
 		someMap.put("key2", "${age}name");
 		MutablePropertyValues innerPvs = new MutablePropertyValues();
 		innerPvs.add("touchy", "${os.name}");
-		someMap.put("key3", new RootBeanDefinition(TestBean.class, innerPvs));
+		RootBeanDefinition innerBd = new RootBeanDefinition(TestBean.class);
+		innerBd.setPropertyValues(innerPvs);
+		someMap.put("key3", innerBd);
 		MutablePropertyValues innerPvs2 = new MutablePropertyValues(innerPvs);
 		someMap.put("${key4}", new BeanDefinitionHolder(new ChildBeanDefinition("tb1", innerPvs2), "child"));
 		pvs.add("someMap", someMap);
@@ -812,6 +816,7 @@ public final class PropertyResourceConfigurerTests {
 
 	private static class ConvertingOverrideConfigurer extends PropertyOverrideConfigurer {
 
+		@Override
 		protected String convertPropertyValue(String originalValue) {
 			return "X" + originalValue;
 		}
@@ -826,10 +831,12 @@ public final class PropertyResourceConfigurerTests {
 
 		private Preferences userRoot = new MockPreferences();
 
+		@Override
 		public Preferences systemRoot() {
 			return systemRoot;
 		}
 
+		@Override
 		public Preferences userRoot() {
 			return userRoot;
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
index 115f618a00b..f7ab438e765 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -16,8 +16,8 @@
 
 package org.springframework.beans.factory.config;
 
-import static org.easymock.EasyMock.*;
 import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
 import static org.springframework.beans.factory.support.BeanDefinitionBuilder.genericBeanDefinition;
 
 import org.junit.Before;
@@ -269,17 +269,13 @@ public final class ServiceLocatorFactoryBeanTests {
 
 	@Test
 	public void testRequiresListableBeanFactoryAndChokesOnAnythingElse() throws Exception {
-		final BeanFactory beanFactory = createMock(BeanFactory.class);
-		replay(beanFactory);
-
+		BeanFactory beanFactory = mock(BeanFactory.class);
 		try {
 			ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
 			factory.setBeanFactory(beanFactory);
 		} catch (FatalBeanException ex) {
 			// expected
 		}
-
-		verify(beanFactory);
 	}
 
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests-context.xml
index f6f4f4a0a23..1c1978456ca 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests-context.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests-context.xml
@@ -5,6 +5,6 @@
 	     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
 
-	
+	
 
 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests.java
index 14b272ee0f0..0a561dd3360 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/SimpleScopeTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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,7 +17,7 @@
 package org.springframework.beans.factory.config;
 
 import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import java.util.LinkedList;
 import java.util.List;
@@ -28,8 +28,8 @@ import org.springframework.beans.factory.ObjectFactory;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.TestBean;
 
 /**
  * Simple test to illustrate and verify scope usage.
@@ -53,6 +53,7 @@ public final class SimpleScopeTests {
 				objects.add(new TestBean());
 				objects.add(new TestBean());
 			}
+			@Override
 			public Object get(String name, ObjectFactory objectFactory) {
 				if (index >= objects.size()) {
 					index = 0;
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/TestTypes.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/TestTypes.java
index 5460f8bd016..e9ff4c6a315 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/TestTypes.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/TestTypes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -30,21 +30,26 @@ final class TestTypes {}
  */
 class NoOpScope implements Scope {
 
+	@Override
 	public Object get(String name, ObjectFactory objectFactory) {
 		throw new UnsupportedOperationException();
 	}
 
+	@Override
 	public Object remove(String name) {
 		throw new UnsupportedOperationException();
 	}
 
+	@Override
 	public void registerDestructionCallback(String name, Runnable callback) {
 	}
 
+	@Override
 	public Object resolveContextualObject(String key) {
 		return null;
 	}
 
+	@Override
 	public String getConversationId() {
 		return null;
 	}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests-context.xml
index d0c52278445..c2cc486e9da 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests-context.xml
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests-context.xml
@@ -6,7 +6,7 @@
 
 	
 
-	
+	
 		
 			
 				
@@ -14,9 +14,9 @@
 		
 	
 
-	
+	
 		
-			
+			
 				
 				    
 				        
@@ -26,5 +26,5 @@
 		
 	
 
-	
+	
 
\ No newline at end of file
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java
index d5e4441f20e..20bdd506544 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 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,7 +17,7 @@
 package org.springframework.beans.factory.parsing;
 
 import static org.junit.Assert.*;
-import static test.util.TestResourceUtils.qualifiedResource;
+import static org.springframework.tests.TestResourceUtils.qualifiedResource;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -27,8 +27,8 @@ import org.junit.Test;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.core.io.Resource;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.TestBean;
 
 /**
  * @author Rob Harrop
@@ -71,10 +71,12 @@ public final class CustomProblemReporterTests {
 		private List warnings = new ArrayList();
 
 
+		@Override
 		public void fatal(Problem problem) {
 			throw new BeanDefinitionParsingException(problem);
 		}
 
+		@Override
 		public void error(Problem problem) {
 			System.out.println(problem);
 			this.errors.add(problem);
@@ -84,6 +86,7 @@ public final class CustomProblemReporterTests {
 			return this.errors.toArray(new Problem[this.errors.size()]);
 		}
 
+		@Override
 		public void warning(Problem problem) {
 			System.out.println(problem);
 			this.warnings.add(problem);
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
index 3ebe8ec705a..622b7fda5d3 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -16,7 +16,10 @@
 
 package org.springframework.beans.factory.parsing;
 
-import static org.easymock.EasyMock.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.isA;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 
 import org.apache.commons.logging.Log;
 import org.junit.Test;
@@ -41,15 +44,13 @@ public final class FailFastProblemReporterTests {
 		Problem problem = new Problem("VGER", new Location(new DescriptiveResource("here")),
 				null, new IllegalArgumentException());
 
-		Log log = createMock(Log.class);
-		log.warn(anyObject(), isA(IllegalArgumentException.class));
-		replay(log);
+		Log log = mock(Log.class);
 
 		FailFastProblemReporter reporter = new FailFastProblemReporter();
 		reporter.setLogger(log);
 		reporter.warning(problem);
 
-		verify(log);
+		verify(log).warn(any(), isA(IllegalArgumentException.class));
 	}
 
 }
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractorTests.java
index 56b9b1fbc64..fe85b49123f 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractorTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionBuilderTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionBuilderTests.java
index 6eecc322e84..48bd97d15b1 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionBuilderTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionBuilderTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -20,7 +20,9 @@ import java.util.Arrays;
 
 import junit.framework.TestCase;
 
-import test.beans.TestBean;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.tests.sample.beans.TestBean;
+
 
 /**
  * @author Rod Johnson
@@ -31,7 +33,8 @@ public class BeanDefinitionBuilderTests extends TestCase {
 	public void testBeanClassWithSimpleProperty() {
 		String[] dependsOn = new String[] { "A", "B", "C" };
 		BeanDefinitionBuilder bdb = BeanDefinitionBuilder.rootBeanDefinition(TestBean.class);
-		bdb.setSingleton(false).addPropertyReference("age", "15");
+		bdb.setScope(BeanDefinition.SCOPE_PROTOTYPE);
+		bdb.addPropertyReference("age", "15");
 		for (int i = 0; i < dependsOn.length; i++) {
 			bdb.addDependsOn(dependsOn[i]);
 		}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionTests.java
index cb365b39fda..11aed3fa64c 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanDefinitionTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -18,9 +18,10 @@ package org.springframework.beans.factory.support;
 
 import junit.framework.TestCase;
 
+import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.tests.sample.beans.TestBean;
 
-import test.beans.TestBean;
 
 /**
  * @author Juergen Hoeller
@@ -120,10 +121,11 @@ public class BeanDefinitionTests extends TestCase {
 		bd.getPropertyValues().add("name", "myName");
 		bd.getPropertyValues().add("age", "99");
 
-		ChildBeanDefinition childBd = new ChildBeanDefinition("bd");
+		GenericBeanDefinition childBd = new GenericBeanDefinition();
+		childBd.setParentName("bd");
 
 		RootBeanDefinition mergedBd = new RootBeanDefinition(bd);
-		mergedBd.overrideFrom(childBd);
+		mergedBd.overrideFrom((BeanDefinition) childBd);
 		assertEquals(2, mergedBd.getConstructorArgumentValues().getArgumentCount());
 		assertEquals(2, mergedBd.getPropertyValues().size());
 		assertEquals(bd, mergedBd);
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
index f01cc9b303f..cab03e38239 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,6 +16,13 @@
 
 package org.springframework.beans.factory.support;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -28,22 +35,25 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import static org.junit.Assert.*;
-
-import org.easymock.EasyMock;
 import org.junit.Test;
-import test.beans.GenericBean;
-import test.beans.GenericIntegerBean;
-import test.beans.GenericSetOfIntegerBean;
-import test.beans.TestBean;
-
+import org.mockito.Mockito;
 import org.springframework.beans.PropertyEditorRegistrar;
 import org.springframework.beans.PropertyEditorRegistry;
 import org.springframework.beans.factory.BeanCreationException;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.beans.propertyeditors.CustomNumberEditor;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.UrlResource;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+import org.springframework.tests.sample.beans.GenericBean;
+import org.springframework.tests.sample.beans.GenericIntegerBean;
+import org.springframework.tests.sample.beans.GenericSetOfIntegerBean;
+import org.springframework.tests.sample.beans.TestBean;
+
 
 /**
  * @author Juergen Hoeller
@@ -93,7 +103,8 @@ public class BeanFactoryGenericsTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericIntegerBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericIntegerBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("genericBean");
 
@@ -125,7 +136,8 @@ public class BeanFactoryGenericsTests {
 	public void testGenericListPropertyWithOptionalAutowiring() throws MalformedURLException {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericBean gb = (GenericBean) bf.getBean("genericBean");
 
@@ -151,7 +163,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericListOfArraysProperty() throws MalformedURLException {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		GenericBean gb = (GenericBean) bf.getBean("listOfArrays");
 
 		assertEquals(1, gb.getListOfArrays().size());
@@ -185,7 +199,8 @@ public class BeanFactoryGenericsTests {
 		bf.registerSingleton("integer1", new Integer(4));
 		bf.registerSingleton("integer2", new Integer(5));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericBean gb = (GenericBean) bf.getBean("genericBean");
 
@@ -197,7 +212,8 @@ public class BeanFactoryGenericsTests {
 	public void testGenericSetConstructorWithOptionalAutowiring() {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericBean gb = (GenericBean) bf.getBean("genericBean");
 
@@ -235,7 +251,8 @@ public class BeanFactoryGenericsTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericBean gb = (GenericBean) bf.getBean("genericBean");
 
@@ -251,7 +268,8 @@ public class BeanFactoryGenericsTests {
 		bf.registerSingleton("resource1", new UrlResource("http://localhost:8080"));
 		bf.registerSingleton("resource2", new UrlResource("http://localhost:9090"));
 
-		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class, RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
+		RootBeanDefinition rbd = new RootBeanDefinition(GenericBean.class);
+		rbd.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
 		bf.registerBeanDefinition("genericBean", rbd);
 		GenericBean gb = (GenericBean) bf.getBean("genericBean");
 
@@ -391,6 +409,7 @@ public class BeanFactoryGenericsTests {
 	public void testGenericMapWithCollectionValueConstructor() throws MalformedURLException {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 		bf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+			@Override
 			public void registerCustomEditors(PropertyEditorRegistry registry) {
 				registry.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
 			}
@@ -547,6 +566,7 @@ public class BeanFactoryGenericsTests {
 	public void testGenericMapWithCollectionValueFactoryMethod() throws MalformedURLException {
 		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 		bf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+			@Override
 			public void registerCustomEditors(PropertyEditorRegistry registry) {
 				registry.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
 			}
@@ -573,7 +593,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericListBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		List list = (List) bf.getBean("list");
 		assertEquals(1, list.size());
 		assertEquals(new URL("http://localhost:8080"), list.get(0));
@@ -581,7 +603,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericSetBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		Set set = (Set) bf.getBean("set");
 		assertEquals(1, set.size());
 		assertEquals(new URL("http://localhost:8080"), set.iterator().next());
@@ -589,7 +613,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericMapBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		Map map = (Map) bf.getBean("map");
 		assertEquals(1, map.size());
 		assertEquals(new Integer(10), map.keySet().iterator().next());
@@ -598,7 +624,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericallyTypedIntegerBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		GenericIntegerBean gb = (GenericIntegerBean) bf.getBean("integerBean");
 		assertEquals(new Integer(10), gb.getGenericProperty());
 		assertEquals(new Integer(20), gb.getGenericListProperty().get(0));
@@ -607,7 +635,9 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testGenericallyTypedSetOfIntegerBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		GenericSetOfIntegerBean gb = (GenericSetOfIntegerBean) bf.getBean("setOfIntegerBean");
 		assertEquals(new Integer(10), gb.getGenericProperty().iterator().next());
 		assertEquals(new Integer(20), gb.getGenericListProperty().get(0).iterator().next());
@@ -616,7 +646,11 @@ public class BeanFactoryGenericsTests {
 
 	@Test
 	public void testSetBean() throws Exception {
-		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass()));
+		Assume.group(TestGroup.LONG_RUNNING);
+
+		DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
+		new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
+				new ClassPathResource("genericBeanTests.xml", getClass()));
 		UrlSet us = (UrlSet) bf.getBean("setBean");
 		assertEquals(1, us.size());
 		assertEquals(new URL("http://www.springframework.org"), us.iterator().next());
@@ -624,10 +658,10 @@ public class BeanFactoryGenericsTests {
 
 	/**
 	 * Tests support for parameterized {@code factory-method} declarations such
-	 * as EasyMock's {@code createMock()} method which has the following signature.
+	 * as Mockito {@code mock()} method which has the following signature.
 	 *
 	 * 
{@code
-	 * public static  T createMock(Class toMock)
+	 * public static  T mock(Class classToMock)
 	 * }
* * See SPR-9493 @@ -635,12 +669,12 @@ public class BeanFactoryGenericsTests { */ @Test public void parameterizedFactoryMethod() { - RootBeanDefinition rbd = new RootBeanDefinition(EasyMock.class); - rbd.setFactoryMethodName("createMock"); + RootBeanDefinition rbd = new RootBeanDefinition(Mockito.class); + rbd.setFactoryMethodName("mock"); rbd.getConstructorArgumentValues().addGenericArgumentValue(Runnable.class); DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); - bf.registerBeanDefinition("easyMock", rbd); + bf.registerBeanDefinition("mock", rbd); Map beans = bf.getBeansOfType(Runnable.class); assertEquals(1, beans.size()); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/DefinitionMetadataEqualsHashCodeTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/DefinitionMetadataEqualsHashCodeTests.java index e0f0875403e..f9f1beba04a 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/DefinitionMetadataEqualsHashCodeTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/DefinitionMetadataEqualsHashCodeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -20,8 +20,8 @@ import junit.framework.TestCase; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Rob Harrop diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java index 36745a65c08..ee00efdec97 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java index 22dbf41ba35..22972e96fd1 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReaderTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReaderTests.java index 3442e720d4c..d62e43d0601 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReaderTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -18,8 +18,8 @@ package org.springframework.beans.factory.support; import junit.framework.TestCase; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Rob Harrop @@ -30,6 +30,7 @@ public class PropertiesBeanDefinitionReaderTests extends TestCase { private PropertiesBeanDefinitionReader reader; + @Override protected void setUp() throws Exception { this.beanFactory = new DefaultListableBeanFactory(); this.reader = new PropertiesBeanDefinitionReader(beanFactory); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java index 72a90473e2b..195ad775290 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java index 0cd040b4695..5c1368c4610 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/Spr8954Tests.java @@ -61,14 +61,17 @@ public class Spr8954Tests { static class FooFactoryBean implements FactoryBean, AnInterface { + @Override public Foo getObject() throws Exception { return new Foo(); } + @Override public Class getObjectType() { return Foo.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml b/spring-beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml index 6c9d11f210a..3e9a6577b55 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml @@ -3,7 +3,7 @@ - + @@ -43,7 +43,7 @@ autowire="constructor"> - + @@ -53,7 +53,7 @@ - + diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java index cac02472cab..65e380d3e2e 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java @@ -16,11 +16,11 @@ package org.springframework.beans.factory.support.security; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.fail; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.lang.reflect.Method; import java.net.URL; @@ -56,7 +56,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.SecurityContextProvider; import org.springframework.beans.factory.support.security.support.ConstructorBean; import org.springframework.beans.factory.support.security.support.CustomCallbackBean; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; @@ -72,7 +72,7 @@ import org.springframework.core.io.Resource; */ public class CallbacksSecurityTests { - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; private SecurityContextProvider provider; private static class NonPrivilegedBean { @@ -129,23 +129,28 @@ public class CallbacksSecurityTests { checkCurrentContext(); } + @Override public void afterPropertiesSet() { checkCurrentContext(); } + @Override public void destroy() { checkCurrentContext(); destroyed = true; } + @Override public void setBeanName(String name) { checkCurrentContext(); } + @Override public void setBeanClassLoader(ClassLoader classLoader) { checkCurrentContext(); } + @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { checkCurrentContext(); @@ -164,26 +169,31 @@ public class CallbacksSecurityTests { checkCurrentContext(); } + @Override public boolean isEagerInit() { checkCurrentContext(); return false; } + @Override public boolean isPrototype() { checkCurrentContext(); return true; } + @Override public Object getObject() throws Exception { checkCurrentContext(); return new Object(); } + @Override public Class getObjectType() { checkCurrentContext(); return Object.class; } + @Override public boolean isSingleton() { checkCurrentContext(); return false; @@ -219,6 +229,7 @@ public class CallbacksSecurityTests { return AccessController.doPrivileged(new PrivilegedAction() { + @Override public String run() { Subject subject = Subject.getSubject(acc); if (subject == null) { @@ -246,6 +257,7 @@ public class CallbacksSecurityTests { this.name = name; } + @Override public String getName() { return this.name; } @@ -291,6 +303,7 @@ public class CallbacksSecurityTests { private final AccessControlContext acc = new AccessControlContext( new ProtectionDomain[] { empty }); + @Override public AccessControlContext getAccessControlContext() { return acc; } @@ -299,7 +312,8 @@ public class CallbacksSecurityTests { DefaultResourceLoader drl = new DefaultResourceLoader(); Resource config = drl .getResource("/org/springframework/beans/factory/support/security/callbacks.xml"); - beanFactory = new XmlBeanFactory(config); + beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions(config); beanFactory.setSecurityContextProvider(provider); } @@ -320,6 +334,7 @@ public class CallbacksSecurityTests { try { AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override public Object run() throws Exception { method.invoke(bean); return null; @@ -334,6 +349,7 @@ public class CallbacksSecurityTests { AccessController.doPrivileged( new PrivilegedExceptionAction() { + @Override public Object run() throws Exception { return cl.newInstance(); } @@ -444,6 +460,7 @@ public class CallbacksSecurityTests { AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override public Object run() throws Exception { beanFactory.getBean("working-factory-method"); beanFactory.getBean("container-execution"); @@ -478,6 +495,7 @@ public class CallbacksSecurityTests { NonPrivilegedBean bean = Subject.doAsPrivileged( subject, new PrivilegedAction() { + @Override public NonPrivilegedBean run() { return lbf.getBean("test", NonPrivilegedBean.class); } @@ -502,6 +520,7 @@ public class CallbacksSecurityTests { // request the beans from non-privileged code Subject.doAsPrivileged(subject, new PrivilegedAction() { + @Override public Object run() { // sanity check assertEquals("user1", getCurrentSubjectName()); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/ConstructorBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/ConstructorBean.java index 1d07565be64..0b65929fdd3 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/ConstructorBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/ConstructorBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomCallbackBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomCallbackBean.java index 0091998af75..cf72ae3a95b 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomCallbackBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomCallbackBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomFactoryBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomFactoryBean.java index 12f80e38b72..4df91dc1360 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomFactoryBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/CustomFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -24,15 +24,18 @@ import org.springframework.beans.factory.FactoryBean; */ public class CustomFactoryBean implements FactoryBean { + @Override public Object getObject() throws Exception { return System.getProperties(); } + @Override public Class getObjectType() { System.setProperty("factory.object.type", "true"); return Properties.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/DestroyBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/DestroyBean.java index b429cd8e4b7..41bc80b8ab8 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/DestroyBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/DestroyBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ import org.springframework.beans.factory.DisposableBean; */ public class DestroyBean implements DisposableBean { + @Override public void destroy() throws Exception { System.setProperty("security.destroy", "true"); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/FactoryBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/FactoryBean.java index f648206980e..87a4ec27fcb 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/FactoryBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/FactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/InitBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/InitBean.java index 62f379ee8b5..2c371011e36 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/InitBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/InitBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ import org.springframework.beans.factory.InitializingBean; */ public class InitBean implements InitializingBean { + @Override public void afterPropertiesSet() throws Exception { System.getProperties(); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/PropertyBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/PropertyBean.java index cf51e1cdd02..22131ab9adc 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/PropertyBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/support/PropertyBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java index 2a72cde7010..625e8c7085e 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,14 +16,16 @@ package org.springframework.beans.factory.wiring; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import junit.framework.TestCase; -import org.easymock.MockControl; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Rick Evans @@ -32,31 +34,24 @@ import test.beans.TestBean; public class BeanConfigurerSupportTests extends TestCase { public void testSupplyIncompatibleBeanFactoryImplementation() throws Exception { - MockControl mock = MockControl.createControl(BeanFactory.class); - mock.replay(); try { - new StubBeanConfigurerSupport().setBeanFactory((BeanFactory) mock.getMock()); + new StubBeanConfigurerSupport().setBeanFactory(mock(BeanFactory.class)); fail("Must have thrown an IllegalArgumentException by this point (incompatible BeanFactory implementation supplied)"); } catch (IllegalArgumentException expected) { } - mock.verify(); } public void testConfigureBeanDoesNothingIfBeanWiringInfoResolverResolvesToNull() throws Exception { TestBean beanInstance = new TestBean(); - MockControl mock = MockControl.createControl(BeanWiringInfoResolver.class); - BeanWiringInfoResolver resolver = (BeanWiringInfoResolver) mock.getMock(); - resolver.resolveWiringInfo(beanInstance); - mock.setReturnValue(null); - mock.replay(); + BeanWiringInfoResolver resolver = mock(BeanWiringInfoResolver.class); BeanConfigurerSupport configurer = new StubBeanConfigurerSupport(); configurer.setBeanWiringInfoResolver(resolver); configurer.setBeanFactory(new DefaultListableBeanFactory()); configurer.configureBean(beanInstance); - mock.verify(); + verify(resolver).resolveWiringInfo(beanInstance); assertNull(beanInstance.getName()); } @@ -91,19 +86,14 @@ public class BeanConfigurerSupportTests extends TestCase { DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); factory.registerBeanDefinition("spouse", builder.getBeanDefinition()); - MockControl mock = MockControl.createControl(BeanWiringInfoResolver.class); - BeanWiringInfoResolver resolver = (BeanWiringInfoResolver) mock.getMock(); - resolver.resolveWiringInfo(beanInstance); - mock.setReturnValue(new BeanWiringInfo(BeanWiringInfo.AUTOWIRE_BY_NAME, false)); - mock.replay(); + BeanWiringInfoResolver resolver = mock(BeanWiringInfoResolver.class); + given(resolver.resolveWiringInfo(beanInstance)).willReturn(new BeanWiringInfo(BeanWiringInfo.AUTOWIRE_BY_NAME, false)); BeanConfigurerSupport configurer = new StubBeanConfigurerSupport(); configurer.setBeanFactory(factory); configurer.setBeanWiringInfoResolver(resolver); configurer.configureBean(beanInstance); assertEquals("Bean is evidently not being configured (for some reason)", "David Gavurin", beanInstance.getSpouse().getName()); - - mock.verify(); } public void testConfigureBeanPerformsAutowiringByTypeIfAppropriateBeanWiringInfoResolverIsPluggedIn() throws Exception { @@ -115,19 +105,14 @@ public class BeanConfigurerSupportTests extends TestCase { DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); factory.registerBeanDefinition("Mmm, I fancy a salad!", builder.getBeanDefinition()); - MockControl mock = MockControl.createControl(BeanWiringInfoResolver.class); - BeanWiringInfoResolver resolver = (BeanWiringInfoResolver) mock.getMock(); - resolver.resolveWiringInfo(beanInstance); - mock.setReturnValue(new BeanWiringInfo(BeanWiringInfo.AUTOWIRE_BY_TYPE, false)); - mock.replay(); + BeanWiringInfoResolver resolver = mock(BeanWiringInfoResolver.class); + given(resolver.resolveWiringInfo(beanInstance)).willReturn(new BeanWiringInfo(BeanWiringInfo.AUTOWIRE_BY_TYPE, false)); BeanConfigurerSupport configurer = new StubBeanConfigurerSupport(); configurer.setBeanFactory(factory); configurer.setBeanWiringInfoResolver(resolver); configurer.configureBean(beanInstance); assertEquals("Bean is evidently not being configured (for some reason)", "David Gavurin", beanInstance.getSpouse().getName()); - - mock.verify(); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractBeanFactoryTests.java index eba0541e09d..4510487801a 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,6 @@ import java.beans.PropertyEditorSupport; import java.util.StringTokenizer; import junit.framework.TestCase; -import junit.framework.Assert; import org.springframework.beans.BeansException; import org.springframework.beans.PropertyBatchUpdateException; @@ -28,13 +27,13 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanIsNotAFactoryException; import org.springframework.beans.factory.BeanNotOfRequiredTypeException; -import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.tests.sample.beans.LifecycleBean; +import org.springframework.tests.sample.beans.MustBeInitialized; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; -import test.beans.DummyFactory; -import test.beans.LifecycleBean; -import test.beans.TestBean; /** * Subclasses must implement setUp() to initialize bean factory @@ -88,7 +87,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase { */ public void testLifecycleCallbacks() { LifecycleBean lb = (LifecycleBean) getBeanFactory().getBean("lifecycle"); - Assert.assertEquals("lifecycle", lb.getBeanName()); + assertEquals("lifecycle", lb.getBeanName()); // The dummy business method will throw an exception if the // necessary callbacks weren't invoked in the right order. lb.businessMethod(); @@ -326,6 +325,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase { public static class TestBeanEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) { TestBean tb = new TestBean(); StringTokenizer st = new StringTokenizer(text, "_"); @@ -336,31 +336,3 @@ public abstract class AbstractBeanFactoryTests extends TestCase { } } - - -/** - * Simple test of BeanFactory initialization - * @author Rod Johnson - * @since 12.03.2003 - */ -class MustBeInitialized implements InitializingBean { - - private boolean inited; - - /** - * @see InitializingBean#afterPropertiesSet() - */ - public void afterPropertiesSet() throws Exception { - this.inited = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited) - throw new RuntimeException("Factory didn't call afterPropertiesSet() on MustBeInitialized object"); - } - -} \ No newline at end of file diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractListableBeanFactoryTests.java index 403b4735bbc..4c1ac580bb9 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractListableBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractListableBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -19,10 +19,8 @@ package org.springframework.beans.factory.xml; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.tests.sample.beans.TestBean; -import junit.framework.Assert; - -import test.beans.TestBean; /** * @author Rod Johnson @@ -48,24 +46,24 @@ public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFacto protected final void assertCount(int count) { String[] defnames = getListableBeanFactory().getBeanDefinitionNames(); - Assert.assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count); + assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count); } public void assertTestBeanCount(int count) { String[] defNames = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, false); - Assert.assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " + + assertTrue("We should have " + count + " beans for class org.springframework.tests.sample.beans.TestBean, not " + defNames.length, defNames.length == count); int countIncludingFactoryBeans = count + 2; String[] names = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, true); - Assert.assertTrue("We should have " + countIncludingFactoryBeans + - " beans for class org.springframework.beans.TestBean, not " + names.length, + assertTrue("We should have " + countIncludingFactoryBeans + + " beans for class org.springframework.tests.sample.beans.TestBean, not " + names.length, names.length == countIncludingFactoryBeans); } public void testGetDefinitionsForNoSuchClass() { String[] defnames = getListableBeanFactory().getBeanNamesForType(String.class); - Assert.assertTrue("No string definitions", defnames.length == 0); + assertTrue("No string definitions", defnames.length == 0); } /** @@ -73,18 +71,18 @@ public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFacto * what type factories may return, and it may even change over time.) */ public void testGetCountForFactoryClass() { - Assert.assertTrue("Should have 2 factories, not " + + assertTrue("Should have 2 factories, not " + getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - Assert.assertTrue("Should have 2 factories, not " + + assertTrue("Should have 2 factories, not " + getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); } public void testContainsBeanDefinition() { - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("rod")); - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("roderick")); + assertTrue(getListableBeanFactory().containsBeanDefinition("rod")); + assertTrue(getListableBeanFactory().containsBeanDefinition("roderick")); } -} \ No newline at end of file +} diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AutowireWithExclusionTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AutowireWithExclusionTests.java index 7c979316666..ae6232f40ff 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/AutowireWithExclusionTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/AutowireWithExclusionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,15 +16,15 @@ package org.springframework.beans.factory.xml; -import junit.framework.Assert; import junit.framework.TestCase; -import test.beans.TestBean; import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; + /** * @author Rob Harrop @@ -34,43 +34,45 @@ public class AutowireWithExclusionTests extends TestCase { public void testByTypeAutowireWithAutoSelfExclusion() throws Exception { CountingFactory.reset(); - XmlBeanFactory beanFactory = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-with-exclusion.xml"); beanFactory.preInstantiateSingletons(); TestBean rob = (TestBean) beanFactory.getBean("rob"); TestBean sally = (TestBean) beanFactory.getBean("sally"); assertEquals(sally, rob.getSpouse()); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithExclusion() throws Exception { CountingFactory.reset(); - XmlBeanFactory beanFactory = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-with-exclusion.xml"); beanFactory.preInstantiateSingletons(); TestBean rob = (TestBean) beanFactory.getBean("rob"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithExclusionInParentFactory() throws Exception { CountingFactory.reset(); - XmlBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); parent.preInstantiateSingletons(); DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); - RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE); + RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class); + robDef.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE); robDef.getPropertyValues().add("spouse", new RuntimeBeanReference("sally")); child.registerBeanDefinition("rob2", robDef); TestBean rob = (TestBean) child.getBean("rob2"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithPrimaryInParentFactory() throws Exception { CountingFactory.reset(); - XmlBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); parent.getBeanDefinition("props1").setPrimary(true); parent.preInstantiateSingletons(); DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); - RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE); + RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class); + robDef.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE); robDef.getPropertyValues().add("spouse", new RuntimeBeanReference("sally")); child.registerBeanDefinition("rob2", robDef); RootBeanDefinition propsDef = new RootBeanDefinition(PropertiesFactoryBean.class); @@ -78,15 +80,16 @@ public class AutowireWithExclusionTests extends TestCase { child.registerBeanDefinition("props3", propsDef); TestBean rob = (TestBean) child.getBean("rob2"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithPrimaryOverridingParentFactory() throws Exception { CountingFactory.reset(); - XmlBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); parent.preInstantiateSingletons(); DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); - RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE); + RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class); + robDef.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE); robDef.getPropertyValues().add("spouse", new RuntimeBeanReference("sally")); child.registerBeanDefinition("rob2", robDef); RootBeanDefinition propsDef = new RootBeanDefinition(PropertiesFactoryBean.class); @@ -95,16 +98,17 @@ public class AutowireWithExclusionTests extends TestCase { child.registerBeanDefinition("props3", propsDef); TestBean rob = (TestBean) child.getBean("rob2"); assertEquals("props3", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithPrimaryInParentAndChild() throws Exception { CountingFactory.reset(); - XmlBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); + DefaultListableBeanFactory parent = getBeanFactory("autowire-with-exclusion.xml"); parent.getBeanDefinition("props1").setPrimary(true); parent.preInstantiateSingletons(); DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); - RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE); + RootBeanDefinition robDef = new RootBeanDefinition(TestBean.class); + robDef.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE); robDef.getPropertyValues().add("spouse", new RuntimeBeanReference("sally")); child.registerBeanDefinition("rob2", robDef); RootBeanDefinition propsDef = new RootBeanDefinition(PropertiesFactoryBean.class); @@ -113,29 +117,29 @@ public class AutowireWithExclusionTests extends TestCase { child.registerBeanDefinition("props3", propsDef); TestBean rob = (TestBean) child.getBean("rob2"); assertEquals("props3", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithInclusion() throws Exception { CountingFactory.reset(); - XmlBeanFactory beanFactory = getBeanFactory("autowire-with-inclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-with-inclusion.xml"); beanFactory.preInstantiateSingletons(); TestBean rob = (TestBean) beanFactory.getBean("rob"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testByTypeAutowireWithSelectiveInclusion() throws Exception { CountingFactory.reset(); - XmlBeanFactory beanFactory = getBeanFactory("autowire-with-selective-inclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-with-selective-inclusion.xml"); beanFactory.preInstantiateSingletons(); TestBean rob = (TestBean) beanFactory.getBean("rob"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); - Assert.assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); + assertEquals(1, CountingFactory.getFactoryBeanInstanceCount()); } public void testConstructorAutowireWithAutoSelfExclusion() throws Exception { - XmlBeanFactory beanFactory = getBeanFactory("autowire-constructor-with-exclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-constructor-with-exclusion.xml"); TestBean rob = (TestBean) beanFactory.getBean("rob"); TestBean sally = (TestBean) beanFactory.getBean("sally"); assertEquals(sally, rob.getSpouse()); @@ -147,13 +151,16 @@ public class AutowireWithExclusionTests extends TestCase { } public void testConstructorAutowireWithExclusion() throws Exception { - XmlBeanFactory beanFactory = getBeanFactory("autowire-constructor-with-exclusion.xml"); + DefaultListableBeanFactory beanFactory = getBeanFactory("autowire-constructor-with-exclusion.xml"); TestBean rob = (TestBean) beanFactory.getBean("rob"); assertEquals("props1", rob.getSomeProperties().getProperty("name")); } - private XmlBeanFactory getBeanFactory(String configPath) { - return new XmlBeanFactory(new ClassPathResource(configPath, getClass())); + private DefaultListableBeanFactory getBeanFactory(String configPath) { + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + new ClassPathResource(configPath, getClass())); + return bf; } } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/BeanNameGenerationTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/BeanNameGenerationTests.java index 32e6134823d..cfe24570a3e 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/BeanNameGenerationTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/BeanNameGenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -30,6 +30,7 @@ public class BeanNameGenerationTests extends TestCase { private DefaultListableBeanFactory beanFactory; + @Override public void setUp() { this.beanFactory = new DefaultListableBeanFactory(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionMergingTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionMergingTests.java index 55f7f920f5c..a9294e05fd1 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionMergingTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionMergingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -27,8 +27,8 @@ import junit.framework.TestCase; import org.springframework.beans.factory.support.BeanDefinitionReader; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * Unit and integration tests for the collection merging support. @@ -40,6 +40,7 @@ public class CollectionMergingTests extends TestCase { private DefaultListableBeanFactory beanFactory; + @Override protected void setUp() throws Exception { this.beanFactory = new DefaultListableBeanFactory(); BeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionsWithDefaultTypesTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionsWithDefaultTypesTests.java index 0f3be3b0067..3a88ab9fa8f 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionsWithDefaultTypesTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectionsWithDefaultTypesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,14 +16,17 @@ package org.springframework.beans.factory.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.util.List; import java.util.Map; -import static org.junit.Assert.*; import org.junit.Test; -import test.beans.TestBean; - +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; + /** * @author Rob Harrop @@ -31,10 +34,12 @@ import org.springframework.core.io.ClassPathResource; */ public class CollectionsWithDefaultTypesTests { - private final XmlBeanFactory beanFactory; + private final DefaultListableBeanFactory beanFactory; public CollectionsWithDefaultTypesTests() { - this.beanFactory = new XmlBeanFactory(new ClassPathResource("collectionsWithDefaultTypes.xml", getClass())); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions( + new ClassPathResource("collectionsWithDefaultTypes.xml", getClass())); } @Test diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ConstructorDependenciesBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ConstructorDependenciesBean.java index 8b7d179e9e3..082fc418b0e 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ConstructorDependenciesBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ConstructorDependenciesBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -18,8 +18,9 @@ package org.springframework.beans.factory.xml; import java.io.Serializable; -import test.beans.IndexedTestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.TestBean; + /** * Simple bean used to check constructor dependency checking. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CountingFactory.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CountingFactory.java index 27ea4461be4..7b02d0bed29 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CountingFactory.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/CountingFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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,8 +17,8 @@ package org.springframework.beans.factory.xml; import org.springframework.beans.factory.FactoryBean; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Juergen Hoeller @@ -51,14 +51,17 @@ public class CountingFactory implements FactoryBean { } + @Override public Object getObject() { return "myString"; } + @Override public Class getObjectType() { return String.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DefaultLifecycleMethodsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DefaultLifecycleMethodsTests.java index 8662e52c782..d79ff06cbb7 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DefaultLifecycleMethodsTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DefaultLifecycleMethodsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -18,6 +18,7 @@ package org.springframework.beans.factory.xml; import junit.framework.TestCase; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; /** @@ -25,10 +26,13 @@ import org.springframework.core.io.ClassPathResource; */ public class DefaultLifecycleMethodsTests extends TestCase { - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; + @Override protected void setUp() throws Exception { - this.beanFactory = new XmlBeanFactory(new ClassPathResource("defaultLifecycleMethods.xml", getClass())); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(new ClassPathResource( + "defaultLifecycleMethods.xml", getClass())); } public void testLifecycleMethodsInvoked() { @@ -48,7 +52,9 @@ public class DefaultLifecycleMethodsTests extends TestCase { public void testIgnoreDefaultLifecycleMethods() throws Exception { try { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("ignoreDefaultLifecycleMethods.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + new ClassPathResource("ignoreDefaultLifecycleMethods.xml", getClass())); bf.preInstantiateSingletons(); bf.destroySingletons(); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DelegatingEntityResolverTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DelegatingEntityResolverTests.java index ec52dfaa8c7..6b396933ae7 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DelegatingEntityResolverTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DelegatingEntityResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -45,6 +45,7 @@ public final class DelegatingEntityResolverTests { private static final class NoOpEntityResolver implements EntityResolver { + @Override public InputSource resolveEntity(String publicId, String systemId) { return null; } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DummyReferencer.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DummyReferencer.java index fbc40ca3025..a0d4f722e15 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DummyReferencer.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DummyReferencer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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,8 +17,8 @@ package org.springframework.beans.factory.xml; -import test.beans.DummyFactory; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; /** * @author Juergen Hoeller diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-multiLevel-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-multiLevel-context.xml index b897d98858a..8e53cee2934 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-multiLevel-context.xml +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-multiLevel-context.xml @@ -4,12 +4,12 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> - + - + diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-sameLevel-context.xml b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-sameLevel-context.xml index e8bf2b4469a..12a2fb08602 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-sameLevel-context.xml +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests-sameLevel-context.xml @@ -4,12 +4,12 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> - + - + diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java index bd2d8370384..bd92b0c3916 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/DuplicateBeanIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -23,8 +23,8 @@ import static org.junit.Assert.fail; import org.junit.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/EventPublicationTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/EventPublicationTests.java index a9e9925d512..ff691358a44 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/EventPublicationTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/EventPublicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -30,6 +30,7 @@ import org.springframework.beans.factory.parsing.ImportDefinition; import org.springframework.beans.factory.parsing.PassThroughSourceExtractor; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.beans.CollectingReaderEventListener; /** * @author Rob Harrop @@ -42,6 +43,7 @@ public class EventPublicationTests extends TestCase { private final CollectingReaderEventListener eventListener = new CollectingReaderEventListener(); + @Override protected void setUp() throws Exception { XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory); reader.setEventListener(this.eventListener); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethodTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethodTests.java index 696ab6c0afe..0d67448bc05 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethodTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -23,12 +23,12 @@ import java.util.Properties; import static org.junit.Assert.*; import org.junit.Test; -import test.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; /** * @author Juergen Hoeller diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java index 8ee4c39d633..a5ef87cb1f6 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,8 @@ package org.springframework.beans.factory.xml; import java.util.Collections; import java.util.List; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; + /** * Test class for Spring's ability to create objects using static diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/GeneratedNameBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/GeneratedNameBean.java index 52eb2b2938c..fdf65f88d71 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/GeneratedNameBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/GeneratedNameBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -27,6 +27,7 @@ public class GeneratedNameBean implements BeanNameAware { private GeneratedNameBean child; + @Override public void setBeanName(String beanName) { this.beanName = beanName; } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/InstanceFactory.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/InstanceFactory.java index 6e3f1df422b..6c8872054e1 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/InstanceFactory.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/InstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.beans.factory.xml; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Test class for Spring's ability to create objects using diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java index b943361f1a2..9a98ab4c150 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -20,6 +20,7 @@ import junit.framework.TestCase; import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; /** @@ -27,10 +28,13 @@ import org.springframework.core.io.ClassPathResource; */ public class MetadataAttachmentTests extends TestCase { - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; + @Override protected void setUp() throws Exception { - this.beanFactory = new XmlBeanFactory(new ClassPathResource("withMeta.xml", getClass())); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions( + new ClassPathResource("withMeta.xml", getClass())); } public void testMetadataAttachment() throws Exception { diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java index a6feaedcec6..5b9ddc18e66 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -25,8 +25,8 @@ import org.junit.Test; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * Tests for propagating enclosing beans element defaults to nested beans elements. diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java index bc4e58426fc..62c5962f86f 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProfileXmlBeanDefinitionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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,8 +21,8 @@ import static org.junit.Assert.assertThat; import org.hamcrest.Description; import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; import org.junit.Test; -import org.junit.internal.matchers.TypeSafeMatcher; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.env.ConfigurableEnvironment; @@ -171,6 +171,7 @@ public class ProfileXmlBeanDefinitionTests { private static Matcher containsBeanDefinition(final String beanName) { return new TypeSafeMatcher() { + @Override public void describeTo(Description desc) { desc.appendText("a BeanDefinitionRegistry containing bean named ") .appendValue(beanName); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProtectedLifecycleBean.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProtectedLifecycleBean.java index ed8167b1126..231ca93a3db 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProtectedLifecycleBean.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/ProtectedLifecycleBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -57,6 +57,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return initMethodDeclared; } + @Override public void setBeanName(String name) { this.beanName = name; } @@ -65,6 +66,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.owningFactory = beanFactory; } @@ -79,6 +81,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial this.postProcessedBeforeInit = true; } + @Override public void afterPropertiesSet() { if (this.owningFactory == null) { throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); @@ -130,6 +133,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial } } + @Override public void destroy() { if (this.destroyed) { throw new IllegalStateException("Already destroyed"); @@ -144,6 +148,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial public static class PostProcessor implements BeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { if (bean instanceof ProtectedLifecycleBean) { ((ProtectedLifecycleBean) bean).postProcessBeforeInit(); @@ -151,6 +156,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { if (bean instanceof ProtectedLifecycleBean) { ((ProtectedLifecycleBean) bean).postProcessAfterInit(); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java index 8344d0b5298..17552b1d591 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import org.xml.sax.SAXParseException; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Rob Harrop diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandlerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandlerTests.java index 173fe926421..601afa44fbe 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandlerTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -20,10 +20,11 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; import org.springframework.beans.factory.BeanDefinitionStoreException; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.DummyBean; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.DummyBean; -import test.beans.TestBean; /** * @author Costin Leau @@ -32,7 +33,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void simpleValue() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); String name = "simple"; // beanFactory.getBean("simple1", DummyBean.class); DummyBean nameValue = beanFactory.getBean(name, DummyBean.class); @@ -41,7 +42,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void simpleRef() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); String name = "simple-ref"; // beanFactory.getBean("name-value1", TestBean.class); DummyBean nameValue = beanFactory.getBean(name, DummyBean.class); @@ -50,7 +51,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void nameValue() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); String name = "name-value"; // beanFactory.getBean("name-value1", TestBean.class); TestBean nameValue = beanFactory.getBean(name, TestBean.class); @@ -60,7 +61,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void nameRef() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); TestBean nameValue = beanFactory.getBean("name-value", TestBean.class); DummyBean nameRef = beanFactory.getBean("name-ref", DummyBean.class); @@ -70,7 +71,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void typeIndexedValue() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); DummyBean typeRef = beanFactory.getBean("indexed-value", DummyBean.class); assertEquals("at", typeRef.getName()); @@ -80,7 +81,7 @@ public class SimpleConstructorNamespaceHandlerTests { @Test public void typeIndexedRef() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); DummyBean typeRef = beanFactory.getBean("indexed-ref", DummyBean.class); assertEquals("some-name", typeRef.getName()); @@ -89,20 +90,23 @@ public class SimpleConstructorNamespaceHandlerTests { @Test(expected = BeanDefinitionStoreException.class) public void ambiguousConstructor() throws Exception { - new XmlBeanFactory(new ClassPathResource("simpleConstructorNamespaceHandlerTestsWithErrors.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + new ClassPathResource("simpleConstructorNamespaceHandlerTestsWithErrors.xml", getClass())); } @Test public void constructorWithNameEndingInRef() throws Exception { - XmlBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); + DefaultListableBeanFactory beanFactory = createFactory("simpleConstructorNamespaceHandlerTests.xml"); DummyBean derivedBean = beanFactory.getBean("beanWithRefConstructorArg", DummyBean.class); assertEquals(10, derivedBean.getAge()); assertEquals("silly name", derivedBean.getName()); } - private XmlBeanFactory createFactory(String resourceName) { - XmlBeanFactory fact = new XmlBeanFactory(new ClassPathResource(resourceName, getClass())); - //fact.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer()); - return fact; + private DefaultListableBeanFactory createFactory(String resourceName) { + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions( + new ClassPathResource(resourceName, getClass())); + return bf; } -} \ No newline at end of file +} diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerTests.java index a7e543780d1..45e89564e72 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,12 +17,14 @@ package org.springframework.beans.factory.xml; import static org.junit.Assert.assertEquals; -import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.junit.Test; import org.springframework.beans.factory.BeanDefinitionStoreException; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; + /** * @author Rob Harrop @@ -33,8 +35,9 @@ public class SimplePropertyNamespaceHandlerTests { @Test public void simpleBeanConfigured() throws Exception { - XmlBeanFactory beanFactory = - new XmlBeanFactory(new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); + DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions( + new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); ITestBean rob = (TestBean) beanFactory.getBean("rob"); ITestBean sally = (TestBean) beanFactory.getBean("sally"); assertEquals("Rob Harrop", rob.getName()); @@ -44,8 +47,9 @@ public class SimplePropertyNamespaceHandlerTests { @Test public void innerBeanConfigured() throws Exception { - XmlBeanFactory beanFactory = - new XmlBeanFactory(new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); + DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions( + new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); TestBean sally = (TestBean) beanFactory.getBean("sally2"); ITestBean rob = sally.getSpouse(); assertEquals("Rob Harrop", rob.getName()); @@ -55,13 +59,16 @@ public class SimplePropertyNamespaceHandlerTests { @Test(expected = BeanDefinitionStoreException.class) public void withPropertyDefinedTwice() throws Exception { - new XmlBeanFactory(new ClassPathResource("simplePropertyNamespaceHandlerTestsWithErrors.xml", getClass())); + DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions( + new ClassPathResource("simplePropertyNamespaceHandlerTestsWithErrors.xml", getClass())); } @Test public void propertyWithNameEndingInRef() throws Exception { - XmlBeanFactory beanFactory = - new XmlBeanFactory(new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); + DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(beanFactory).loadBeanDefinitions( + new ClassPathResource("simplePropertyNamespaceHandlerTests.xml", getClass())); ITestBean sally = (TestBean) beanFactory.getBean("derivedSally"); assertEquals("r", sally.getSpouse().getName()); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/TestBeanCreator.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/TestBeanCreator.java index 07d8371b6f8..849da031cc3 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/TestBeanCreator.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/TestBeanCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.beans.factory.xml; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Test class for Spring's ability to create diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java index 3345bf52fb3..3bb04d4c593 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -25,8 +25,6 @@ import java.util.TreeMap; import java.util.Arrays; import junit.framework.TestCase; -import test.beans.CustomEnum; -import test.beans.TestBean; import org.springframework.beans.factory.config.FieldRetrievingFactoryBean; import org.springframework.beans.factory.config.PropertiesFactoryBean; @@ -34,6 +32,9 @@ import org.springframework.beans.factory.parsing.ComponentDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.beans.CollectingReaderEventListener; +import org.springframework.tests.sample.beans.CustomEnum; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rob Harrop @@ -46,6 +47,7 @@ public class UtilNamespaceHandlerTests extends TestCase { private CollectingReaderEventListener listener = new CollectingReaderEventListener(); + @Override public void setUp() { this.beanFactory = new DefaultListableBeanFactory(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanCollectionTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanCollectionTests.java index eacf97579e6..6960653ea6e 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanCollectionTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanCollectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,13 @@ package org.springframework.beans.factory.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; @@ -27,20 +33,18 @@ import java.util.Properties; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; -import java.util.IdentityHashMap; -import java.util.HashSet; -import java.util.concurrent.CopyOnWriteArraySet; import org.junit.Test; -import static org.junit.Assert.*; -import test.beans.TestBean; - import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.config.ListFactoryBean; import org.springframework.beans.factory.config.MapFactoryBean; import org.springframework.beans.factory.config.SetFactoryBean; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.HasMap; +import org.springframework.tests.sample.beans.TestBean; + /** * Tests for collections in XML bean definitions. @@ -51,10 +55,12 @@ import org.springframework.core.io.ClassPathResource; */ public class XmlBeanCollectionTests { - private final XmlBeanFactory beanFactory; + private final DefaultListableBeanFactory beanFactory; public XmlBeanCollectionTests() { - this.beanFactory = new XmlBeanFactory(new ClassPathResource("collections.xml", getClass())); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions( + new ClassPathResource("collections.xml", getClass())); } @Test @@ -445,94 +451,3 @@ public class XmlBeanCollectionTests { } } } - - -/** - * Bean exposing a map. Used for bean factory tests. - * - * @author Rod Johnson - * @since 05.06.2003 - */ -class HasMap { - - private Map map; - - private IdentityHashMap identityMap; - - private Set set; - - private CopyOnWriteArraySet concurrentSet; - - private Properties props; - - private Object[] objectArray; - - private Class[] classArray; - - private Integer[] intArray; - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public IdentityHashMap getIdentityMap() { - return identityMap; - } - - public void setIdentityMap(IdentityHashMap identityMap) { - this.identityMap = identityMap; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public CopyOnWriteArraySet getConcurrentSet() { - return concurrentSet; - } - - public void setConcurrentSet(CopyOnWriteArraySet concurrentSet) { - this.concurrentSet = concurrentSet; - } - - public Properties getProps() { - return props; - } - - public void setProps(Properties props) { - this.props = props; - } - - public Object[] getObjectArray() { - return objectArray; - } - - public void setObjectArray(Object[] objectArray) { - this.objectArray = objectArray; - } - - public Class[] getClassArray() { - return classArray; - } - - public void setClassArray(Class[] classArray) { - this.classArray = classArray; - } - - public Integer[] getIntegerArray() { - return intArray; - } - - public void setIntegerArray(Integer[] is) { - intArray = is; - } - -} diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReaderTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReaderTests.java index 49473c6dc59..c5da99f0e4c 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReaderTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -28,8 +28,8 @@ import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.Resource; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.TestBean; /** * @author Rick Evans diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlListableBeanFactoryTests.java index 22d4fcb30c2..2fd60f7a0e0 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlListableBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/XmlListableBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,8 +21,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import junit.framework.Assert; - import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.BeanFactory; @@ -30,11 +28,11 @@ import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.LifecycleBean; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; -import test.beans.DummyFactory; -import test.beans.ITestBean; -import test.beans.LifecycleBean; -import test.beans.TestBean; /** * @author Juergen Hoeller @@ -44,21 +42,27 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest private DefaultListableBeanFactory parent; - private XmlBeanFactory factory; + private DefaultListableBeanFactory factory; + @Override protected void setUp() { parent = new DefaultListableBeanFactory(); Map m = new HashMap(); m.put("name", "Albert"); - parent.registerBeanDefinition("father", - new RootBeanDefinition(TestBean.class, new MutablePropertyValues(m))); + RootBeanDefinition bd1 = new RootBeanDefinition(TestBean.class); + bd1.setPropertyValues(new MutablePropertyValues(m)); + parent.registerBeanDefinition("father", bd1); m = new HashMap(); m.put("name", "Roderick"); - parent.registerBeanDefinition("rod", - new RootBeanDefinition(TestBean.class, new MutablePropertyValues(m))); + RootBeanDefinition bd2 = new RootBeanDefinition(TestBean.class); + bd2.setPropertyValues(new MutablePropertyValues(m)); + parent.registerBeanDefinition("rod", bd2); - this.factory = new XmlBeanFactory(new ClassPathResource("test.xml", getClass()), parent); + this.factory = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(this.factory).loadBeanDefinitions( + new ClassPathResource("test.xml", getClass())); this.factory.addBeanPostProcessor(new BeanPostProcessor() { + @Override public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { if (bean instanceof TestBean) { ((TestBean) bean).setPostProcessed(true); @@ -68,6 +72,7 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest } return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { return bean; } @@ -77,10 +82,12 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest //this.factory.preInstantiateSingletons(); } + @Override protected BeanFactory getBeanFactory() { return factory; } + @Override public void testCount() { assertCount(24); } @@ -101,7 +108,7 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest public void testDescriptionButNoProperties() throws Exception { TestBean validEmpty = (TestBean) getBeanFactory().getBean("validEmptyWithDescription"); - Assert.assertEquals(0, validEmpty.getAge()); + assertEquals(0, validEmpty.getAge()); } /** @@ -112,94 +119,94 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest TestBean tb1 = (TestBean) getBeanFactory().getBean("aliased"); TestBean alias1 = (TestBean) getBeanFactory().getBean("myalias"); - Assert.assertTrue(tb1 == alias1); + assertTrue(tb1 == alias1); List tb1Aliases = Arrays.asList(getBeanFactory().getAliases("aliased")); - Assert.assertEquals(2, tb1Aliases.size()); - Assert.assertTrue(tb1Aliases.contains("myalias")); - Assert.assertTrue(tb1Aliases.contains("youralias")); - Assert.assertTrue(beanNames.contains("aliased")); - Assert.assertFalse(beanNames.contains("myalias")); - Assert.assertFalse(beanNames.contains("youralias")); + assertEquals(2, tb1Aliases.size()); + assertTrue(tb1Aliases.contains("myalias")); + assertTrue(tb1Aliases.contains("youralias")); + assertTrue(beanNames.contains("aliased")); + assertFalse(beanNames.contains("myalias")); + assertFalse(beanNames.contains("youralias")); TestBean tb2 = (TestBean) getBeanFactory().getBean("multiAliased"); TestBean alias2 = (TestBean) getBeanFactory().getBean("alias1"); TestBean alias3 = (TestBean) getBeanFactory().getBean("alias2"); TestBean alias3a = (TestBean) getBeanFactory().getBean("alias3"); TestBean alias3b = (TestBean) getBeanFactory().getBean("alias4"); - Assert.assertTrue(tb2 == alias2); - Assert.assertTrue(tb2 == alias3); - Assert.assertTrue(tb2 == alias3a); - Assert.assertTrue(tb2 == alias3b); + assertTrue(tb2 == alias2); + assertTrue(tb2 == alias3); + assertTrue(tb2 == alias3a); + assertTrue(tb2 == alias3b); List tb2Aliases = Arrays.asList(getBeanFactory().getAliases("multiAliased")); - Assert.assertEquals(4, tb2Aliases.size()); - Assert.assertTrue(tb2Aliases.contains("alias1")); - Assert.assertTrue(tb2Aliases.contains("alias2")); - Assert.assertTrue(tb2Aliases.contains("alias3")); - Assert.assertTrue(tb2Aliases.contains("alias4")); - Assert.assertTrue(beanNames.contains("multiAliased")); - Assert.assertFalse(beanNames.contains("alias1")); - Assert.assertFalse(beanNames.contains("alias2")); - Assert.assertFalse(beanNames.contains("alias3")); - Assert.assertFalse(beanNames.contains("alias4")); + assertEquals(4, tb2Aliases.size()); + assertTrue(tb2Aliases.contains("alias1")); + assertTrue(tb2Aliases.contains("alias2")); + assertTrue(tb2Aliases.contains("alias3")); + assertTrue(tb2Aliases.contains("alias4")); + assertTrue(beanNames.contains("multiAliased")); + assertFalse(beanNames.contains("alias1")); + assertFalse(beanNames.contains("alias2")); + assertFalse(beanNames.contains("alias3")); + assertFalse(beanNames.contains("alias4")); TestBean tb3 = (TestBean) getBeanFactory().getBean("aliasWithoutId1"); TestBean alias4 = (TestBean) getBeanFactory().getBean("aliasWithoutId2"); TestBean alias5 = (TestBean) getBeanFactory().getBean("aliasWithoutId3"); - Assert.assertTrue(tb3 == alias4); - Assert.assertTrue(tb3 == alias5); + assertTrue(tb3 == alias4); + assertTrue(tb3 == alias5); List tb3Aliases = Arrays.asList(getBeanFactory().getAliases("aliasWithoutId1")); - Assert.assertEquals(2, tb3Aliases.size()); - Assert.assertTrue(tb3Aliases.contains("aliasWithoutId2")); - Assert.assertTrue(tb3Aliases.contains("aliasWithoutId3")); - Assert.assertTrue(beanNames.contains("aliasWithoutId1")); - Assert.assertFalse(beanNames.contains("aliasWithoutId2")); - Assert.assertFalse(beanNames.contains("aliasWithoutId3")); + assertEquals(2, tb3Aliases.size()); + assertTrue(tb3Aliases.contains("aliasWithoutId2")); + assertTrue(tb3Aliases.contains("aliasWithoutId3")); + assertTrue(beanNames.contains("aliasWithoutId1")); + assertFalse(beanNames.contains("aliasWithoutId2")); + assertFalse(beanNames.contains("aliasWithoutId3")); TestBean tb4 = (TestBean) getBeanFactory().getBean(TestBean.class.getName() + "#0"); - Assert.assertEquals(null, tb4.getName()); + assertEquals(null, tb4.getName()); Map drs = getListableBeanFactory().getBeansOfType(DummyReferencer.class, false, false); - Assert.assertEquals(5, drs.size()); - Assert.assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#0")); - Assert.assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#1")); - Assert.assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#2")); + assertEquals(5, drs.size()); + assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#0")); + assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#1")); + assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#2")); } public void testFactoryNesting() { ITestBean father = (ITestBean) getBeanFactory().getBean("father"); - Assert.assertTrue("Bean from root context", father != null); + assertTrue("Bean from root context", father != null); TestBean rod = (TestBean) getBeanFactory().getBean("rod"); - Assert.assertTrue("Bean from child context", "Rod".equals(rod.getName())); - Assert.assertTrue("Bean has external reference", rod.getSpouse() == father); + assertTrue("Bean from child context", "Rod".equals(rod.getName())); + assertTrue("Bean has external reference", rod.getSpouse() == father); rod = (TestBean) parent.getBean("rod"); - Assert.assertTrue("Bean from root context", "Roderick".equals(rod.getName())); + assertTrue("Bean from root context", "Roderick".equals(rod.getName())); } public void testFactoryReferences() { DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); DummyReferencer ref = (DummyReferencer) getBeanFactory().getBean("factoryReferencer"); - Assert.assertTrue(ref.getTestBean1() == ref.getTestBean2()); - Assert.assertTrue(ref.getDummyFactory() == factory); + assertTrue(ref.getTestBean1() == ref.getTestBean2()); + assertTrue(ref.getDummyFactory() == factory); DummyReferencer ref2 = (DummyReferencer) getBeanFactory().getBean("factoryReferencerWithConstructor"); - Assert.assertTrue(ref2.getTestBean1() == ref2.getTestBean2()); - Assert.assertTrue(ref2.getDummyFactory() == factory); + assertTrue(ref2.getTestBean1() == ref2.getTestBean2()); + assertTrue(ref2.getDummyFactory() == factory); } public void testPrototypeReferences() { // check that not broken by circular reference resolution mechanism DummyReferencer ref1 = (DummyReferencer) getBeanFactory().getBean("prototypeReferencer"); - Assert.assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref1.getTestBean2()); + assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref1.getTestBean2()); DummyReferencer ref2 = (DummyReferencer) getBeanFactory().getBean("prototypeReferencer"); - Assert.assertTrue("Not the same referencer", ref1 != ref2); - Assert.assertTrue("Not referencing same bean twice", ref2.getTestBean1() != ref2.getTestBean2()); - Assert.assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref2.getTestBean1()); - Assert.assertTrue("Not referencing same bean twice", ref1.getTestBean2() != ref2.getTestBean2()); - Assert.assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref2.getTestBean2()); + assertTrue("Not the same referencer", ref1 != ref2); + assertTrue("Not referencing same bean twice", ref2.getTestBean1() != ref2.getTestBean2()); + assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref2.getTestBean1()); + assertTrue("Not referencing same bean twice", ref1.getTestBean2() != ref2.getTestBean2()); + assertTrue("Not referencing same bean twice", ref1.getTestBean1() != ref2.getTestBean2()); } public void testBeanPostProcessor() throws Exception { @@ -207,22 +214,22 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest TestBean kathy = (TestBean) getBeanFactory().getBean("kathy"); DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); TestBean factoryCreated = (TestBean) getBeanFactory().getBean("singletonFactory"); - Assert.assertTrue(kerry.isPostProcessed()); - Assert.assertTrue(kathy.isPostProcessed()); - Assert.assertTrue(factory.isPostProcessed()); - Assert.assertTrue(factoryCreated.isPostProcessed()); + assertTrue(kerry.isPostProcessed()); + assertTrue(kathy.isPostProcessed()); + assertTrue(factory.isPostProcessed()); + assertTrue(factoryCreated.isPostProcessed()); } public void testEmptyValues() { TestBean rod = (TestBean) getBeanFactory().getBean("rod"); TestBean kerry = (TestBean) getBeanFactory().getBean("kerry"); - Assert.assertTrue("Touchy is empty", "".equals(rod.getTouchy())); - Assert.assertTrue("Touchy is empty", "".equals(kerry.getTouchy())); + assertTrue("Touchy is empty", "".equals(rod.getTouchy())); + assertTrue("Touchy is empty", "".equals(kerry.getTouchy())); } public void testCommentsAndCdataInValue() { TestBean bean = (TestBean) getBeanFactory().getBean("commentsInValue"); - Assert.assertEquals("Failed to handle comments and CDATA properly", "this is a ", bean.getName()); + assertEquals("Failed to handle comments and CDATA properly", "this is a ", bean.getName()); } } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/support/DefaultNamespaceHandlerResolverTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/xml/support/DefaultNamespaceHandlerResolverTests.java index eb936a57efa..2b2ee692e6a 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/support/DefaultNamespaceHandlerResolverTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/xml/support/DefaultNamespaceHandlerResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java index 9be6a107f39..a66734f6259 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -70,6 +70,7 @@ public class BeanInfoTests extends TestCase { public static class ValueBeanBeanInfo extends SimpleBeanInfo { + @Override public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pd = new PropertyDescriptor("value", ValueBean.class); @@ -96,6 +97,7 @@ public class BeanInfoTests extends TestCase { this.target = target; } + @Override public void setAsText(String text) throws IllegalArgumentException { if (JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_15) { Assert.isTrue(this.target instanceof ValueBean, "Target must be available on JDK 1.5+"); diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java index 4bf47d014aa..f2d77a2b684 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java index c5a230a2c86..d2052916203 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -44,12 +44,12 @@ import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; +import org.springframework.tests.sample.beans.BooleanTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.NumberTestBean; +import org.springframework.tests.sample.beans.TestBean; -import test.beans.BooleanTestBean; -import test.beans.ITestBean; -import test.beans.IndexedTestBean; -import test.beans.NumberTestBean; -import test.beans.TestBean; /** * Unit tests for the various PropertyEditors in Spring. @@ -113,6 +113,7 @@ public class CustomEditorTests { TestBean tb = new TestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(String.class, "name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } @@ -130,6 +131,7 @@ public class CustomEditorTests { TestBean tb = new TestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(String.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } @@ -148,6 +150,7 @@ public class CustomEditorTests { tb.setSpouse(new TestBean()); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(String.class, "spouse.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } @@ -166,6 +169,7 @@ public class CustomEditorTests { tb.setSpouse(new TestBean()); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(String.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } @@ -588,9 +592,9 @@ public class CustomEditorTests { @Test public void testClassEditorWithArray() { PropertyEditor classEditor = new ClassEditor(); - classEditor.setAsText("test.beans.TestBean[]"); + classEditor.setAsText("org.springframework.tests.sample.beans.TestBean[]"); assertEquals(TestBean[].class, classEditor.getValue()); - assertEquals("test.beans.TestBean[]", classEditor.getAsText()); + assertEquals("org.springframework.tests.sample.beans.TestBean[]", classEditor.getAsText()); } /* @@ -853,6 +857,7 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(String.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } @@ -905,16 +910,19 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(false); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(String.class, "array.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array" + text); } }); bw.registerCustomEditor(String.class, "list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } }); bw.registerCustomEditor(String.class, "map.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("map" + text); } @@ -969,31 +977,37 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(false); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(String.class, "array[0].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array0" + text); } }); bw.registerCustomEditor(String.class, "array[1].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array1" + text); } }); bw.registerCustomEditor(String.class, "list[0].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list0" + text); } }); bw.registerCustomEditor(String.class, "list[1].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list1" + text); } }); bw.registerCustomEditor(String.class, "map[key1].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("mapkey1" + text); } }); bw.registerCustomEditor(String.class, "map[key2].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("mapkey2" + text); } @@ -1060,28 +1074,34 @@ public class CustomEditorTests { tb5.setNestedIndexedBean(new IndexedTestBean()); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(String.class, "array.nestedIndexedBean.array.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(5); } }); bw.registerCustomEditor(String.class, "list.nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } }); bw.registerCustomEditor(String.class, "map.nestedIndexedBean.map.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("map" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1138,16 +1158,19 @@ public class CustomEditorTests { tb5.setNestedIndexedBean(new IndexedTestBean()); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(String.class, "array[0].nestedIndexedBean.array[0].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array" + text); } }); bw.registerCustomEditor(String.class, "list.nestedIndexedBean.list[1].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } }); bw.registerCustomEditor(String.class, "map[key1].nestedIndexedBean.map.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("map" + text); } @@ -1174,28 +1197,34 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(TestBean.class, "array", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("array" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "list", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("list" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("map" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1222,55 +1251,67 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(TestBean.class, "array[0]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("array0" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "array[1]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("array1" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "list[0]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("list0" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "list[1]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("list1" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "map[key1]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("mapkey1" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } }); bw.registerCustomEditor(TestBean.class, "map[key2]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean("mapkey2" + text, 99)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1297,6 +1338,7 @@ public class CustomEditorTests { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); bw.registerCustomEditor(List.class, "list", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { List result = new ArrayList(); result.add(new TestBean("list" + text, 99)); @@ -1347,6 +1389,7 @@ public class CustomEditorTests { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(TestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text, 99)); } @@ -1362,6 +1405,7 @@ public class CustomEditorTests { TestBean tb = new TestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); bw.registerCustomEditor(String.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("-" + text + "-"); } @@ -1436,6 +1480,7 @@ public class CustomEditorTests { private static class TestBeanEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) { TestBean tb = new TestBean(); StringTokenizer st = new StringTokenizer(text, "_"); @@ -1448,6 +1493,7 @@ public class CustomEditorTests { private static class OldValueAccessingTestBeanEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) { TestBean tb = new TestBean(); StringTokenizer st = new StringTokenizer(text, "_"); diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/PropertiesEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/PropertiesEditorTests.java index e2baf255306..b1cc7ee18de 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/PropertiesEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/PropertiesEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java b/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java index 7050c656b97..9e5bd8911a5 100644 --- a/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -18,18 +18,30 @@ package org.springframework.beans.support; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; -import test.beans.TestBean; +import org.junit.Test; + +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; + +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; +import org.springframework.tests.sample.beans.TestBean; + +import static org.junit.Assert.*; /** * @author Juergen Hoeller * @author Jean-Pierre PAWLAK + * @author Chris Beams * @since 20.05.2003 */ -public class PagedListHolderTests extends TestCase { +public class PagedListHolderTests { + @Test public void testPagedListHolder() { + Assume.group(TestGroup.LONG_RUNNING); + TestBean tb1 = new TestBean(); tb1.setName("eva"); tb1.setAge(25); diff --git a/spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java b/spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java index 34bfbac3b9a..320759d1b8a 100644 --- a/spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -104,6 +104,7 @@ public class PropertyComparatorTests { private String lastName; + @Override public int compareTo(Object o) { return nickName.compareTo(((Dog)o).nickName); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectingReaderEventListener.java b/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java similarity index 90% rename from spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectingReaderEventListener.java rename to spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java index 2be0637cf69..8779f9ed5ed 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/CollectingReaderEventListener.java +++ b/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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,11 +14,12 @@ * limitations under the License. */ -package org.springframework.beans.factory.xml; +package org.springframework.tests.beans; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -38,13 +39,14 @@ public class CollectingReaderEventListener implements ReaderEventListener { private final List defaults = new LinkedList(); - private final Map componentDefinitions = CollectionFactory.createLinkedMapIfPossible(8); + private final Map componentDefinitions = new LinkedHashMap<>(8); - private final Map aliasMap = CollectionFactory.createLinkedMapIfPossible(8); + private final Map aliasMap = new LinkedHashMap<>(8); private final List imports = new LinkedList(); + @Override public void defaultsRegistered(DefaultsDefinition defaultsDefinition) { this.defaults.add(defaultsDefinition); } @@ -53,6 +55,7 @@ public class CollectingReaderEventListener implements ReaderEventListener { return Collections.unmodifiableList(this.defaults); } + @Override public void componentRegistered(ComponentDefinition componentDefinition) { this.componentDefinitions.put(componentDefinition.getName(), componentDefinition); } @@ -66,6 +69,7 @@ public class CollectingReaderEventListener implements ReaderEventListener { return (ComponentDefinition[]) collection.toArray(new ComponentDefinition[collection.size()]); } + @Override public void aliasRegistered(AliasDefinition aliasDefinition) { List aliases = (List) this.aliasMap.get(aliasDefinition.getBeanName()); if(aliases == null) { @@ -80,6 +84,7 @@ public class CollectingReaderEventListener implements ReaderEventListener { return aliases == null ? null : Collections.unmodifiableList(aliases); } + @Override public void importProcessed(ImportDefinition importDefinition) { this.imports.add(importDefinition); } @@ -88,4 +93,4 @@ public class CollectingReaderEventListener implements ReaderEventListener { return Collections.unmodifiableList(this.imports); } -} \ No newline at end of file +} diff --git a/spring-beans/src/test/java/test/beans/BooleanTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/BooleanTestBean.java similarity index 90% rename from spring-beans/src/test/java/test/beans/BooleanTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/BooleanTestBean.java index c6f32d1f91d..92484b7d1aa 100644 --- a/spring-beans/src/test/java/test/beans/BooleanTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/BooleanTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; /** * @author Juergen Hoeller diff --git a/spring-aspects/src/test/java/org/springframework/beans/Colour.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/Colour.java similarity index 91% rename from spring-aspects/src/test/java/org/springframework/beans/Colour.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/Colour.java index 17fd24fec79..a4a7d9740b4 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/Colour.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/Colour.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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.beans; +package org.springframework.tests.sample.beans; import org.springframework.core.enums.ShortCodedLabeledEnum; diff --git a/spring-aop/src/test/java/test/beans/CountingTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/CountingTestBean.java similarity index 94% rename from spring-aop/src/test/java/test/beans/CountingTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/CountingTestBean.java index 50657647656..e5f6947de5a 100644 --- a/spring-aop/src/test/java/test/beans/CountingTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/CountingTestBean.java @@ -1,7 +1,3 @@ -/* - * $Id$ - */ - /* * Copyright 2002-2005 the original author or authors. * @@ -18,7 +14,7 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; /** diff --git a/spring-webmvc/src/test/java/org/springframework/beans/CustomEnum.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/CustomEnum.java similarity index 94% rename from spring-webmvc/src/test/java/org/springframework/beans/CustomEnum.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/CustomEnum.java index 1e43492191b..66a863772ff 100644 --- a/spring-webmvc/src/test/java/org/springframework/beans/CustomEnum.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/CustomEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; /** * @author Juergen Hoeller diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DependenciesBean.java similarity index 91% rename from spring-beans/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/DependenciesBean.java index 7387cdf6003..b17d1028cc5 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DependenciesBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,13 +14,11 @@ * limitations under the License. */ -package org.springframework.beans.factory.xml; +package org.springframework.tests.sample.beans; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; -import test.beans.TestBean; - /** * Simple bean used to test dependency checking. * @@ -62,6 +60,7 @@ public class DependenciesBean implements BeanFactoryAware { return spouse; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } diff --git a/spring-beans/src/test/java/test/beans/DerivedTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DerivedTestBean.java similarity index 92% rename from spring-beans/src/test/java/test/beans/DerivedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/DerivedTestBean.java index fbc9fb50900..91416208a2b 100644 --- a/spring-beans/src/test/java/test/beans/DerivedTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DerivedTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; import java.io.Serializable; @@ -51,12 +51,14 @@ public class DerivedTestBean extends TestBean implements Serializable, BeanNameA } + @Override public void setBeanName(String beanName) { if (this.beanName == null || beanName == null) { this.beanName = beanName; } } + @Override public String getBeanName() { return beanName; } @@ -79,10 +81,12 @@ public class DerivedTestBean extends TestBean implements Serializable, BeanNameA } + @Override public void destroy() { this.destroyed = true; } + @Override public boolean wasDestroyed() { return destroyed; } diff --git a/spring-beans/src/test/java/test/beans/DummyBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyBean.java similarity index 92% rename from spring-beans/src/test/java/test/beans/DummyBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyBean.java index 6c83aed2098..cb5767eef59 100644 --- a/spring-beans/src/test/java/test/beans/DummyBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2002-2012 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; /** * @author Costin Leau diff --git a/spring-beans/src/test/java/test/beans/DummyFactory.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyFactory.java similarity index 94% rename from spring-beans/src/test/java/test/beans/DummyFactory.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyFactory.java index 75b585a498f..dc08778c536 100644 --- a/spring-beans/src/test/java/test/beans/DummyFactory.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/DummyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; @@ -24,6 +24,7 @@ import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.tests.sample.beans.TestBean; /** @@ -81,6 +82,7 @@ public class DummyFactory * Return if the bean managed by this factory is a singleton. * @see FactoryBean#isSingleton() */ + @Override public boolean isSingleton() { return this.singleton; } @@ -92,6 +94,7 @@ public class DummyFactory this.singleton = singleton; } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } @@ -100,6 +103,7 @@ public class DummyFactory return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = (AutowireCapableBeanFactory) beanFactory; this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); @@ -126,6 +130,7 @@ public class DummyFactory return otherTestBean; } + @Override public void afterPropertiesSet() { if (initialized) { throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); @@ -151,6 +156,7 @@ public class DummyFactory * and prototype mode. * @see FactoryBean#getObject() */ + @Override public Object getObject() throws BeansException { if (isSingleton()) { return this.testBean; @@ -165,11 +171,13 @@ public class DummyFactory } } + @Override public Class getObjectType() { return TestBean.class; } + @Override public void destroy() { if (this.testBean != null) { this.testBean.setName(null); diff --git a/spring-beans/src/test/java/test/beans/GenericBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericBean.java similarity index 95% rename from spring-beans/src/test/java/test/beans/GenericBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericBean.java index 12ff808dc84..c192382a1b7 100644 --- a/spring-beans/src/test/java/test/beans/GenericBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2010 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 test.beans; +package org.springframework.tests.sample.beans; import java.util.ArrayList; import java.util.Collection; @@ -37,6 +37,8 @@ public class GenericBean { private Set numberSet; + private Set testBeanSet; + private List resourceList; private List testBeanList; @@ -69,6 +71,7 @@ public class GenericBean { private List genericListProperty; + public GenericBean() { } @@ -121,6 +124,14 @@ public class GenericBean { this.numberSet = numberSet; } + public Set getTestBeanSet() { + return testBeanSet; + } + + public void setTestBeanSet(Set testBeanSet) { + this.testBeanSet = testBeanSet; + } + public List getResourceList() { return resourceList; } @@ -284,4 +295,4 @@ public class GenericBean { return new GenericBean(someFlag, collectionMap); } -} \ No newline at end of file +} diff --git a/spring-beans/src/test/java/test/beans/GenericIntegerBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericIntegerBean.java similarity index 93% rename from spring-beans/src/test/java/test/beans/GenericIntegerBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericIntegerBean.java index 43b6465df08..b7465b1bfa1 100644 --- a/spring-beans/src/test/java/test/beans/GenericIntegerBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericIntegerBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; /** diff --git a/spring-beans/src/test/java/test/beans/GenericSetOfIntegerBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericSetOfIntegerBean.java similarity index 93% rename from spring-beans/src/test/java/test/beans/GenericSetOfIntegerBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericSetOfIntegerBean.java index 021c0cd1c16..a0fee60195d 100644 --- a/spring-beans/src/test/java/test/beans/GenericSetOfIntegerBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/GenericSetOfIntegerBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; import java.util.Set; diff --git a/spring-context/src/test/java/org/springframework/beans/factory/HasMap.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/HasMap.java similarity index 73% rename from spring-context/src/test/java/org/springframework/beans/factory/HasMap.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/HasMap.java index 1c1708eca5c..4639050b2a6 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/HasMap.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/HasMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,11 +14,13 @@ * limitations under the License. */ -package org.springframework.beans.factory; +package org.springframework.tests.sample.beans; +import java.util.IdentityHashMap; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; /** * Bean exposing a map. Used for bean factory tests. @@ -40,6 +42,10 @@ public class HasMap { private Integer[] intArray; + private IdentityHashMap identityMap; + + private CopyOnWriteArraySet concurrentSet; + private HasMap() { } @@ -91,4 +97,20 @@ public class HasMap { intArray = is; } + public IdentityHashMap getIdentityMap() { + return identityMap; + } + + public void setIdentityMap(IdentityHashMap identityMap) { + this.identityMap = identityMap; + } + + public CopyOnWriteArraySet getConcurrentSet() { + return concurrentSet; + } + + public void setConcurrentSet(CopyOnWriteArraySet concurrentSet) { + this.concurrentSet = concurrentSet; + } + } diff --git a/spring-aop/src/test/java/test/beans/INestedTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/INestedTestBean.java similarity index 85% rename from spring-aop/src/test/java/test/beans/INestedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/INestedTestBean.java index 87bfc267738..58c4b9d502d 100644 --- a/spring-aop/src/test/java/test/beans/INestedTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/INestedTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; public interface INestedTestBean { diff --git a/spring-beans/src/test/java/test/beans/IOther.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/IOther.java similarity index 85% rename from spring-beans/src/test/java/test/beans/IOther.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/IOther.java index e5b576de3b1..694f32d2759 100644 --- a/spring-beans/src/test/java/test/beans/IOther.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/IOther.java @@ -1,6 +1,6 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; public interface IOther { diff --git a/spring-web/src/test/java/org/springframework/beans/ITestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/ITestBean.java similarity index 90% rename from spring-web/src/test/java/org/springframework/beans/ITestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/ITestBean.java index 526c3dacfb5..b467348a93d 100644 --- a/spring-web/src/test/java/org/springframework/beans/ITestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/ITestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2007 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,12 +14,12 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; import java.io.IOException; /** - * Interface used for {@link org.springframework.beans.TestBean}. + * Interface used for {@link org.springframework.tests.sample.beans.TestBean}. * *

Two methods are the same as on Person, but if this * extends person it breaks quite a few tests.. @@ -84,4 +84,4 @@ public interface ITestBean { void unreliableFileOperation() throws IOException; -} \ No newline at end of file +} diff --git a/spring-beans/src/test/java/test/beans/IndexedTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/IndexedTestBean.java similarity index 98% rename from spring-beans/src/test/java/test/beans/IndexedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/IndexedTestBean.java index bd2a72662f6..d319bbd0eda 100644 --- a/spring-beans/src/test/java/test/beans/IndexedTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/IndexedTestBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; import java.util.ArrayList; import java.util.Collection; diff --git a/spring-beans/src/test/java/test/beans/LifecycleBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/LifecycleBean.java similarity index 96% rename from spring-beans/src/test/java/test/beans/LifecycleBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/LifecycleBean.java index 145413deefb..1a81d10340a 100644 --- a/spring-beans/src/test/java/test/beans/LifecycleBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/LifecycleBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; @@ -59,6 +59,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ return initMethodDeclared; } + @Override public void setBeanName(String name) { this.beanName = name; } @@ -67,6 +68,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.owningFactory = beanFactory; } @@ -81,6 +83,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ this.postProcessedBeforeInit = true; } + @Override public void afterPropertiesSet() { if (this.owningFactory == null) { throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); @@ -132,6 +135,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ } } + @Override public void destroy() { if (this.destroyed) { throw new IllegalStateException("Already destroyed"); @@ -146,6 +150,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ public static class PostProcessor implements BeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { if (bean instanceof LifecycleBean) { ((LifecycleBean) bean).postProcessBeforeInit(); @@ -153,6 +158,7 @@ public class LifecycleBean implements BeanNameAware, BeanFactoryAware, Initializ return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { if (bean instanceof LifecycleBean) { ((LifecycleBean) bean).postProcessAfterInit(); diff --git a/spring-context/src/test/java/org/springframework/beans/factory/MustBeInitialized.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/MustBeInitialized.java similarity index 87% rename from spring-context/src/test/java/org/springframework/beans/factory/MustBeInitialized.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/MustBeInitialized.java index 1dcc1aaf72d..cc83d69d833 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/MustBeInitialized.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/MustBeInitialized.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,9 @@ * limitations under the License. */ -package org.springframework.beans.factory; +package org.springframework.tests.sample.beans; + +import org.springframework.beans.factory.InitializingBean; /** * Simple test of BeanFactory initialization @@ -28,6 +30,7 @@ public class MustBeInitialized implements InitializingBean { /** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ + @Override public void afterPropertiesSet() throws Exception { this.inited = true; } diff --git a/spring-aspects/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/NestedTestBean.java similarity index 92% rename from spring-aspects/src/test/java/org/springframework/beans/NestedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/NestedTestBean.java index 0eb8df5c8ae..844c5ea6921 100644 --- a/spring-aspects/src/test/java/org/springframework/beans/NestedTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/NestedTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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.beans; +package org.springframework.tests.sample.beans; /** * Simple nested test bean used for testing bean factories, AOP framework etc. @@ -37,6 +37,7 @@ public class NestedTestBean implements INestedTestBean { this.company = (company != null ? company : ""); } + @Override public String getCompany() { return company; } diff --git a/spring-beans/src/test/java/test/beans/NumberTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/NumberTestBean.java similarity index 95% rename from spring-beans/src/test/java/test/beans/NumberTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/NumberTestBean.java index e739da47385..489c9335091 100644 --- a/spring-beans/src/test/java/test/beans/NumberTestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/NumberTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/spring-beans/src/test/java/test/beans/PackageLevelVisibleBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/PackageLevelVisibleBean.java similarity index 88% rename from spring-beans/src/test/java/test/beans/PackageLevelVisibleBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/PackageLevelVisibleBean.java index a77af92d129..142a5da2d26 100644 --- a/spring-beans/src/test/java/test/beans/PackageLevelVisibleBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/PackageLevelVisibleBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; /** * @see org.springframework.beans.factory.config.FieldRetrievingFactoryBeanTests diff --git a/spring-test/src/test/java/org/springframework/beans/Pet.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/Pet.java similarity index 96% rename from spring-test/src/test/java/org/springframework/beans/Pet.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/Pet.java index eb78f612fb0..61563f0dd8a 100644 --- a/spring-test/src/test/java/org/springframework/beans/Pet.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/Pet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; /** * @author Rob Harrop diff --git a/spring-aop/src/test/java/test/beans/SideEffectBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/SideEffectBean.java similarity index 89% rename from spring-aop/src/test/java/test/beans/SideEffectBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/SideEffectBean.java index 82871af7527..9477a5e5488 100644 --- a/spring-aop/src/test/java/test/beans/SideEffectBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/SideEffectBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; /** * Bean that changes state on a business invocation, so that diff --git a/spring-context/src/test/java/org/springframework/beans/TestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/TestBean.java similarity index 86% rename from spring-context/src/test/java/org/springframework/beans/TestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/TestBean.java index b93bf96be31..cb276da9cbd 100644 --- a/spring-context/src/test/java/org/springframework/beans/TestBean.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/TestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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.beans; +package org.springframework.tests.sample.beans; import java.io.IOException; import java.util.ArrayList; @@ -58,7 +58,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt private boolean jedi; - private ITestBean[] spouses; + protected ITestBean[] spouses; private String touchy; @@ -66,6 +66,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt private Integer[] someIntegerArray; + private Integer[][] nestedIntegerArray; + + private int[] someIntArray; + + private int[][] nestedIntArray; + private Date date = new Date(); private Float myFloat = new Float(0.0); @@ -137,6 +143,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } @@ -145,6 +152,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } @@ -161,10 +169,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt return postProcessed; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } @@ -180,10 +190,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt } } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -196,14 +208,17 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.jedi = jedi; } + @Override public ITestBean getSpouse() { return (spouses != null ? spouses[0] : null); } + @Override public void setSpouse(ITestBean spouse) { this.spouses = new ITestBean[] {spouse}; } + @Override public ITestBean[] getSpouses() { return spouses; } @@ -230,10 +245,12 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.country = country; } + @Override public String[] getStringArray() { return stringArray; } + @Override public void setStringArray(String[] stringArray) { this.stringArray = stringArray; } @@ -246,6 +263,36 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.someIntegerArray = someIntegerArray; } + @Override + public Integer[][] getNestedIntegerArray() { + return nestedIntegerArray; + } + + @Override + public void setNestedIntegerArray(Integer[][] nestedIntegerArray) { + this.nestedIntegerArray = nestedIntegerArray; + } + + @Override + public int[] getSomeIntArray() { + return someIntArray; + } + + @Override + public void setSomeIntArray(int[] someIntArray) { + this.someIntArray = someIntArray; + } + + @Override + public int[][] getNestedIntArray() { + return nestedIntArray; + } + + @Override + public void setNestedIntArray(int[][] nestedIntArray) { + this.nestedIntArray = nestedIntArray; + } + public Date getDate() { return date; } @@ -302,6 +349,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.someProperties = someProperties; } + @Override public INestedTestBean getDoctor() { return doctor; } @@ -310,6 +358,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.doctor = doctor; } + @Override public INestedTestBean getLawyer() { return lawyer; } @@ -342,6 +391,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt this.someBoolean = someBoolean; } + @Override public IndexedTestBean getNestedIndexedBean() { return nestedIndexedBean; } @@ -368,30 +418,35 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) + * @see org.springframework.tests.sample.beans.ITestBean#exceptional(Throwable) */ + @Override public void exceptional(Throwable t) throws Throwable { if (t != null) { throw t; } } + @Override public void unreliableFileOperation() throws IOException { throw new IOException(); } /** - * @see org.springframework.beans.ITestBean#returnsThis() + * @see org.springframework.tests.sample.beans.ITestBean#returnsThis() */ + @Override public Object returnsThis() { return this; } /** - * @see org.springframework.beans.IOther#absquatulate() + * @see org.springframework.tests.sample.beans.IOther#absquatulate() */ + @Override public void absquatulate() { } + @Override public int haveBirthday() { return age++; } @@ -421,6 +476,7 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt return this.age; } + @Override public int compareTo(Object other) { if (this.name != null && other instanceof TestBean) { return this.name.compareTo(((TestBean) other).getName()); @@ -434,4 +490,4 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt return this.name; } -} \ No newline at end of file +} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/DummyFactory.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/factory/DummyFactory.java similarity index 84% rename from spring-context/src/test/java/org/springframework/beans/factory/DummyFactory.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/factory/DummyFactory.java index b9999baa5e6..b562f569fa0 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/DummyFactory.java +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/factory/DummyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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,11 +14,18 @@ * limitations under the License. */ -package org.springframework.beans.factory; +package org.springframework.tests.sample.beans.factory; import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanFactoryAware; +import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.tests.sample.beans.TestBean; + /** * Simple factory to allow testing of FactoryBean support in AbstractBeanFactory. @@ -29,6 +36,7 @@ import org.springframework.beans.factory.config.AutowireCapableBeanFactory; * factories get this lifecycle callback if they want. * * @author Rod Johnson + * @author Chris Beams * @since 10.03.2003 */ public class DummyFactory @@ -72,8 +80,9 @@ public class DummyFactory /** * Return if the bean managed by this factory is a singleton. - * @see org.springframework.beans.factory.FactoryBean#isSingleton() + * @see FactoryBean#isSingleton() */ + @Override public boolean isSingleton() { return this.singleton; } @@ -85,6 +94,7 @@ public class DummyFactory this.singleton = singleton; } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } @@ -93,6 +103,7 @@ public class DummyFactory return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = (AutowireCapableBeanFactory) beanFactory; this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); @@ -119,6 +130,7 @@ public class DummyFactory return otherTestBean; } + @Override public void afterPropertiesSet() { if (initialized) { throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); @@ -142,8 +154,9 @@ public class DummyFactory /** * Return the managed object, supporting both singleton * and prototype mode. - * @see org.springframework.beans.factory.FactoryBean#getObject() + * @see FactoryBean#getObject() */ + @Override public Object getObject() throws BeansException { if (isSingleton()) { return this.testBean; @@ -158,15 +171,17 @@ public class DummyFactory } } - public Class getObjectType() { + @Override + public Class getObjectType() { return TestBean.class; } + @Override public void destroy() { if (this.testBean != null) { this.testBean.setName(null); } } -} +} \ No newline at end of file diff --git a/spring-beans/src/test/java/org/springframework/tests/sample/beans/package-info.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/package-info.java new file mode 100644 index 00000000000..575bd1933f9 --- /dev/null +++ b/spring-beans/src/test/java/org/springframework/tests/sample/beans/package-info.java @@ -0,0 +1,4 @@ +/** + * General purpose sample beans that can be used with tests. + */ +package org.springframework.tests.sample.beans; diff --git a/spring-beans/src/test/java/org/springframework/util/SerializationTestUtils.java b/spring-beans/src/test/java/org/springframework/util/SerializationTestUtils.java deleted file mode 100644 index 9ae4f54ec24..00000000000 --- a/spring-beans/src/test/java/org/springframework/util/SerializationTestUtils.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * - * @author Rod Johnson - */ -public class SerializationTestUtils { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - return o2; - } - -} diff --git a/spring-beans/src/test/java/test/beans/Colour.java b/spring-beans/src/test/java/test/beans/Colour.java deleted file mode 100644 index 5be4dfa761a..00000000000 --- a/spring-beans/src/test/java/test/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-beans/src/test/java/test/beans/INestedTestBean.java b/spring-beans/src/test/java/test/beans/INestedTestBean.java deleted file mode 100644 index 87bfc267738..00000000000 --- a/spring-beans/src/test/java/test/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-beans/src/test/java/test/beans/ITestBean.java b/spring-beans/src/test/java/test/beans/ITestBean.java deleted file mode 100644 index 9397b175503..00000000000 --- a/spring-beans/src/test/java/test/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import java.io.IOException; - -/** - * Interface used for {@link test.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-beans/src/test/java/test/beans/NestedTestBean.java b/spring-beans/src/test/java/test/beans/NestedTestBean.java deleted file mode 100644 index a630f8662a7..00000000000 --- a/spring-beans/src/test/java/test/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-beans/src/test/java/test/beans/TestBean.java b/spring-beans/src/test/java/test/beans/TestBean.java deleted file mode 100644 index 7e8089e6e7a..00000000000 --- a/spring-beans/src/test/java/test/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-beans/src/test/java/test/util/TestResourceUtils.java b/spring-beans/src/test/java/test/util/TestResourceUtils.java deleted file mode 100644 index c137adffe4c..00000000000 --- a/spring-beans/src/test/java/test/util/TestResourceUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.util; - -import static java.lang.String.format; - -import org.springframework.core.io.ClassPathResource; - -/** - * Convenience utilities for common operations with test resources. - * - * @author Chris Beams - */ -public class TestResourceUtils { - - /** - * Loads a {@link ClassPathResource} qualified by the simple name of clazz, - * and relative to the package for clazz. - * - *

Example: given a clazz 'com.foo.BarTests' and a resourceSuffix of 'context.xml', - * this method will return a ClassPathResource representing com/foo/BarTests-context.xml - * - *

Intended for use loading context configuration XML files within JUnit tests. - * - * @param clazz - * @param resourceSuffix - */ - public static ClassPathResource qualifiedResource(Class clazz, String resourceSuffix) { - return new ClassPathResource(format("%s-%s", clazz.getSimpleName(), resourceSuffix), clazz); - } - -} diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/support/multiConstructorArgs.properties b/spring-beans/src/test/resources/org/springframework/beans/factory/support/multiConstructorArgs.properties index 5beaf6d5982..8d5f74fc31a 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/support/multiConstructorArgs.properties +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/support/multiConstructorArgs.properties @@ -1,3 +1,3 @@ -testBean.(class)=test.beans.TestBean +testBean.(class)=org.springframework.tests.sample.beans.TestBean testBean.$0=Rob Harrop -testBean.$1=23 \ No newline at end of file +testBean.$1=23 diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/support/refConstructorArg.properties b/spring-beans/src/test/resources/org/springframework/beans/factory/support/refConstructorArg.properties index c33326c8574..4d3723c7de8 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/support/refConstructorArg.properties +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/support/refConstructorArg.properties @@ -1,5 +1,5 @@ -sally.(class)=test.beans.TestBean +sally.(class)=org.springframework.tests.sample.beans.TestBean sally.name=Sally -rob.(class)=test.beans.TestBean -rob.$0(ref)=sally \ No newline at end of file +rob.(class)=org.springframework.tests.sample.beans.TestBean +rob.$0(ref)=sally diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/support/simpleConstructorArg.properties b/spring-beans/src/test/resources/org/springframework/beans/factory/support/simpleConstructorArg.properties index be6700e1423..d0f1eea3266 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/support/simpleConstructorArg.properties +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/support/simpleConstructorArg.properties @@ -1,2 +1,2 @@ -testBean.(class)=test.beans.TestBean -testBean.$0=Rob Harrop \ No newline at end of file +testBean.(class)=org.springframework.tests.sample.beans.TestBean +testBean.$0=Rob Harrop diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests-merge-context.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests-merge-context.xml index 12dbc607928..2edadb511eb 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests-merge-context.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/NestedBeansElementAttributeRecursionTests-merge-context.xml @@ -5,7 +5,7 @@ http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" default-merge="false"> - + alpha diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-constructor-with-exclusion.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-constructor-with-exclusion.xml index 6363230a06c..2fcb1179545 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-constructor-with-exclusion.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-constructor-with-exclusion.xml @@ -3,9 +3,9 @@ - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-exclusion.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-exclusion.xml index 3f32de8aee3..a2e966aab98 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-exclusion.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-exclusion.xml @@ -3,9 +3,9 @@ - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-inclusion.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-inclusion.xml index e32686f27f7..9b93a16810d 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-inclusion.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-inclusion.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" default-autowire-candidates=""> - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-selective-inclusion.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-selective-inclusion.xml index 2883bd2383a..089517cd427 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-selective-inclusion.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/autowire-with-selective-inclusion.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" default-autowire-candidates="props*,*ly"> - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/beanEvents.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/beanEvents.xml index 22168ca8c8c..7e262a0a0d4 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/beanEvents.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/beanEvents.xml @@ -10,22 +10,22 @@ - + - + - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionMerging.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionMerging.xml index a614172a897..d8fc1db88ea 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionMerging.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionMerging.xml @@ -3,7 +3,7 @@ - + Rob Harrop @@ -23,12 +23,12 @@ - + - + Rob Harrop @@ -47,14 +47,14 @@ - + - + @@ -76,7 +76,7 @@ - + @@ -84,7 +84,7 @@ - + Sall @@ -103,7 +103,7 @@ - + Rob Harrop @@ -123,12 +123,12 @@ - + - + Rob Harrop @@ -147,14 +147,14 @@ - + - + @@ -176,7 +176,7 @@ - + @@ -184,7 +184,7 @@ - + Sall diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collections.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collections.xml index 44bd0b92dc9..974ae6c3d9c 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collections.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collections.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> - + Jenny 30 @@ -11,8 +11,8 @@ - - + + Simple bean, without any collections. @@ -22,8 +22,8 @@ 27 - - + + Rod 32 @@ -34,8 +34,8 @@ - - + + Jenny 30 @@ -44,13 +44,13 @@ - + David 27 - + Rod 32 @@ -64,7 +64,7 @@ - + loner 26 @@ -74,7 +74,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -102,26 +102,26 @@ - + verbose - - + + - + - + - - + + @@ -131,7 +131,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -177,7 +177,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -217,15 +217,15 @@ - - + + - + bar @@ -235,7 +235,7 @@ - + bar @@ -245,7 +245,7 @@ - + @@ -254,15 +254,15 @@ - + - - - + + + bar @@ -270,8 +270,8 @@ - - + + @@ -280,7 +280,7 @@ - + one @@ -288,8 +288,8 @@ - - + + java.lang.String @@ -297,8 +297,8 @@ - - + + 0 diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionsWithDefaultTypes.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionsWithDefaultTypes.xml index 7cd04cc145a..8a31ff86962 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionsWithDefaultTypes.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/collectionsWithDefaultTypes.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - + 1 @@ -28,7 +28,7 @@ - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/factory-methods.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/factory-methods.xml index f97701759b6..4ff20b3d591 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/factory-methods.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/factory-methods.xml @@ -102,7 +102,7 @@ - + Juergen @@ -127,7 +127,7 @@ - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml index 33cbb8dd8d6..7802a4c935b 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml @@ -3,16 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> - + - + - + - - + + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTests.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTests.xml index f245c964dd0..d9616443011 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTests.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTests.xml @@ -5,43 +5,43 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + - + - + - + - + - + - + \ No newline at end of file diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTestsWithErrors.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTestsWithErrors.xml index 7c10f7a32f6..1773a1c9c61 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTestsWithErrors.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simpleConstructorNamespaceHandlerTestsWithErrors.xml @@ -4,7 +4,7 @@ xmlns:p="http://www.springframework.org/schema/c" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTests.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTests.xml index e44a8c961c5..8dd70708d3d 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTests.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTests.xml @@ -8,20 +8,20 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - + - + - + - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTestsWithErrors.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTestsWithErrors.xml index d82595bac7a..384171fdc03 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTestsWithErrors.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerTestsWithErrors.xml @@ -8,10 +8,10 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - + - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/test.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/test.xml index 9d1d1f7adb8..933e66b7d00 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/test.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/test.xml @@ -3,7 +3,7 @@ - + I have no properties and I'm happy without them. @@ -12,7 +12,7 @@ - + aliased @@ -20,17 +20,17 @@ - + aliased - + aliased - + @@ -40,7 +40,7 @@ - + Rod 31 @@ -52,29 +52,29 @@ - + Kerry 34 - + Kathy 28 - + typeMismatch 34x - + - true @@ -85,10 +85,10 @@ - + - + false @@ -113,14 +113,14 @@ - + listenerVeto 66 - + - + this is a ]]> diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml index 8426c5d95ee..25f20439fa2 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml @@ -17,7 +17,7 @@ name "/> - + @@ -26,13 +26,13 @@ - + - + @@ -67,7 +67,7 @@ Rob Harrop - + foo @@ -89,13 +89,13 @@ - + - + @@ -111,13 +111,13 @@ min - + - + @@ -147,7 +147,7 @@ - + diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithDtd.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithDtd.xml index fab962d4dde..3cca869dbff 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithDtd.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithDtd.xml @@ -9,5 +9,5 @@ This is a top level block comment - + \ No newline at end of file diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithXsd.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithXsd.xml index 324fb483ff4..20aa0f53740 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithXsd.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/validateWithXsd.xml @@ -7,5 +7,5 @@ This is a top level block comment the parser now --> - + \ No newline at end of file diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml index 7cb0723a4c2..05c47afa53a 100644 --- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml +++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml @@ -4,15 +4,15 @@ xmlns:spring="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + - + - + diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailAuthenticationException.java b/spring-context-support/src/main/java/org/springframework/mail/MailAuthenticationException.java index f7474155f84..d4eb9cc6044 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailAuthenticationException.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailAuthenticationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailException.java b/spring-context-support/src/main/java/org/springframework/mail/MailException.java index bcbdd3cfb16..b254dc90737 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailException.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailParseException.java b/spring-context-support/src/main/java/org/springframework/mail/MailParseException.java index de58b7613a0..b6b47f16131 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailParseException.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailParseException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailPreparationException.java b/spring-context-support/src/main/java/org/springframework/mail/MailPreparationException.java index 5b77c3825ea..b1e99b55917 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailPreparationException.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailPreparationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailSendException.java b/spring-context-support/src/main/java/org/springframework/mail/MailSendException.java index d86944fc16d..4820c270a2d 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailSendException.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailSendException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/MailSender.java b/spring-context-support/src/main/java/org/springframework/mail/MailSender.java index fb44ac572e7..6b87d7bb99b 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/MailSender.java +++ b/spring-context-support/src/main/java/org/springframework/mail/MailSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java b/spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java index 1abeaa6a4f3..7cc61122bb5 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java +++ b/spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java index f3ceba872ee..ac683c5243b 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java index 057d6f78e29..2cf0b89671a 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSender.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSender.java index bae5d7fb962..7372f625126 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSender.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java index ed9151bfdf3..257b15b78e7 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java index 840320741b1..47a115e9805 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessagePreparator.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessagePreparator.java index dd6417b182f..9b0f49fc34d 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessagePreparator.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessagePreparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/mail/javamail/SmartMimeMessage.java b/spring-context-support/src/main/java/org/springframework/mail/javamail/SmartMimeMessage.java index 2e46fa1029c..35b3ace313c 100644 --- a/spring-context-support/src/main/java/org/springframework/mail/javamail/SmartMimeMessage.java +++ b/spring-context-support/src/main/java/org/springframework/mail/javamail/SmartMimeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/commonj/ScheduledTimerListener.java b/spring-context-support/src/main/java/org/springframework/scheduling/commonj/ScheduledTimerListener.java index 25931464c9e..c3e603882dc 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/commonj/ScheduledTimerListener.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/commonj/ScheduledTimerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerAccessor.java b/spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerAccessor.java index 2eae87785d5..8167f6a709c 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerAccessor.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerBean.java index eb1d1b6087b..c5e1c070b83 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailAwareTrigger.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailAwareTrigger.java index 0971d96d54f..3edec2aacba 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailAwareTrigger.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailAwareTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java index 1da0bb9b10f..0a534065777 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobMethodInvocationFailedException.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobMethodInvocationFailedException.java index 701b5c6ca09..d79bd3f69d9 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobMethodInvocationFailedException.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobMethodInvocationFailedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java index 2b1f04a48b1..c9664b28f8e 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java index e0307f6e251..6e5189e3b09 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java index 78862788575..b2d61536da3 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java index a81e39c83fc..5eba86a1055 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java index 17940bece42..84db22173a5 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerBean.java index 06b273eb246..b35bb59ad93 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SpringBeanJobFactory.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SpringBeanJobFactory.java index c6811478ae6..a9d837e7dae 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SpringBeanJobFactory.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SpringBeanJobFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java index d4f050e8a84..574c7695e7f 100644 --- a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java +++ b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerTemplateUtils.java b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerTemplateUtils.java index acc1e30b21d..b2e7a852144 100644 --- a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerTemplateUtils.java +++ b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerTemplateUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/main/java/org/springframework/ui/velocity/VelocityEngineFactory.java b/spring-context-support/src/main/java/org/springframework/ui/velocity/VelocityEngineFactory.java index 0ff54aeba0e..2e811889688 100644 --- a/spring-context-support/src/main/java/org/springframework/ui/velocity/VelocityEngineFactory.java +++ b/spring-context-support/src/main/java/org/springframework/ui/velocity/VelocityEngineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/test/java/org/springframework/beans/Colour.java b/spring-context-support/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-context-support/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-context-support/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/beans/IOther.java b/spring-context-support/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/beans/ITestBean.java b/spring-context-support/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-context-support/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-context-support/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/beans/TestBean.java b/spring-context-support/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeacf..00000000000 --- a/spring-context-support/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see org.springframework.beans.ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see org.springframework.beans.IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheCacheTests.java b/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheCacheTests.java index 5cb15498324..63fd1546a5d 100644 --- a/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheCacheTests.java +++ b/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheCacheTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2012 the original author or authors. + * Copyright 2010-2013 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. @@ -20,10 +20,13 @@ import net.sf.ehcache.CacheManager; import net.sf.ehcache.Ehcache; import net.sf.ehcache.Element; import net.sf.ehcache.config.CacheConfiguration; + import org.junit.Before; import org.junit.Test; import org.springframework.cache.Cache; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import static org.junit.Assert.*; @@ -95,6 +98,7 @@ public class EhCacheCacheTests { @Test public void testExpiredElements() throws Exception { + Assume.group(TestGroup.LONG_RUNNING); String key = "brancusi"; String value = "constantin"; Element brancusi = new Element(key, value); diff --git a/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheSupportTests.java b/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheSupportTests.java index 8ea783e17cc..646a6797171 100644 --- a/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheSupportTests.java +++ b/spring-context-support/src/test/java/org/springframework/cache/ehcache/EhCacheSupportTests.java @@ -188,6 +188,7 @@ public class EhCacheSupportTests extends TestCase { cacheFb.setCacheManager(cm); cacheFb.setCacheName("myCache1"); cacheFb.setCacheEntryFactory(new CacheEntryFactory() { + @Override public Object createEntry(Object key) throws Exception { return key; } @@ -212,9 +213,11 @@ public class EhCacheSupportTests extends TestCase { cacheFb.setCacheManager(cm); cacheFb.setCacheName("myCache1"); cacheFb.setCacheEntryFactory(new UpdatingCacheEntryFactory() { + @Override public Object createEntry(Object key) throws Exception { return key; } + @Override public void updateEntryValue(Object key, Object value) throws Exception { } }); diff --git a/spring-context-support/src/test/java/org/springframework/mail/javamail/InternetAddressEditorTests.java b/spring-context-support/src/test/java/org/springframework/mail/javamail/InternetAddressEditorTests.java index 3233099baca..4b397425a5b 100644 --- a/spring-context-support/src/test/java/org/springframework/mail/javamail/InternetAddressEditorTests.java +++ b/spring-context-support/src/test/java/org/springframework/mail/javamail/InternetAddressEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -30,6 +30,7 @@ public class InternetAddressEditorTests extends TestCase { private InternetAddressEditor editor; + @Override protected void setUp() { editor = new InternetAddressEditor(); } diff --git a/spring-context-support/src/test/java/org/springframework/mail/javamail/JavaMailSenderTests.java b/spring-context-support/src/test/java/org/springframework/mail/javamail/JavaMailSenderTests.java index b0deb96a6a2..97eb3e78633 100644 --- a/spring-context-support/src/test/java/org/springframework/mail/javamail/JavaMailSenderTests.java +++ b/spring-context-support/src/test/java/org/springframework/mail/javamail/JavaMailSenderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -20,8 +20,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; +import java.util.GregorianCalendar; import java.util.List; import java.util.Properties; + import javax.activation.FileTypeMap; import javax.mail.Address; import javax.mail.Message; @@ -59,7 +61,7 @@ public class JavaMailSenderTests extends TestCase { simpleMessage.setTo("you@mail.org"); simpleMessage.setCc(new String[] {"he@mail.org", "she@mail.org"}); simpleMessage.setBcc(new String[] {"us@mail.org", "them@mail.org"}); - Date sentDate = new Date(2004, 1, 1); + Date sentDate = new GregorianCalendar(2004, 1, 1).getTime(); simpleMessage.setSentDate(sentDate); simpleMessage.setSubject("my subject"); simpleMessage.setText("my text"); @@ -170,6 +172,7 @@ public class JavaMailSenderTests extends TestCase { final List messages = new ArrayList(); MimeMessagePreparator preparator = new MimeMessagePreparator() { + @Override public void prepare(MimeMessage mimeMessage) throws MessagingException { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("you@mail.org")); messages.add(mimeMessage); @@ -194,12 +197,14 @@ public class JavaMailSenderTests extends TestCase { final List messages = new ArrayList(); MimeMessagePreparator preparator1 = new MimeMessagePreparator() { + @Override public void prepare(MimeMessage mimeMessage) throws MessagingException { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("he@mail.org")); messages.add(mimeMessage); } }; MimeMessagePreparator preparator2 = new MimeMessagePreparator() { + @Override public void prepare(MimeMessage mimeMessage) throws MessagingException { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("she@mail.org")); messages.add(mimeMessage); @@ -300,6 +305,7 @@ public class JavaMailSenderTests extends TestCase { public void testJavaMailSenderWithParseExceptionOnMimeMessagePreparator() { MockJavaMailSender sender = new MockJavaMailSender(); MimeMessagePreparator preparator = new MimeMessagePreparator() { + @Override public void prepare(MimeMessage mimeMessage) throws MessagingException { mimeMessage.setFrom(new InternetAddress("")); } @@ -330,7 +336,7 @@ public class JavaMailSenderTests extends TestCase { MimeMessage mimeMessage = sender.createMimeMessage(); mimeMessage.setSubject("custom"); mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("you@mail.org")); - mimeMessage.setSentDate(new Date(2005, 3, 1)); + mimeMessage.setSentDate(new GregorianCalendar(2005, 3, 1).getTime()); sender.send(mimeMessage); assertEquals("host", sender.transport.getConnectedHost()); @@ -555,7 +561,7 @@ public class JavaMailSenderTests extends TestCase { throw new MessagingException("No sentDate specified"); } if (message.getSubject() != null && message.getSubject().contains("custom")) { - assertEquals(new Date(2005, 3, 1), message.getSentDate()); + assertEquals(new GregorianCalendar(2005, 3, 1).getTime(), message.getSentDate()); } this.sentMessages.add(message); } diff --git a/spring-context-support/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java b/spring-context-support/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java deleted file mode 100644 index a95a2408b54..00000000000 --- a/spring-context-support/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.scheduling; - -/** - * @author Juergen Hoeller - * @since 09.10.2004 - */ -public class TestMethodInvokingTask { - - public int counter = 0; - - private Object lock = new Object(); - - public void doSomething() { - this.counter++; - } - - public void doWait() { - this.counter++; - // wait until stop is called - synchronized (this.lock) { - try { - this.lock.wait(); - } - catch (InterruptedException e) { - // fall through - } - } - } - - public void stop() { - synchronized(this.lock) { - this.lock.notify(); - } - } - -} \ No newline at end of file diff --git a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerBeanTests.java b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerBeanTests.java index ca7bb45d657..8ccc9c5b697 100644 --- a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerBeanTests.java +++ b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/CronTriggerBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java index 0607947d6ca..ca55ed9a0e1 100644 --- a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java +++ b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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,6 +21,9 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import java.util.Arrays; import java.util.Date; @@ -30,7 +33,7 @@ import java.util.Map; import javax.sql.DataSource; -import org.easymock.MockControl; +import org.junit.Ignore; import org.junit.Test; import org.quartz.CronTrigger; import org.quartz.Job; @@ -49,18 +52,19 @@ import org.quartz.Trigger; import org.quartz.TriggerListener; import org.quartz.impl.SchedulerRepository; import org.quartz.spi.JobFactory; - -import org.springframework.beans.TestBean; +import org.springframework.tests.context.TestMethodInvokingTask; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.StaticListableBeanFactory; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.io.FileSystemResourceLoader; import org.springframework.core.task.TaskExecutor; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; -import org.springframework.scheduling.TestMethodInvokingTask; +import org.springframework.jdbc.core.JdbcTemplate; /** * @author Juergen Hoeller @@ -127,33 +131,13 @@ public class QuartzSupportTests { trigger1.setRepeatInterval(20); trigger1.afterPropertiesSet(); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); - scheduler.getContext(); - schedulerControl.setReturnValue(new SchedulerContext()); - scheduler.getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getJobDetail("myJob1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.addJob(jobDetail0, true); - schedulerControl.setVoidCallable(); - scheduler.scheduleJob(trigger0); - schedulerControl.setReturnValue(new Date()); - scheduler.addJob(jobDetail1, true); - schedulerControl.setVoidCallable(); - scheduler.scheduleJob(trigger1); - schedulerControl.setReturnValue(new Date()); - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); + final Scheduler scheduler = mock(Scheduler.class); + given(scheduler.getContext()).willReturn(new SchedulerContext()); + given(scheduler.scheduleJob(trigger0)).willReturn(new Date()); + given(scheduler.scheduleJob(trigger1)).willReturn(new Date()); SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -174,7 +158,14 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getJobDetail("myJob1", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); + verify(scheduler).addJob(jobDetail0, true); + verify(scheduler).addJob(jobDetail1, true); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } @Test @@ -219,35 +210,14 @@ public class QuartzSupportTests { trigger1.setRepeatInterval(20); trigger1.afterPropertiesSet(); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); - scheduler.getContext(); - schedulerControl.setReturnValue(new SchedulerContext()); - scheduler.getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(new SimpleTrigger()); - if (overwrite) { - scheduler.addJob(jobDetail1, true); - schedulerControl.setVoidCallable(); - scheduler.rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1); - schedulerControl.setReturnValue(new Date()); - } - else { - scheduler.getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - } - scheduler.addJob(jobDetail0, true); - schedulerControl.setVoidCallable(); - scheduler.scheduleJob(trigger0); - schedulerControl.setReturnValue(new Date()); - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); + final Scheduler scheduler = mock(Scheduler.class); + given(scheduler.getContext()).willReturn(new SchedulerContext()); + given(scheduler.rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1)).willReturn(new Date()); + given(scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP)).willReturn(new SimpleTrigger()); + given(scheduler.scheduleJob(trigger0)).willReturn(new Date()); SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -268,7 +238,18 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); + if (overwrite) { + verify(scheduler).addJob(jobDetail1, true); + verify(scheduler).rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1); + } + else { + verify(scheduler).getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); + } + verify(scheduler).addJob(jobDetail0, true); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } @Test @@ -313,39 +294,19 @@ public class QuartzSupportTests { trigger1.setRepeatInterval(20); trigger1.afterPropertiesSet(); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); - scheduler.getContext(); - schedulerControl.setReturnValue(new SchedulerContext()); - scheduler.getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(new SimpleTrigger()); + final Scheduler scheduler = mock(Scheduler.class); + given(scheduler.getContext()).willReturn(new SchedulerContext()); + given(scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP)).willReturn(new SimpleTrigger()); if (overwrite) { - scheduler.addJob(jobDetail1, true); - schedulerControl.setVoidCallable(); - scheduler.rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1); - schedulerControl.setReturnValue(new Date()); + given(scheduler.rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1)).willReturn(new Date()); } - else { - scheduler.getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - } - scheduler.addJob(jobDetail0, true); - schedulerControl.setVoidCallable(); - scheduler.scheduleJob(trigger0); - schedulerControl.setThrowable(new ObjectAlreadyExistsException("")); + given(scheduler.scheduleJob(trigger0)).willThrow(new ObjectAlreadyExistsException("")); if (overwrite) { - scheduler.rescheduleJob("myTrigger0", Scheduler.DEFAULT_GROUP, trigger0); - schedulerControl.setReturnValue(new Date()); + given(scheduler.rescheduleJob("myTrigger0", Scheduler.DEFAULT_GROUP, trigger0)).willReturn(new Date()); } - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -366,15 +327,25 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); + if (overwrite) { + verify(scheduler).addJob(jobDetail1, true); + verify(scheduler).rescheduleJob("myTrigger1", Scheduler.DEFAULT_GROUP, trigger1); + } + else { + verify(scheduler).getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); + } + verify(scheduler).addJob(jobDetail0, true); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } @Test public void testSchedulerFactoryBeanWithListeners() throws Exception { JobFactory jobFactory = new AdaptableJobFactory(); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); + final Scheduler scheduler = mock(Scheduler.class); SchedulerListener schedulerListener = new TestSchedulerListener(); JobListener globalJobListener = new TestJobListener(); @@ -382,25 +353,8 @@ public class QuartzSupportTests { TriggerListener globalTriggerListener = new TestTriggerListener(); TriggerListener triggerListener = new TestTriggerListener(); - scheduler.setJobFactory(jobFactory); - schedulerControl.setVoidCallable(); - scheduler.addSchedulerListener(schedulerListener); - schedulerControl.setVoidCallable(); - scheduler.addGlobalJobListener(globalJobListener); - schedulerControl.setVoidCallable(); - scheduler.addJobListener(jobListener); - schedulerControl.setVoidCallable(); - scheduler.addGlobalTriggerListener(globalTriggerListener); - schedulerControl.setVoidCallable(); - scheduler.addTriggerListener(triggerListener); - schedulerControl.setVoidCallable(); - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); - SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -419,18 +373,29 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).setJobFactory(jobFactory); + verify(scheduler).addSchedulerListener(schedulerListener); + verify(scheduler).addGlobalJobListener(globalJobListener); + verify(scheduler).addJobListener(jobListener); + verify(scheduler).addGlobalTriggerListener(globalTriggerListener); + verify(scheduler).addTriggerListener(triggerListener); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } - /*public void testMethodInvocationWithConcurrency() throws Exception { + @Ignore @Test + public void testMethodInvocationWithConcurrency() throws Exception { + Assume.group(TestGroup.PERFORMANCE); methodInvokingConcurrency(true); - }*/ + } // We can't test both since Quartz somehow seems to keep things in memory // enable both and one of them will fail (order doesn't matter). - /*public void testMethodInvocationWithoutConcurrency() throws Exception { + @Ignore @Test + public void testMethodInvocationWithoutConcurrency() throws Exception { + Assume.group(TestGroup.PERFORMANCE); methodInvokingConcurrency(false); - }*/ + } private void methodInvokingConcurrency(boolean concurrent) throws Exception { // Test the concurrency flag. @@ -543,33 +508,12 @@ public class QuartzSupportTests { trigger1.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); trigger1.setRepeatInterval(20); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); - scheduler.setJobFactory(jobFactory); - schedulerControl.setVoidCallable(); - scheduler.getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getJobDetail("myJob1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); - schedulerControl.setReturnValue(null); - scheduler.addJob(jobDetail0, true); - schedulerControl.setVoidCallable(); - scheduler.addJob(jobDetail1, true); - schedulerControl.setVoidCallable(); - scheduler.scheduleJob(trigger0); - schedulerControl.setReturnValue(new Date()); - scheduler.scheduleJob(trigger1); - schedulerControl.setReturnValue(new Date()); - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); + final Scheduler scheduler = mock(Scheduler.class); + given(scheduler.scheduleJob(trigger0)).willReturn(new Date()); + given(scheduler.scheduleJob(trigger1)).willReturn(new Date()); SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -585,7 +529,17 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).setJobFactory(jobFactory); + verify(scheduler).getJobDetail("myJob0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getJobDetail("myJob1", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger0", Scheduler.DEFAULT_GROUP); + verify(scheduler).getTrigger("myTrigger1", Scheduler.DEFAULT_GROUP); + verify(scheduler).addJob(jobDetail0, true); + verify(scheduler).addJob(jobDetail1, true); + verify(scheduler).scheduleJob(trigger0); + verify(scheduler).scheduleJob(trigger1); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } @Test @@ -593,18 +547,12 @@ public class QuartzSupportTests { TestBean tb = new TestBean("tb", 99); StaticApplicationContext ac = new StaticApplicationContext(); - MockControl schedulerControl = MockControl.createControl(Scheduler.class); - final Scheduler scheduler = (Scheduler) schedulerControl.getMock(); + final Scheduler scheduler = mock(Scheduler.class); SchedulerContext schedulerContext = new SchedulerContext(); - scheduler.getContext(); - schedulerControl.setReturnValue(schedulerContext, 4); - scheduler.start(); - schedulerControl.setVoidCallable(); - scheduler.shutdown(false); - schedulerControl.setVoidCallable(); - schedulerControl.replay(); + given(scheduler.getContext()).willReturn(schedulerContext); SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean() { + @Override protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName) { return scheduler; } @@ -626,7 +574,8 @@ public class QuartzSupportTests { schedulerFactoryBean.destroy(); } - schedulerControl.verify(); + verify(scheduler).start(); + verify(scheduler).shutdown(false); } @Test @@ -693,6 +642,8 @@ public class QuartzSupportTests { @Test public void testSchedulerWithTaskExecutor() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CountingTaskExecutor taskExecutor = new CountingTaskExecutor(); DummyJob.count = 0; @@ -724,6 +675,8 @@ public class QuartzSupportTests { @Test public void testSchedulerWithRunnable() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + DummyRunnable.count = 0; JobDetail jobDetail = new JobDetailBean(); @@ -752,6 +705,8 @@ public class QuartzSupportTests { @Test public void testSchedulerWithQuartzJobBean() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + DummyJob.param = 0; DummyJob.count = 0; @@ -783,6 +738,8 @@ public class QuartzSupportTests { @Test public void testSchedulerWithSpringBeanJobFactory() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + DummyJob.param = 0; DummyJob.count = 0; @@ -816,6 +773,7 @@ public class QuartzSupportTests { @Test public void testSchedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws Exception { + Assume.group(TestGroup.PERFORMANCE); DummyJob.param = 0; DummyJob.count = 0; @@ -850,6 +808,8 @@ public class QuartzSupportTests { @Test public void testSchedulerWithSpringBeanJobFactoryAndRunnable() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + DummyRunnable.param = 0; DummyRunnable.count = 0; @@ -882,6 +842,7 @@ public class QuartzSupportTests { @Test public void testSchedulerWithSpringBeanJobFactoryAndQuartzJobBean() throws Exception { + Assume.group(TestGroup.PERFORMANCE); DummyJobBean.param = 0; DummyJobBean.count = 0; @@ -914,6 +875,7 @@ public class QuartzSupportTests { @Test public void testSchedulerWithSpringBeanJobFactoryAndJobSchedulingData() throws Exception { + Assume.group(TestGroup.PERFORMANCE); DummyJob.param = 0; DummyJob.count = 0; @@ -952,6 +914,7 @@ public class QuartzSupportTests { @Test public void testWithTwoAnonymousMethodInvokingJobDetailFactoryBeans() throws InterruptedException { + Assume.group(TestGroup.PERFORMANCE); ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/org/springframework/scheduling/quartz/multipleAnonymousMethodInvokingJobDetailFB.xml"); Thread.sleep(3000); @@ -971,6 +934,7 @@ public class QuartzSupportTests { @Test public void testSchedulerAccessorBean() throws InterruptedException { + Assume.group(TestGroup.PERFORMANCE); ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/org/springframework/scheduling/quartz/schedulerAccessorBean.xml"); Thread.sleep(3000); @@ -1021,12 +985,14 @@ public class QuartzSupportTests { // SPR-6038: detect HSQL and stop illegal locks being taken @Test public void testSchedulerWithHsqlDataSource() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + DummyJob.param = 0; DummyJob.count = 0; ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( "/org/springframework/scheduling/quartz/databasePersistence.xml"); - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(ctx.getBean(DataSource.class)); + JdbcTemplate jdbcTemplate = new JdbcTemplate(ctx.getBean(DataSource.class)); assertTrue("No triggers were persisted", jdbcTemplate.queryForList("SELECT * FROM qrtz_triggers").size()>0); Thread.sleep(3000); try { @@ -1040,30 +1006,39 @@ public class QuartzSupportTests { private static class TestSchedulerListener implements SchedulerListener { + @Override public void jobScheduled(Trigger trigger) { } + @Override public void jobUnscheduled(String triggerName, String triggerGroup) { } + @Override public void triggerFinalized(Trigger trigger) { } + @Override public void triggersPaused(String triggerName, String triggerGroup) { } + @Override public void triggersResumed(String triggerName, String triggerGroup) { } + @Override public void jobsPaused(String jobName, String jobGroup) { } + @Override public void jobsResumed(String jobName, String jobGroup) { } + @Override public void schedulerError(String msg, SchedulerException cause) { } + @Override public void schedulerShutdown() { } } @@ -1071,16 +1046,20 @@ public class QuartzSupportTests { private static class TestJobListener implements JobListener { + @Override public String getName() { return null; } + @Override public void jobToBeExecuted(JobExecutionContext context) { } + @Override public void jobExecutionVetoed(JobExecutionContext context) { } + @Override public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { } } @@ -1088,20 +1067,25 @@ public class QuartzSupportTests { private static class TestTriggerListener implements TriggerListener { + @Override public String getName() { return null; } + @Override public void triggerFired(Trigger trigger, JobExecutionContext context) { } + @Override public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) { return false; } + @Override public void triggerMisfired(Trigger trigger) { } + @Override public void triggerComplete(Trigger trigger, JobExecutionContext context, int triggerInstructionCode) { } } @@ -1111,6 +1095,7 @@ public class QuartzSupportTests { private int count; + @Override public void execute(Runnable task) { this.count++; task.run(); @@ -1131,6 +1116,7 @@ public class QuartzSupportTests { param = value; } + @Override public synchronized void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { count++; } @@ -1150,6 +1136,7 @@ public class QuartzSupportTests { param = value; } + @Override protected synchronized void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { count++; } @@ -1169,6 +1156,7 @@ public class QuartzSupportTests { param = value; } + @Override public void run() { count++; } diff --git a/spring-context-support/src/test/java/org/springframework/ui/jasperreports/JasperReportsUtilsTests.java b/spring-context-support/src/test/java/org/springframework/ui/jasperreports/JasperReportsUtilsTests.java index 7e22fe88f75..7b9ebb44aac 100644 --- a/spring-context-support/src/test/java/org/springframework/ui/jasperreports/JasperReportsUtilsTests.java +++ b/spring-context-support/src/test/java/org/springframework/ui/jasperreports/JasperReportsUtilsTests.java @@ -198,7 +198,7 @@ public class JasperReportsUtilsTests extends TestCase { HSSFRow row = sheet.getRow(3); HSSFCell cell = row.getCell((short) 1); assertNotNull("Cell should not be null", cell); - assertEquals("Cell content should be Dear Lord!", "Dear Lord!", cell.getStringCellValue()); + assertEquals("Cell content should be Dear Lord!", "Dear Lord!", cell.getRichStringCellValue().getString()); } private JasperReport getReport() throws Exception { @@ -236,6 +236,7 @@ public class JasperReportsUtilsTests extends TestCase { private boolean invoked = false; + @Override public void afterPageExport() { this.invoked = true; } diff --git a/spring-context/src/main/java/org/springframework/cache/Cache.java b/spring-context/src/main/java/org/springframework/cache/Cache.java index 5035789d1ef..dbfa1cba84b 100644 --- a/spring-context/src/main/java/org/springframework/cache/Cache.java +++ b/spring-context/src/main/java/org/springframework/cache/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index 7116955e829..716b840ad0e 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java index cda9352b529..7c62a21af7a 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java b/spring-context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java index 5ff3aaf9e86..3b687a86dea 100644 --- a/spring-context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java +++ b/spring-context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ApplicationContext.java b/spring-context/src/main/java/org/springframework/context/ApplicationContext.java index 2565e481a3a..776e9f492b1 100644 --- a/spring-context/src/main/java/org/springframework/context/ApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/ApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ApplicationContextAware.java b/spring-context/src/main/java/org/springframework/context/ApplicationContextAware.java index 594af464c0d..c8a20ef17e0 100644 --- a/spring-context/src/main/java/org/springframework/context/ApplicationContextAware.java +++ b/spring-context/src/main/java/org/springframework/context/ApplicationContextAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ApplicationContextException.java b/spring-context/src/main/java/org/springframework/context/ApplicationContextException.java index 1068bb9126c..2a53416c090 100644 --- a/spring-context/src/main/java/org/springframework/context/ApplicationContextException.java +++ b/spring-context/src/main/java/org/springframework/context/ApplicationContextException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ApplicationEvent.java b/spring-context/src/main/java/org/springframework/context/ApplicationEvent.java index 464a440af60..e20d12cd858 100644 --- a/spring-context/src/main/java/org/springframework/context/ApplicationEvent.java +++ b/spring-context/src/main/java/org/springframework/context/ApplicationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ApplicationListener.java b/spring-context/src/main/java/org/springframework/context/ApplicationListener.java index d79e741cfff..a7eea9b5f92 100644 --- a/spring-context/src/main/java/org/springframework/context/ApplicationListener.java +++ b/spring-context/src/main/java/org/springframework/context/ApplicationListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/HierarchicalMessageSource.java b/spring-context/src/main/java/org/springframework/context/HierarchicalMessageSource.java index 3339abe70ed..d03b98774d5 100644 --- a/spring-context/src/main/java/org/springframework/context/HierarchicalMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/HierarchicalMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/Lifecycle.java b/spring-context/src/main/java/org/springframework/context/Lifecycle.java index b1d00e13f2c..cfc101e39b1 100644 --- a/spring-context/src/main/java/org/springframework/context/Lifecycle.java +++ b/spring-context/src/main/java/org/springframework/context/Lifecycle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/MessageSource.java b/spring-context/src/main/java/org/springframework/context/MessageSource.java index 62e1f9729b8..13f1530b31f 100644 --- a/spring-context/src/main/java/org/springframework/context/MessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/MessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/MessageSourceResolvable.java b/spring-context/src/main/java/org/springframework/context/MessageSourceResolvable.java index d344a6dadf8..965a44bbe77 100644 --- a/spring-context/src/main/java/org/springframework/context/MessageSourceResolvable.java +++ b/spring-context/src/main/java/org/springframework/context/MessageSourceResolvable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/NoSuchMessageException.java b/spring-context/src/main/java/org/springframework/context/NoSuchMessageException.java index 980464d36f1..777bd389b7f 100644 --- a/spring-context/src/main/java/org/springframework/context/NoSuchMessageException.java +++ b/spring-context/src/main/java/org/springframework/context/NoSuchMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/Phased.java b/spring-context/src/main/java/org/springframework/context/Phased.java index b4b84d86d94..e815988e963 100644 --- a/spring-context/src/main/java/org/springframework/context/Phased.java +++ b/spring-context/src/main/java/org/springframework/context/Phased.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/ResourceLoaderAware.java b/spring-context/src/main/java/org/springframework/context/ResourceLoaderAware.java index c13e5902f33..cf9edd7101d 100644 --- a/spring-context/src/main/java/org/springframework/context/ResourceLoaderAware.java +++ b/spring-context/src/main/java/org/springframework/context/ResourceLoaderAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/access/ContextBeanFactoryReference.java b/spring-context/src/main/java/org/springframework/context/access/ContextBeanFactoryReference.java index 4a608ec060c..b39ae885901 100644 --- a/spring-context/src/main/java/org/springframework/context/access/ContextBeanFactoryReference.java +++ b/spring-context/src/main/java/org/springframework/context/access/ContextBeanFactoryReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/access/ContextJndiBeanFactoryLocator.java b/spring-context/src/main/java/org/springframework/context/access/ContextJndiBeanFactoryLocator.java index 8372bb00b9a..54b66347ade 100644 --- a/spring-context/src/main/java/org/springframework/context/access/ContextJndiBeanFactoryLocator.java +++ b/spring-context/src/main/java/org/springframework/context/access/ContextJndiBeanFactoryLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/access/ContextSingletonBeanFactoryLocator.java b/spring-context/src/main/java/org/springframework/context/access/ContextSingletonBeanFactoryLocator.java index 2f9d9d5cc83..57df5694c88 100644 --- a/spring-context/src/main/java/org/springframework/context/access/ContextSingletonBeanFactoryLocator.java +++ b/spring-context/src/main/java/org/springframework/context/access/ContextSingletonBeanFactoryLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/access/DefaultLocatorFactory.java b/spring-context/src/main/java/org/springframework/context/access/DefaultLocatorFactory.java index 9b550724893..1ac558f5380 100644 --- a/spring-context/src/main/java/org/springframework/context/access/DefaultLocatorFactory.java +++ b/spring-context/src/main/java/org/springframework/context/access/DefaultLocatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java index f166faac358..5fcd8a572d0 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java b/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java index 9b6917c5804..b3f9450f983 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Scope.java b/spring-context/src/main/java/org/springframework/context/annotation/Scope.java index bcb433f5caf..2e556f51878 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Scope.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Scope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadata.java b/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadata.java index 2f67592b0fd..a13dfdd1933 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadata.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadataResolver.java b/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadataResolver.java index 03a8a1306f7..04fda90705a 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadataResolver.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ScopeMetadataResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/config/ContextNamespaceHandler.java b/spring-context/src/main/java/org/springframework/context/config/ContextNamespaceHandler.java index b095d47d980..1a758b60a94 100644 --- a/spring-context/src/main/java/org/springframework/context/config/ContextNamespaceHandler.java +++ b/spring-context/src/main/java/org/springframework/context/config/ContextNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java index 256ee620649..c7ad16ac501 100644 --- a/spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java b/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java index 822f3667f59..fa84458568e 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/ContextClosedEvent.java b/spring-context/src/main/java/org/springframework/context/event/ContextClosedEvent.java index abd68238384..8db8dc4dc7b 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ContextClosedEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ContextClosedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/ContextRefreshedEvent.java b/spring-context/src/main/java/org/springframework/context/event/ContextRefreshedEvent.java index b8f97520a4e..d18b3970d20 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ContextRefreshedEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ContextRefreshedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/ContextStartedEvent.java b/spring-context/src/main/java/org/springframework/context/event/ContextStartedEvent.java index d314430eeda..5033d7dbb74 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ContextStartedEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ContextStartedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/ContextStoppedEvent.java b/spring-context/src/main/java/org/springframework/context/event/ContextStoppedEvent.java index 4e089149c5f..98d95a8ceff 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ContextStoppedEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ContextStoppedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java b/spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java index abaddb72b36..ef32c7b6f7c 100644 --- a/spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java +++ b/spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java b/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java index dcaf8fc14eb..2e13855d4a5 100644 --- a/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java +++ b/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java index ac517852959..155fefbbc1b 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java +++ b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/i18n/LocaleContextHolder.java b/spring-context/src/main/java/org/springframework/context/i18n/LocaleContextHolder.java index 6ace3993339..2ca6ea2f85c 100644 --- a/spring-context/src/main/java/org/springframework/context/i18n/LocaleContextHolder.java +++ b/spring-context/src/main/java/org/springframework/context/i18n/LocaleContextHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/i18n/SimpleLocaleContext.java b/spring-context/src/main/java/org/springframework/context/i18n/SimpleLocaleContext.java index b21e35e772b..d3848ebe0a9 100644 --- a/spring-context/src/main/java/org/springframework/context/i18n/SimpleLocaleContext.java +++ b/spring-context/src/main/java/org/springframework/context/i18n/SimpleLocaleContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/AbstractMessageSource.java index a7f44dca16c..768c963d3b5 100644 --- a/spring-context/src/main/java/org/springframework/context/support/AbstractMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/AbstractMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java index 547f7519eec..44ba2589d8d 100644 --- a/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableConfigApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableConfigApplicationContext.java index 5e8377c999e..138f45526cd 100644 --- a/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableConfigApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableConfigApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java index 3f88a900dbd..1e7681aa0ba 100644 --- a/spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/AbstractXmlApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java b/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java index a2ce34e6ad6..e88b26799cf 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java b/spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java index a872b76b782..ebee90cc033 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java +++ b/spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java b/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java index 6930177dedc..f81020673de 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java +++ b/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/ConversionServiceFactoryBean.java b/spring-context/src/main/java/org/springframework/context/support/ConversionServiceFactoryBean.java index 32bb029c0a6..95b40263edc 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ConversionServiceFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/context/support/ConversionServiceFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java b/spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java index b05eeaa4e79..e668c4e7368 100644 --- a/spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java +++ b/spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java index a1e4fdababb..7c3d8bcc114 100644 --- a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/GenericXmlApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/GenericXmlApplicationContext.java index 5384a333bea..e120f667fb5 100644 --- a/spring-context/src/main/java/org/springframework/context/support/GenericXmlApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/GenericXmlApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java b/spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java index e026e5c98f0..03fa94a5256 100644 --- a/spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java +++ b/spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/MessageSourceResourceBundle.java b/spring-context/src/main/java/org/springframework/context/support/MessageSourceResourceBundle.java index 4dd8bce3511..8dc2c1ffb3e 100644 --- a/spring-context/src/main/java/org/springframework/context/support/MessageSourceResourceBundle.java +++ b/spring-context/src/main/java/org/springframework/context/support/MessageSourceResourceBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java index 6c8cbc99d76..30aad8a078b 100644 --- a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java +++ b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/weaving/DefaultContextLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/context/weaving/DefaultContextLoadTimeWeaver.java index 4e82ef9cdb1..495f3c70259 100644 --- a/spring-context/src/main/java/org/springframework/context/weaving/DefaultContextLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/context/weaving/DefaultContextLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -56,6 +56,7 @@ import org.springframework.instrument.classloading.websphere.WebSphereLoadTimeWe * @since 2.5 * @see org.springframework.context.ConfigurableApplicationContext#LOAD_TIME_WEAVER_BEAN_NAME */ +@SuppressWarnings("deprecation") public class DefaultContextLoadTimeWeaver implements LoadTimeWeaver, BeanClassLoaderAware, DisposableBean { protected final Log logger = LogFactory.getLog(getClass()); diff --git a/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAware.java b/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAware.java index 6c87480fe41..0f67d7aba6f 100644 --- a/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAware.java +++ b/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAwareProcessor.java b/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAwareProcessor.java index 58ac5f4254f..d2c704f1a50 100644 --- a/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAwareProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/weaving/LoadTimeWeaverAwareProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java b/spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java index c80aef379b6..1af0997e643 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/AbstractSlsbInvokerInterceptor.java b/spring-context/src/main/java/org/springframework/ejb/access/AbstractSlsbInvokerInterceptor.java index 652205cd526..8a12977c8a4 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/AbstractSlsbInvokerInterceptor.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/AbstractSlsbInvokerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/EjbAccessException.java b/spring-context/src/main/java/org/springframework/ejb/access/EjbAccessException.java index e3332791d5b..3d555779e90 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/EjbAccessException.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/EjbAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptor.java b/spring-context/src/main/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptor.java index 789130620c6..7a27feafa29 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptor.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java b/spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java index 3058f699aad..c824d4c9171 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor.java b/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor.java index c459d22a9ae..ce39ce9a6cd 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java b/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java index 6bcb7753195..de6a45b1fef 100644 --- a/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/config/JeeNamespaceHandler.java b/spring-context/src/main/java/org/springframework/ejb/config/JeeNamespaceHandler.java index b5841ca19dd..2e106d8ed0f 100644 --- a/spring-context/src/main/java/org/springframework/ejb/config/JeeNamespaceHandler.java +++ b/spring-context/src/main/java/org/springframework/ejb/config/JeeNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/config/JndiLookupBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/ejb/config/JndiLookupBeanDefinitionParser.java index 81ea064909f..6b616ace255 100644 --- a/spring-context/src/main/java/org/springframework/ejb/config/JndiLookupBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/ejb/config/JndiLookupBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/config/LocalStatelessSessionBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/ejb/config/LocalStatelessSessionBeanDefinitionParser.java index eeb2191cf73..c5caff9ef5e 100644 --- a/spring-context/src/main/java/org/springframework/ejb/config/LocalStatelessSessionBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/ejb/config/LocalStatelessSessionBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/config/RemoteStatelessSessionBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/ejb/config/RemoteStatelessSessionBeanDefinitionParser.java index 0b1669a4071..30469ead505 100644 --- a/spring-context/src/main/java/org/springframework/ejb/config/RemoteStatelessSessionBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/ejb/config/RemoteStatelessSessionBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.java b/spring-context/src/main/java/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.java index 73499993283..89d50674517 100644 --- a/spring-context/src/main/java/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.java +++ b/spring-context/src/main/java/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractEnterpriseBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractEnterpriseBean.java index 801ffcd0427..aaa6f7adff7 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractEnterpriseBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractEnterpriseBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractJmsMessageDrivenBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractJmsMessageDrivenBean.java index 26bdd8b79b0..ecfb7baa985 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractJmsMessageDrivenBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractJmsMessageDrivenBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractMessageDrivenBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractMessageDrivenBean.java index e87447b648c..bbfc158cbbb 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractMessageDrivenBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractMessageDrivenBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractSessionBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractSessionBean.java index edf66f329ce..5f4e2770b7e 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractSessionBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatefulSessionBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatefulSessionBean.java index bbd9079b263..49716db8344 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatefulSessionBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatefulSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatelessSessionBean.java b/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatelessSessionBean.java index 2f91d248a4a..ee013df6cb1 100644 --- a/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatelessSessionBean.java +++ b/spring-context/src/main/java/org/springframework/ejb/support/AbstractStatelessSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/AnnotationFormatterFactory.java b/spring-context/src/main/java/org/springframework/format/AnnotationFormatterFactory.java index 0a620e9e8c5..fb539380114 100644 --- a/spring-context/src/main/java/org/springframework/format/AnnotationFormatterFactory.java +++ b/spring-context/src/main/java/org/springframework/format/AnnotationFormatterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/Formatter.java b/spring-context/src/main/java/org/springframework/format/Formatter.java index 83d26b13a75..a1bbebc4463 100644 --- a/spring-context/src/main/java/org/springframework/format/Formatter.java +++ b/spring-context/src/main/java/org/springframework/format/Formatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/FormatterRegistrar.java b/spring-context/src/main/java/org/springframework/format/FormatterRegistrar.java index b754a738d10..96059b463b0 100644 --- a/spring-context/src/main/java/org/springframework/format/FormatterRegistrar.java +++ b/spring-context/src/main/java/org/springframework/format/FormatterRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/FormatterRegistry.java b/spring-context/src/main/java/org/springframework/format/FormatterRegistry.java index 5613c74eb81..eb6d3f130c8 100644 --- a/spring-context/src/main/java/org/springframework/format/FormatterRegistry.java +++ b/spring-context/src/main/java/org/springframework/format/FormatterRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/Parser.java b/spring-context/src/main/java/org/springframework/format/Parser.java index 276a509305a..ed62cc4e10d 100644 --- a/spring-context/src/main/java/org/springframework/format/Parser.java +++ b/spring-context/src/main/java/org/springframework/format/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/Printer.java b/spring-context/src/main/java/org/springframework/format/Printer.java index c8528398584..ce2d5d85a8e 100644 --- a/spring-context/src/main/java/org/springframework/format/Printer.java +++ b/spring-context/src/main/java/org/springframework/format/Printer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java b/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java index 55de49ff82c..e4f1076ea7b 100644 --- a/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java +++ b/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContext.java b/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContext.java index c15a36eb8c4..f80fcd62426 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContext.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java b/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java index f1f0a76bfe2..85ca71044a6 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/number/AbstractNumberFormatter.java b/spring-context/src/main/java/org/springframework/format/number/AbstractNumberFormatter.java index ad3c1d4137d..da34f935bc2 100644 --- a/spring-context/src/main/java/org/springframework/format/number/AbstractNumberFormatter.java +++ b/spring-context/src/main/java/org/springframework/format/number/AbstractNumberFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/number/NumberFormatAnnotationFormatterFactory.java b/spring-context/src/main/java/org/springframework/format/number/NumberFormatAnnotationFormatterFactory.java index 00c14d8a7d2..2108d9f5ae8 100644 --- a/spring-context/src/main/java/org/springframework/format/number/NumberFormatAnnotationFormatterFactory.java +++ b/spring-context/src/main/java/org/springframework/format/number/NumberFormatAnnotationFormatterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java b/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java index a86ccf2c5ff..2dc19dda744 100644 --- a/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/InstrumentationLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/InstrumentationLoadTimeWeaver.java index 8a4422d93e9..94316c8f6d8 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/InstrumentationLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/InstrumentationLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/LoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/LoadTimeWeaver.java index 74b24b9b909..166f1deb3e6 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/LoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/LoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaver.java index 9e143d576ac..86907d33ddc 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoader.java b/spring-context/src/main/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoader.java index 7cf9200abc4..3d15f1035ce 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoader.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleInstrumentableClassLoader.java b/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleInstrumentableClassLoader.java index b13ba8bd63a..e35bd31fcb7 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleInstrumentableClassLoader.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleInstrumentableClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleLoadTimeWeaver.java index ab17d2a991d..a421f0418e0 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/SimpleLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishClassLoaderAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishClassLoaderAdapter.java index d5568e3b8d3..92b997d615e 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishClassLoaderAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishClassLoaderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaver.java index 2ad5bcf0162..eb28f67ddf9 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCAdapter.java index 0777391ad51..a128608d84d 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCTranslatorAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCTranslatorAdapter.java index b5e1cd4ec3a..8325e1b7982 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCTranslatorAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCTranslatorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassLoaderAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassLoaderAdapter.java index d3821e795e0..723a947e1ab 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassLoaderAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassLoaderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassPreprocessorAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassPreprocessorAdapter.java index 06498c5aefa..dce57618981 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassPreprocessorAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/oc4j/OC4JClassPreprocessorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassLoaderAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassLoaderAdapter.java index eb6f98b7dc0..03b49e13260 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassLoaderAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassLoaderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java index 087872adedb..aede3544be8 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicLoadTimeWeaver.java index 4197c2f0445..6662830c73a 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.java b/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.java index 5d952e0a9e2..c95684c4d69 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereLoadTimeWeaver.java b/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereLoadTimeWeaver.java index 215c8d5735c..3312c377783 100644 --- a/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereLoadTimeWeaver.java +++ b/spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereLoadTimeWeaver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/JmxException.java b/spring-context/src/main/java/org/springframework/jmx/JmxException.java index bbddbc3ec23..b7baa2eb6cc 100644 --- a/spring-context/src/main/java/org/springframework/jmx/JmxException.java +++ b/spring-context/src/main/java/org/springframework/jmx/JmxException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/MBeanServerNotFoundException.java b/spring-context/src/main/java/org/springframework/jmx/MBeanServerNotFoundException.java index 231fcfec8d8..7c3155f10e9 100644 --- a/spring-context/src/main/java/org/springframework/jmx/MBeanServerNotFoundException.java +++ b/spring-context/src/main/java/org/springframework/jmx/MBeanServerNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/ConnectorDelegate.java b/spring-context/src/main/java/org/springframework/jmx/access/ConnectorDelegate.java index 7f987272cfd..115d0b3d66a 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/ConnectorDelegate.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/ConnectorDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/InvalidInvocationException.java b/spring-context/src/main/java/org/springframework/jmx/access/InvalidInvocationException.java index fb1f10b411c..af785e472b6 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/InvalidInvocationException.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/InvalidInvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/InvocationFailureException.java b/spring-context/src/main/java/org/springframework/jmx/access/InvocationFailureException.java index a52413179b9..e9bf348cc9f 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/InvocationFailureException.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/InvocationFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java b/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java index 761996d8ba4..36894535ed3 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/MBeanConnectFailureException.java b/spring-context/src/main/java/org/springframework/jmx/access/MBeanConnectFailureException.java index 2e2a9588d26..89354926ee2 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/MBeanConnectFailureException.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/MBeanConnectFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/MBeanInfoRetrievalException.java b/spring-context/src/main/java/org/springframework/jmx/access/MBeanInfoRetrievalException.java index b14e4d98d1b..fac8f2dc531 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/MBeanInfoRetrievalException.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/MBeanInfoRetrievalException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/MBeanProxyFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/access/MBeanProxyFactoryBean.java index 26fcda79bf6..466a4ff8fbc 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/MBeanProxyFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/MBeanProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/access/NotificationListenerRegistrar.java b/spring-context/src/main/java/org/springframework/jmx/access/NotificationListenerRegistrar.java index c600f1279d9..bb0b2021de8 100644 --- a/spring-context/src/main/java/org/springframework/jmx/access/NotificationListenerRegistrar.java +++ b/spring-context/src/main/java/org/springframework/jmx/access/NotificationListenerRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExportException.java b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExportException.java index 2d31820e7b1..9321cca9258 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExportException.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java index 9969b74383f..9e94a66df39 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporterListener.java b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporterListener.java index 18b0c14b2d9..d8a62beea12 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporterListener.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporterListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/UnableToRegisterMBeanException.java b/spring-context/src/main/java/org/springframework/jmx/export/UnableToRegisterMBeanException.java index 821d0cafb4c..610078c6769 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/UnableToRegisterMBeanException.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/UnableToRegisterMBeanException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java index f6868aeb9f9..5adfc012a9e 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java index bc8b02d6f3a..1ddbd3400f4 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java index 1bef5da10b3..8c01f19195b 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java index ef5a2534b55..d5d1f3a7743 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractMBeanInfoAssembler.java index 07f976c0e97..ce2c24a1850 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AutodetectCapableMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AutodetectCapableMBeanInfoAssembler.java index 1d5233570db..ef345cb710a 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/AutodetectCapableMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/AutodetectCapableMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java index 538e247121c..e464fa234bf 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MBeanInfoAssembler.java index 32a713b399c..1bb200b8621 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java index 0a05442500b..320a64790e1 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java index b3ba402b6b2..e092c221cda 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssembler.java index a28e57b465f..c4467ab58ac 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/assembler/SimpleReflectiveMBeanInfoAssembler.java b/spring-context/src/main/java/org/springframework/jmx/export/assembler/SimpleReflectiveMBeanInfoAssembler.java index 9fbad2dd3bd..25ef5084bd9 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/assembler/SimpleReflectiveMBeanInfoAssembler.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/assembler/SimpleReflectiveMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/metadata/InvalidMetadataException.java b/spring-context/src/main/java/org/springframework/jmx/export/metadata/InvalidMetadataException.java index 7c6c59c0066..2bc8b2663d2 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/metadata/InvalidMetadataException.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/metadata/InvalidMetadataException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/metadata/JmxAttributeSource.java b/spring-context/src/main/java/org/springframework/jmx/export/metadata/JmxAttributeSource.java index dec9a77ea83..8861079de22 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/metadata/JmxAttributeSource.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/metadata/JmxAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedResource.java b/spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedResource.java index 93b6d1193f2..9fd41123c2d 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedResource.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java b/spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java index f1830613329..1e9e4ff4328 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/naming/KeyNamingStrategy.java b/spring-context/src/main/java/org/springframework/jmx/export/naming/KeyNamingStrategy.java index 65efbb76f70..07b459910d6 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/naming/KeyNamingStrategy.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/naming/KeyNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/naming/MetadataNamingStrategy.java b/spring-context/src/main/java/org/springframework/jmx/export/naming/MetadataNamingStrategy.java index ba4d86085ab..f1d138d38bd 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/naming/MetadataNamingStrategy.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/naming/MetadataNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/naming/ObjectNamingStrategy.java b/spring-context/src/main/java/org/springframework/jmx/export/naming/ObjectNamingStrategy.java index edfe3f81dca..cfbda068c0d 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/naming/ObjectNamingStrategy.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/naming/ObjectNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/naming/SelfNaming.java b/spring-context/src/main/java/org/springframework/jmx/export/naming/SelfNaming.java index 74fe92ec2b5..cf083c76982 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/naming/SelfNaming.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/naming/SelfNaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisher.java b/spring-context/src/main/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisher.java index 170c1c35d2a..1c94273bbb2 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisher.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/notification/NotificationPublisher.java b/spring-context/src/main/java/org/springframework/jmx/export/notification/NotificationPublisher.java index 64d4dcbfe10..068b7a5a603 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/notification/NotificationPublisher.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/notification/NotificationPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/export/notification/UnableToSendNotificationException.java b/spring-context/src/main/java/org/springframework/jmx/export/notification/UnableToSendNotificationException.java index 7c2c98f0f44..7996ffc9530 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/notification/UnableToSendNotificationException.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/notification/UnableToSendNotificationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java index 888e7eb1cf0..a717b8a1abd 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java b/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java index 9d95040119a..1308f350876 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java index 00e0ffba6be..3d9b82bc34e 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerFactoryBean.java index 304780f6937..61b1086a4ca 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/MBeanServerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/NotificationListenerHolder.java b/spring-context/src/main/java/org/springframework/jmx/support/NotificationListenerHolder.java index bce56721385..bc508386791 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/NotificationListenerHolder.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/NotificationListenerHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java b/spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java index f6621a1dee4..cf63334eeee 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jmx/support/WebSphereMBeanServerFactoryBean.java b/spring-context/src/main/java/org/springframework/jmx/support/WebSphereMBeanServerFactoryBean.java index 52a2ab42e40..5cd37f3d659 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/WebSphereMBeanServerFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/WebSphereMBeanServerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java b/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java index 325c4f8170e..c7845ec84cc 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiLocatorDelegate.java b/spring-context/src/main/java/org/springframework/jndi/JndiLocatorDelegate.java index 0f266c64eaa..cd7ed962884 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiLocatorDelegate.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiLocatorDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiLookupFailureException.java b/spring-context/src/main/java/org/springframework/jndi/JndiLookupFailureException.java index 9eb73086abd..c168b562179 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiLookupFailureException.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiLookupFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java b/spring-context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java index a2d6b6a04c4..5a9bb616b18 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java b/spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java index 168edb1bc6e..441a113d88e 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiTemplateEditor.java b/spring-context/src/main/java/org/springframework/jndi/JndiTemplateEditor.java index dd4f4e2d279..9607258534a 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiTemplateEditor.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiTemplateEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/TypeMismatchNamingException.java b/spring-context/src/main/java/org/springframework/jndi/TypeMismatchNamingException.java index 16e1d15cc48..f5ec23bc468 100644 --- a/spring-context/src/main/java/org/springframework/jndi/TypeMismatchNamingException.java +++ b/spring-context/src/main/java/org/springframework/jndi/TypeMismatchNamingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java b/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java index a123d72cb61..f565f37edf6 100644 --- a/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java +++ b/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/RemoteConnectFailureException.java b/spring-context/src/main/java/org/springframework/remoting/RemoteConnectFailureException.java index 063c94826a0..f0464c4f395 100644 --- a/spring-context/src/main/java/org/springframework/remoting/RemoteConnectFailureException.java +++ b/spring-context/src/main/java/org/springframework/remoting/RemoteConnectFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/RemoteInvocationFailureException.java b/spring-context/src/main/java/org/springframework/remoting/RemoteInvocationFailureException.java index 027ca75078e..35fb4af377d 100644 --- a/spring-context/src/main/java/org/springframework/remoting/RemoteInvocationFailureException.java +++ b/spring-context/src/main/java/org/springframework/remoting/RemoteInvocationFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/RemoteLookupFailureException.java b/spring-context/src/main/java/org/springframework/remoting/RemoteLookupFailureException.java index 48ba3ccab39..388fe868e6d 100644 --- a/spring-context/src/main/java/org/springframework/remoting/RemoteLookupFailureException.java +++ b/spring-context/src/main/java/org/springframework/remoting/RemoteLookupFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/RemoteProxyFailureException.java b/spring-context/src/main/java/org/springframework/remoting/RemoteProxyFailureException.java index c1bd8f080fd..476123fce04 100644 --- a/spring-context/src/main/java/org/springframework/remoting/RemoteProxyFailureException.java +++ b/spring-context/src/main/java/org/springframework/remoting/RemoteProxyFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/CodebaseAwareObjectInputStream.java b/spring-context/src/main/java/org/springframework/remoting/rmi/CodebaseAwareObjectInputStream.java index 8e0401d6fbc..1bea9c145f7 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/CodebaseAwareObjectInputStream.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/CodebaseAwareObjectInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiClientInterceptor.java b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiClientInterceptor.java index 55461ba33ef..8660e2cf5be 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiClientInterceptor.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiProxyFactoryBean.java b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiProxyFactoryBean.java index 78b9f36a21c..b4e884e2606 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiProxyFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiServiceExporter.java b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiServiceExporter.java index fb2bab26a50..180ba0f5633 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiServiceExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java index 3a8c2c5ceb8..d4673dbff6f 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiBasedExporter.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiBasedExporter.java index 265d2f7034c..431b4e6a0a1 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiBasedExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiBasedExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptor.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptor.java index 177b1982e95..ba9d8775d99 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptor.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java index 30c18ec60b8..1a9d8413a3c 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationHandler.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationHandler.java index d878cb33baf..77ddbaf44f3 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationHandler.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java index 5d028402bc7..22cac7f71f0 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiProxyFactoryBean.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiProxyFactoryBean.java index ff2687a7514..a635a1fa599 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiProxyFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiRegistryFactoryBean.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiRegistryFactoryBean.java index 275c8b532bd..fee68ce8d73 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiRegistryFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiRegistryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java index 6f01f80e33d..dcd5f91f85b 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/soap/SoapFaultException.java b/spring-context/src/main/java/org/springframework/remoting/soap/SoapFaultException.java index 7a3dc51aa49..8523ab97edd 100644 --- a/spring-context/src/main/java/org/springframework/remoting/soap/SoapFaultException.java +++ b/spring-context/src/main/java/org/springframework/remoting/soap/SoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteAccessor.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteAccessor.java index 6956ee370a2..2cf59d0d747 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteAccessor.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteExporter.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteExporter.java index b68a6cfd22b..91f87ff65d3 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java index dc83e38c417..afb5dd37d48 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedAccessor.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedAccessor.java index 8bf4bfe4c55..36324bf66fa 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedAccessor.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationResult.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationResult.java index e6c7a27e780..3348b7a839f 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationResult.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationUtils.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationUtils.java index 7ed9e72b6e5..05c521c7f00 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationUtils.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemotingSupport.java b/spring-context/src/main/java/org/springframework/remoting/support/RemotingSupport.java index fb95016a49d..832d4899629 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemotingSupport.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemotingSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java b/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java index 9efdba4fc24..4dffa2335f1 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java +++ b/spring-context/src/main/java/org/springframework/scheduling/SchedulingAwareRunnable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/SchedulingException.java b/spring-context/src/main/java/org/springframework/scheduling/SchedulingException.java index 4d59efa3907..468c2073947 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/SchedulingException.java +++ b/spring-context/src/main/java/org/springframework/scheduling/SchedulingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java index b5674139855..deef622f854 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/SchedulingTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/TaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/TaskScheduler.java index b18e7baa58a..defd101789f 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/TaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/TaskScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/Trigger.java b/spring-context/src/main/java/org/springframework/scheduling/Trigger.java index 06f569011a0..4c8d9a1ed73 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/Trigger.java +++ b/spring-context/src/main/java/org/springframework/scheduling/Trigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/TriggerContext.java b/spring-context/src/main/java/org/springframework/scheduling/TriggerContext.java index 5ba5980b1b7..feeb2ecea6e 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/TriggerContext.java +++ b/spring-context/src/main/java/org/springframework/scheduling/TriggerContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java index 4f0ee681836..f657d306804 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java index cc1fa39abd8..8d88bf85dd5 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutor.java index ff7760c8363..d4672431311 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/CustomizableThreadFactory.java b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/CustomizableThreadFactory.java index 8fe217f52b0..8cfb86f2b33 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/CustomizableThreadFactory.java +++ b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/CustomizableThreadFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ThreadPoolTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ThreadPoolTaskExecutor.java index b24b0935e7b..ca237fe1af2 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ThreadPoolTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/backportconcurrent/ThreadPoolTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java index bc9cf37b9f5..ea5bc9ca890 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java index bd41c76a418..b972db06017 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java index 6665e3836ec..7ac8d4790e6 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.java index 92d7d2007d0..964872e1d6e 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ExecutorConfigurationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index 911ecd99229..40d48ad2955 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java index 6eadb637390..07d8c02199f 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java index ae9a96ec741..19cd880bbb7 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java index 1a7da1d6163..31dc69d553b 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java index 4d03d5c57cd..e8961e05e36 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/config/AnnotationDrivenBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/scheduling/config/AnnotationDrivenBeanDefinitionParser.java index 009a163c28b..39b86694d23 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/config/AnnotationDrivenBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/scheduling/config/AnnotationDrivenBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/config/SchedulerBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/scheduling/config/SchedulerBeanDefinitionParser.java index be34e5ad191..7f76bfc8307 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/config/SchedulerBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/scheduling/config/SchedulerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/config/TaskNamespaceHandler.java b/spring-context/src/main/java/org/springframework/scheduling/config/TaskNamespaceHandler.java index 12e8aeab076..6ba1d5a552d 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/config/TaskNamespaceHandler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/config/TaskNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java b/spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java index 3f5459e61e8..b3530ebf785 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java +++ b/spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java b/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java index 09df2374daa..eca37982e6d 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java +++ b/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java b/spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java index 07a18033970..b494e4c5ff0 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java +++ b/spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/TaskUtils.java b/spring-context/src/main/java/org/springframework/scheduling/support/TaskUtils.java index 4800543853b..81c16bc9a5b 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/support/TaskUtils.java +++ b/spring-context/src/main/java/org/springframework/scheduling/support/TaskUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java b/spring-context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java index 677daa138dd..60095136923 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java +++ b/spring-context/src/main/java/org/springframework/scheduling/timer/DelegatingTimerTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java index 241a96c7cc1..389e9a76b9f 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/timer/MethodInvokingTimerTaskFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java b/spring-context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java index f1885b9701a..90a34dabcf1 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java +++ b/spring-context/src/main/java/org/springframework/scheduling/timer/ScheduledTimerTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java index 6ddccd151aa..c0de9b4eb91 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/timer/TimerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java index 42626b4e816..03979dc45af 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/timer/TimerTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java b/spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java index e6a5cf238f7..ccb86745006 100644 --- a/spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java +++ b/spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/ScriptFactory.java b/spring-context/src/main/java/org/springframework/scripting/ScriptFactory.java index c2d360fa22b..2e2f255ae7e 100644 --- a/spring-context/src/main/java/org/springframework/scripting/ScriptFactory.java +++ b/spring-context/src/main/java/org/springframework/scripting/ScriptFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/ScriptSource.java b/spring-context/src/main/java/org/springframework/scripting/ScriptSource.java index a3ccb89ed4d..2e5a37e4d48 100644 --- a/spring-context/src/main/java/org/springframework/scripting/ScriptSource.java +++ b/spring-context/src/main/java/org/springframework/scripting/ScriptSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptFactory.java b/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptFactory.java index 3f079267c61..2d94a16cb8f 100644 --- a/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptFactory.java +++ b/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java b/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java index 6c8f6ea616f..d71298e29cf 100644 --- a/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java +++ b/spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/config/LangNamespaceHandler.java b/spring-context/src/main/java/org/springframework/scripting/config/LangNamespaceHandler.java index 8e2b115e549..e66455a8d69 100644 --- a/spring-context/src/main/java/org/springframework/scripting/config/LangNamespaceHandler.java +++ b/spring-context/src/main/java/org/springframework/scripting/config/LangNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/config/ScriptBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/scripting/config/ScriptBeanDefinitionParser.java index 4cde7aa0632..23cfe64423f 100644 --- a/spring-context/src/main/java/org/springframework/scripting/config/ScriptBeanDefinitionParser.java +++ b/spring-context/src/main/java/org/springframework/scripting/config/ScriptBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -99,6 +99,7 @@ class ScriptBeanDefinitionParser extends AbstractBeanDefinitionParser { * Registers a {@link ScriptFactoryPostProcessor} if needed. */ @Override + @SuppressWarnings("deprecation") protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { // Resolve the script source. String value = resolveScriptSource(element, parserContext.getReaderContext()); diff --git a/spring-context/src/main/java/org/springframework/scripting/config/ScriptingDefaultsParser.java b/spring-context/src/main/java/org/springframework/scripting/config/ScriptingDefaultsParser.java index ee87c286783..d0766b95f40 100644 --- a/spring-context/src/main/java/org/springframework/scripting/config/ScriptingDefaultsParser.java +++ b/spring-context/src/main/java/org/springframework/scripting/config/ScriptingDefaultsParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyObjectCustomizer.java b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyObjectCustomizer.java index b8dd3e967a2..cb4f5b1c17d 100644 --- a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyObjectCustomizer.java +++ b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyObjectCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java index d984d10cdad..e40871defb7 100644 --- a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java +++ b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/jruby/JRubyScriptUtils.java b/spring-context/src/main/java/org/springframework/scripting/jruby/JRubyScriptUtils.java index 318b83e1a5e..97b9a3bc43d 100644 --- a/spring-context/src/main/java/org/springframework/scripting/jruby/JRubyScriptUtils.java +++ b/spring-context/src/main/java/org/springframework/scripting/jruby/JRubyScriptUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -75,6 +75,7 @@ public abstract class JRubyScriptUtils { * @return the scripted Java object * @throws JumpException in case of JRuby parsing failure */ + @SuppressWarnings("deprecation") public static Object createJRubyObject(String scriptSource, Class[] interfaces, ClassLoader classLoader) { Ruby ruby = initializeRuntime(); diff --git a/spring-context/src/main/java/org/springframework/scripting/support/RefreshableScriptTargetSource.java b/spring-context/src/main/java/org/springframework/scripting/support/RefreshableScriptTargetSource.java index 9103452d03d..68ba19653f7 100644 --- a/spring-context/src/main/java/org/springframework/scripting/support/RefreshableScriptTargetSource.java +++ b/spring-context/src/main/java/org/springframework/scripting/support/RefreshableScriptTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/support/ResourceScriptSource.java b/spring-context/src/main/java/org/springframework/scripting/support/ResourceScriptSource.java index c3cce13a7f1..23be717eacd 100644 --- a/spring-context/src/main/java/org/springframework/scripting/support/ResourceScriptSource.java +++ b/spring-context/src/main/java/org/springframework/scripting/support/ResourceScriptSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/scripting/support/StaticScriptSource.java b/spring-context/src/main/java/org/springframework/scripting/support/StaticScriptSource.java index abacdd4bfa4..5afede47a8f 100644 --- a/spring-context/src/main/java/org/springframework/scripting/support/StaticScriptSource.java +++ b/spring-context/src/main/java/org/springframework/scripting/support/StaticScriptSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/ExtendedModelMap.java b/spring-context/src/main/java/org/springframework/ui/ExtendedModelMap.java index 4d4f37bb167..b2710d4bde5 100644 --- a/spring-context/src/main/java/org/springframework/ui/ExtendedModelMap.java +++ b/spring-context/src/main/java/org/springframework/ui/ExtendedModelMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/Model.java b/spring-context/src/main/java/org/springframework/ui/Model.java index d68710fc618..4a51e9182c8 100644 --- a/spring-context/src/main/java/org/springframework/ui/Model.java +++ b/spring-context/src/main/java/org/springframework/ui/Model.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/ModelMap.java b/spring-context/src/main/java/org/springframework/ui/ModelMap.java index 28a6a687b5e..238b0d9d7a7 100644 --- a/spring-context/src/main/java/org/springframework/ui/ModelMap.java +++ b/spring-context/src/main/java/org/springframework/ui/ModelMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/context/HierarchicalThemeSource.java b/spring-context/src/main/java/org/springframework/ui/context/HierarchicalThemeSource.java index a67f083cd0d..e20db315c93 100644 --- a/spring-context/src/main/java/org/springframework/ui/context/HierarchicalThemeSource.java +++ b/spring-context/src/main/java/org/springframework/ui/context/HierarchicalThemeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/context/Theme.java b/spring-context/src/main/java/org/springframework/ui/context/Theme.java index 6dc815ef07e..a2ef92602f2 100644 --- a/spring-context/src/main/java/org/springframework/ui/context/Theme.java +++ b/spring-context/src/main/java/org/springframework/ui/context/Theme.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/context/ThemeSource.java b/spring-context/src/main/java/org/springframework/ui/context/ThemeSource.java index a4a7e8704cb..85c676aa06e 100644 --- a/spring-context/src/main/java/org/springframework/ui/context/ThemeSource.java +++ b/spring-context/src/main/java/org/springframework/ui/context/ThemeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/context/support/ResourceBundleThemeSource.java b/spring-context/src/main/java/org/springframework/ui/context/support/ResourceBundleThemeSource.java index 4cf80c84c08..a0c195df32e 100644 --- a/spring-context/src/main/java/org/springframework/ui/context/support/ResourceBundleThemeSource.java +++ b/spring-context/src/main/java/org/springframework/ui/context/support/ResourceBundleThemeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/ui/context/support/UiApplicationContextUtils.java b/spring-context/src/main/java/org/springframework/ui/context/support/UiApplicationContextUtils.java index e65da9b4bc3..e1c5956efa7 100644 --- a/spring-context/src/main/java/org/springframework/ui/context/support/UiApplicationContextUtils.java +++ b/spring-context/src/main/java/org/springframework/ui/context/support/UiApplicationContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java b/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java index 60d13648882..3ab515bc890 100644 --- a/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java +++ b/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/AbstractPropertyBindingResult.java b/spring-context/src/main/java/org/springframework/validation/AbstractPropertyBindingResult.java index fb0199e1fc2..52c86a2b1f1 100644 --- a/spring-context/src/main/java/org/springframework/validation/AbstractPropertyBindingResult.java +++ b/spring-context/src/main/java/org/springframework/validation/AbstractPropertyBindingResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/BeanPropertyBindingResult.java b/spring-context/src/main/java/org/springframework/validation/BeanPropertyBindingResult.java index 9043faffd8a..dff8bdce9a3 100644 --- a/spring-context/src/main/java/org/springframework/validation/BeanPropertyBindingResult.java +++ b/spring-context/src/main/java/org/springframework/validation/BeanPropertyBindingResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/BindingErrorProcessor.java b/spring-context/src/main/java/org/springframework/validation/BindingErrorProcessor.java index 6650c3d1c73..4f877a571af 100644 --- a/spring-context/src/main/java/org/springframework/validation/BindingErrorProcessor.java +++ b/spring-context/src/main/java/org/springframework/validation/BindingErrorProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/BindingResultUtils.java b/spring-context/src/main/java/org/springframework/validation/BindingResultUtils.java index 15d0981bfe8..ae3c0357688 100644 --- a/spring-context/src/main/java/org/springframework/validation/BindingResultUtils.java +++ b/spring-context/src/main/java/org/springframework/validation/BindingResultUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/DefaultBindingErrorProcessor.java b/spring-context/src/main/java/org/springframework/validation/DefaultBindingErrorProcessor.java index 64ea2a3727c..08fc3b97e55 100644 --- a/spring-context/src/main/java/org/springframework/validation/DefaultBindingErrorProcessor.java +++ b/spring-context/src/main/java/org/springframework/validation/DefaultBindingErrorProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/Errors.java b/spring-context/src/main/java/org/springframework/validation/Errors.java index d21cb1f5d1d..bea2a7061bb 100644 --- a/spring-context/src/main/java/org/springframework/validation/Errors.java +++ b/spring-context/src/main/java/org/springframework/validation/Errors.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/FieldError.java b/spring-context/src/main/java/org/springframework/validation/FieldError.java index 2f94663cfbb..0c76cc1622c 100644 --- a/spring-context/src/main/java/org/springframework/validation/FieldError.java +++ b/spring-context/src/main/java/org/springframework/validation/FieldError.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/MessageCodesResolver.java b/spring-context/src/main/java/org/springframework/validation/MessageCodesResolver.java index 5fd476817f2..d86acd476b4 100644 --- a/spring-context/src/main/java/org/springframework/validation/MessageCodesResolver.java +++ b/spring-context/src/main/java/org/springframework/validation/MessageCodesResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/ObjectError.java b/spring-context/src/main/java/org/springframework/validation/ObjectError.java index 5b2dd29ee43..ccfab2f9261 100644 --- a/spring-context/src/main/java/org/springframework/validation/ObjectError.java +++ b/spring-context/src/main/java/org/springframework/validation/ObjectError.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/ValidationUtils.java b/spring-context/src/main/java/org/springframework/validation/ValidationUtils.java index 0e5004e5bd9..9da8e3d26b8 100644 --- a/spring-context/src/main/java/org/springframework/validation/ValidationUtils.java +++ b/spring-context/src/main/java/org/springframework/validation/ValidationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/Validator.java b/spring-context/src/main/java/org/springframework/validation/Validator.java index f076ea6fe2a..d5d1e48ab14 100644 --- a/spring-context/src/main/java/org/springframework/validation/Validator.java +++ b/spring-context/src/main/java/org/springframework/validation/Validator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java index 452867a8b2f..b9553992c3d 100644 --- a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java +++ b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/example/scannable/AutowiredQualifierFooService.java b/spring-context/src/test/java/example/scannable/AutowiredQualifierFooService.java index 2bdea2ecce8..02fb1e5d2a3 100644 --- a/spring-context/src/test/java/example/scannable/AutowiredQualifierFooService.java +++ b/spring-context/src/test/java/example/scannable/AutowiredQualifierFooService.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -45,14 +45,17 @@ public class AutowiredQualifierFooService implements FooService { this.initCalled = true; } + @Override public String foo(int id) { return this.fooDao.findFoo(id); } + @Override public Future asyncFoo(int id) { return new AsyncResult(this.fooDao.findFoo(id)); } + @Override public boolean isInitCalled() { return this.initCalled; } diff --git a/spring-context/src/test/java/example/scannable/FooServiceImpl.java b/spring-context/src/test/java/example/scannable/FooServiceImpl.java index ef2b6094b31..1db44f5bb0b 100644 --- a/spring-context/src/test/java/example/scannable/FooServiceImpl.java +++ b/spring-context/src/test/java/example/scannable/FooServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -74,16 +74,19 @@ public class FooServiceImpl implements FooService { this.initCalled = true; } + @Override public String foo(int id) { return this.fooDao.findFoo(id); } + @Override public Future asyncFoo(int id) { System.out.println(Thread.currentThread().getName()); Assert.state(ServiceInvocationCounter.getThreadLocalCount() != null, "Thread-local counter not exposed"); return new AsyncResult(this.fooDao.findFoo(id)); } + @Override public boolean isInitCalled() { return this.initCalled; } diff --git a/spring-context/src/test/java/example/scannable/MessageBean.java b/spring-context/src/test/java/example/scannable/MessageBean.java index 9a3311ac193..a4fc2d26148 100644 --- a/spring-context/src/test/java/example/scannable/MessageBean.java +++ b/spring-context/src/test/java/example/scannable/MessageBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/example/scannable/ScopedProxyTestBean.java b/spring-context/src/test/java/example/scannable/ScopedProxyTestBean.java index 34d31600986..74191d87e57 100644 --- a/spring-context/src/test/java/example/scannable/ScopedProxyTestBean.java +++ b/spring-context/src/test/java/example/scannable/ScopedProxyTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -28,14 +28,17 @@ import org.springframework.scheduling.annotation.AsyncResult; @Scope("myScope") public class ScopedProxyTestBean implements FooService { + @Override public String foo(int id) { return "bar"; } + @Override public Future asyncFoo(int id) { return new AsyncResult("bar"); } + @Override public boolean isInitCalled() { return false; } diff --git a/spring-context/src/test/java/example/scannable/ServiceInvocationCounter.java b/spring-context/src/test/java/example/scannable/ServiceInvocationCounter.java index 292b0586568..eed10c07834 100644 --- a/spring-context/src/test/java/example/scannable/ServiceInvocationCounter.java +++ b/spring-context/src/test/java/example/scannable/ServiceInvocationCounter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/example/scannable/StubFooDao.java b/spring-context/src/test/java/example/scannable/StubFooDao.java index b4ea5b65d5d..46daeb18920 100644 --- a/spring-context/src/test/java/example/scannable/StubFooDao.java +++ b/spring-context/src/test/java/example/scannable/StubFooDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -26,6 +26,7 @@ import org.springframework.stereotype.Repository; @Qualifier("testing") public class StubFooDao implements FooDao { + @Override public String findFoo(int id) { return "bar"; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java index 2bf712344ed..364d5415920 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,17 @@ package org.springframework.aop.aspectj; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -55,56 +56,44 @@ public final class AfterAdviceBindingTests { // we need the real target too, not just the proxy... testBeanTarget = (TestBean) ((Advised) testBeanProxy).getTargetSource().getTarget(); - mockCollaborator = createNiceMock(AdviceBindingCollaborator.class); + mockCollaborator = mock(AdviceBindingCollaborator.class); afterAdviceAspect.setCollaborator(mockCollaborator); } @Test public void testOneIntArg() { - mockCollaborator.oneIntArg(5); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntArg(5); } @Test public void testOneObjectArgBindingProxyWithThis() { - mockCollaborator.oneObjectArg(this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanProxy); } @Test public void testOneObjectArgBindingTarget() { - mockCollaborator.oneObjectArg(this.testBeanTarget); - replay(mockCollaborator); testBeanProxy.getDoctor(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanTarget); } @Test public void testOneIntAndOneObjectArgs() { - mockCollaborator.oneIntAndOneObject(5,this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntAndOneObject(5,this.testBeanProxy); } @Test public void testNeedsJoinPoint() { - mockCollaborator.needsJoinPoint("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPoint("getAge"); } @Test public void testNeedsJoinPointStaticPart() { - mockCollaborator.needsJoinPointStaticPart("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPointStaticPart("getAge"); } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.xml index 9a55cc823e3..66d0e85228a 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.xml @@ -19,6 +19,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java index 2c8e8a714ba..c04a54f8e64 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,18 @@ package org.springframework.aop.aspectj; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; import org.junit.Before; import org.junit.Test; import org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -58,7 +60,7 @@ public final class AfterReturningAdviceBindingTests { afterAdviceAspect = (AfterReturningAdviceBindingTestAspect) ctx.getBean("testAspect"); - mockCollaborator = createNiceMock(AfterReturningAdviceBindingCollaborator.class); + mockCollaborator = mock(AfterReturningAdviceBindingCollaborator.class); afterAdviceAspect.setCollaborator(mockCollaborator); testBeanProxy = (ITestBean) ctx.getBean("testBean"); @@ -71,106 +73,79 @@ public final class AfterReturningAdviceBindingTests { @Test public void testOneIntArg() { - mockCollaborator.oneIntArg(5); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntArg(5); } @Test public void testOneObjectArg() { - mockCollaborator.oneObjectArg(this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanProxy); } @Test public void testOneIntAndOneObjectArgs() { - mockCollaborator.oneIntAndOneObject(5,this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntAndOneObject(5,this.testBeanProxy); } @Test public void testNeedsJoinPoint() { - mockCollaborator.needsJoinPoint("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPoint("getAge"); } @Test public void testNeedsJoinPointStaticPart() { - mockCollaborator.needsJoinPointStaticPart("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPointStaticPart("getAge"); } @Test public void testReturningString() { - mockCollaborator.oneString("adrian"); - replay(mockCollaborator); testBeanProxy.setName("adrian"); testBeanProxy.getName(); - verify(mockCollaborator); + verify(mockCollaborator).oneString("adrian"); } @Test public void testReturningObject() { - mockCollaborator.oneObjectArg(this.testBeanTarget); - replay(mockCollaborator); testBeanProxy.returnsThis(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanTarget); } @Test public void testReturningBean() { - mockCollaborator.oneTestBeanArg(this.testBeanTarget); - replay(mockCollaborator); testBeanProxy.returnsThis(); - verify(mockCollaborator); + verify(mockCollaborator).oneTestBeanArg(this.testBeanTarget); } @Test public void testReturningBeanArray() { this.testBeanTarget.setSpouse(new TestBean()); ITestBean[] spouses = this.testBeanTarget.getSpouses(); - mockCollaborator.testBeanArrayArg(spouses); - replay(mockCollaborator); testBeanProxy.getSpouses(); - verify(mockCollaborator); + verify(mockCollaborator).testBeanArrayArg(spouses); } @Test public void testNoInvokeWhenReturningParameterTypeDoesNotMatch() { - // we need a strict mock for this... - mockCollaborator = createMock(AfterReturningAdviceBindingCollaborator.class); - afterAdviceAspect.setCollaborator(mockCollaborator); - - replay(mockCollaborator); testBeanProxy.setSpouse(this.testBeanProxy); testBeanProxy.getSpouse(); - verify(mockCollaborator); + verifyZeroInteractions(mockCollaborator); } @Test public void testReturningByType() { - mockCollaborator.objectMatchNoArgs(); - replay(mockCollaborator); testBeanProxy.returnsThis(); - verify(mockCollaborator); + verify(mockCollaborator).objectMatchNoArgs(); } @Test public void testReturningPrimitive() { - mockCollaborator.oneInt(20); - replay(mockCollaborator); testBeanProxy.setAge(20); testBeanProxy.haveBirthday(); - verify(mockCollaborator); + verify(mockCollaborator).oneInt(20); } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.xml index 197afbf0695..97c02b34523 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.xml @@ -18,7 +18,7 @@ + pointcut="execution(org.springframework.tests.sample.beans.ITestBean[] *(..))"/> @@ -30,6 +30,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java index 0424250ca52..07605079249 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,13 +16,13 @@ package org.springframework.aop.aspectj; -import static org.easymock.EasyMock.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.aop.aspectj.AfterThrowingAdviceBindingTestAspect.AfterThrowingAdviceBindingCollaborator; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -47,65 +47,49 @@ public final class AfterThrowingAdviceBindingTests { testBean = (ITestBean) ctx.getBean("testBean"); afterThrowingAdviceAspect = (AfterThrowingAdviceBindingTestAspect) ctx.getBean("testAspect"); - mockCollaborator = createNiceMock(AfterThrowingAdviceBindingCollaborator.class); + mockCollaborator = mock(AfterThrowingAdviceBindingCollaborator.class); afterThrowingAdviceAspect.setCollaborator(mockCollaborator); } - @After - public void tearDown() { - verify(mockCollaborator); - } - @Test(expected=Throwable.class) public void testSimpleAfterThrowing() throws Throwable { - mockCollaborator.noArgs(); - replay(mockCollaborator); this.testBean.exceptional(new Throwable()); + verify(mockCollaborator).noArgs(); } @Test(expected=Throwable.class) public void testAfterThrowingWithBinding() throws Throwable { Throwable t = new Throwable(); - mockCollaborator.oneThrowable(t); - replay(mockCollaborator); this.testBean.exceptional(t); + verify(mockCollaborator).oneThrowable(t); } @Test(expected=Throwable.class) public void testAfterThrowingWithNamedTypeRestriction() throws Throwable { Throwable t = new Throwable(); - // need a strict mock for this test... - mockCollaborator = createMock(AfterThrowingAdviceBindingCollaborator.class); - afterThrowingAdviceAspect.setCollaborator(mockCollaborator); - - mockCollaborator.noArgs(); - mockCollaborator.oneThrowable(t); - mockCollaborator.noArgsOnThrowableMatch(); - replay(mockCollaborator); this.testBean.exceptional(t); + verify(mockCollaborator).noArgs(); + verify(mockCollaborator).oneThrowable(t); + verify(mockCollaborator).noArgsOnThrowableMatch(); } @Test(expected=Throwable.class) public void testAfterThrowingWithRuntimeExceptionBinding() throws Throwable { RuntimeException ex = new RuntimeException(); - mockCollaborator.oneRuntimeException(ex); - replay(mockCollaborator); this.testBean.exceptional(ex); + verify(mockCollaborator).oneRuntimeException(ex); } @Test(expected=Throwable.class) public void testAfterThrowingWithTypeSpecified() throws Throwable { - mockCollaborator.noArgsOnThrowableMatch(); - replay(mockCollaborator); this.testBean.exceptional(new Throwable()); + verify(mockCollaborator).noArgsOnThrowableMatch(); } @Test(expected=Throwable.class) public void testAfterThrowingWithRuntimeTypeSpecified() throws Throwable { - mockCollaborator.noArgsOnRuntimeExceptionMatch(); - replay(mockCollaborator); this.testBean.exceptional(new RuntimeException()); - verify(mockCollaborator); + verify(mockCollaborator).noArgsOnRuntimeExceptionMatch(); } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.xml index 9152fe1853e..77dd0c36247 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.xml @@ -37,6 +37,6 @@ - + \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java index 05b171f6bb3..879e846b2bd 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,9 @@ package org.springframework.aop.aspectj; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import org.aspectj.lang.ProceedingJoinPoint; import org.junit.Before; @@ -25,8 +26,8 @@ import org.junit.Test; import org.springframework.aop.aspectj.AroundAdviceBindingTestAspect.AroundAdviceBindingCollaborator; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -60,40 +61,32 @@ public class AroundAdviceBindingTests { this.testBeanTarget = (TestBean) ((Advised) testBeanProxy).getTargetSource().getTarget(); - mockCollaborator = createNiceMock(AroundAdviceBindingCollaborator.class); + mockCollaborator = mock(AroundAdviceBindingCollaborator.class); aroundAdviceAspect.setCollaborator(mockCollaborator); } @Test public void testOneIntArg() { - mockCollaborator.oneIntArg(5); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntArg(5); } @Test public void testOneObjectArgBoundToTarget() { - mockCollaborator.oneObjectArg(this.testBeanTarget); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanTarget);; } @Test public void testOneIntAndOneObjectArgs() { - mockCollaborator.oneIntAndOneObject(5, this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntAndOneObject(5, this.testBeanProxy);; } @Test public void testJustJoinPoint() { - mockCollaborator.justJoinPoint("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).justJoinPoint("getAge");; } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.xml index 91ca7c6540c..2198e32f49c 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.xml @@ -17,6 +17,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceCircularTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceCircularTests.xml index 7f947101837..e00fa847a7d 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceCircularTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceCircularTests.xml @@ -17,11 +17,11 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.java index 0355c8f7c37..585d1806950 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import org.aspectj.lang.ProceedingJoinPoint; import org.junit.Before; import org.junit.Test; import org.springframework.aop.MethodBeforeAdvice; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.factory.BeanNameAware; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.Ordered; @@ -110,26 +110,32 @@ public final class AspectAndAdvicePrecedenceTests { } } + @Override public void beforeAdviceOne(String beanName) { checkAdvice("beforeAdviceOne(" + beanName + ")"); } + @Override public void beforeAdviceTwo(String beanName) { checkAdvice("beforeAdviceTwo(" + beanName + ")"); } + @Override public void aroundAdviceOne(String beanName) { checkAdvice("aroundAdviceOne(" + beanName + ")"); } + @Override public void aroundAdviceTwo(String beanName) { checkAdvice("aroundAdviceTwo(" + beanName + ")"); } + @Override public void afterAdviceOne(String beanName) { checkAdvice("afterAdviceOne(" + beanName + ")"); } + @Override public void afterAdviceTwo(String beanName) { checkAdvice("afterAdviceTwo(" + beanName + ")"); } @@ -147,6 +153,7 @@ class PrecedenceTestAspect implements BeanNameAware, Ordered { private Collaborator collaborator; + @Override public void setBeanName(String name) { this.name = name; } @@ -155,6 +162,7 @@ class PrecedenceTestAspect implements BeanNameAware, Ordered { this.order = order; } + @Override public int getOrder() { return order; } @@ -223,6 +231,7 @@ class SimpleSpringBeforeAdvice implements MethodBeforeAdvice, BeanNameAware { /* (non-Javadoc) * @see org.springframework.aop.MethodBeforeAdvice#before(java.lang.reflect.Method, java.lang.Object[], java.lang.Object) */ + @Override public void before(Method method, Object[] args, Object target) throws Throwable { this.collaborator.beforeAdviceOne(this.name); @@ -235,6 +244,7 @@ class SimpleSpringBeforeAdvice implements MethodBeforeAdvice, BeanNameAware { /* (non-Javadoc) * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) */ + @Override public void setBeanName(String name) { this.name = name; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.xml index 6dae894ae62..038614eccf4 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectAndAdvicePrecedenceTests.xml @@ -85,6 +85,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.java index dbe4e3e51a0..2b363cab83b 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -60,6 +60,7 @@ class CallCountingInterceptor implements MethodInterceptor { private int count; + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { count++; return methodInvocation.proceed(); diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.xml index 8a23b5ad4d5..9ec75d75aab 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisorTests.xml @@ -5,11 +5,11 @@ - + + value="execution(org.springframework.tests.sample.beans.ITestBean[] org.springframework.tests.sample.beans.ITestBean.*(..))"/> diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.java index 4b1d267b615..4ab6a830646 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -23,8 +23,8 @@ import org.aspectj.lang.annotation.Before; import org.junit.Test; import org.springframework.aop.aspectj.annotation.AspectJProxyFactory; import org.springframework.aop.framework.Advised; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.xml index 987a8b852cf..b446755d57b 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutAtAspectTests.xml @@ -6,10 +6,10 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - - - - + + + + - \ No newline at end of file + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.java index 2e998b24df3..7c225060489 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.springframework.aop.MethodBeforeAdvice; import org.springframework.aop.framework.Advised; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -126,6 +126,7 @@ public final class BeanNamePointcutTests { private int interceptionCount; + @Override public void before(Method method, Object[] args, Object target) throws Throwable { interceptionCount++; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.xml index 66ccb584951..42dafc3e90d 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutTests.xml @@ -21,13 +21,13 @@ - + - + - + - + @@ -53,9 +53,9 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java index a1f2fe9736f..94e6e43f8ab 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,17 @@ package org.springframework.aop.aspectj; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -60,49 +61,39 @@ public final class BeforeAdviceBindingTests { AdviceBindingTestAspect beforeAdviceAspect = (AdviceBindingTestAspect) ctx.getBean("testAspect"); - mockCollaborator = createNiceMock(AdviceBindingCollaborator.class); + mockCollaborator = mock(AdviceBindingCollaborator.class); beforeAdviceAspect.setCollaborator(mockCollaborator); } @Test public void testOneIntArg() { - mockCollaborator.oneIntArg(5); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntArg(5); } @Test public void testOneObjectArgBoundToProxyUsingThis() { - mockCollaborator.oneObjectArg(this.testBeanProxy); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).oneObjectArg(this.testBeanProxy); } @Test public void testOneIntAndOneObjectArgs() { - mockCollaborator.oneIntAndOneObject(5,this.testBeanTarget); - replay(mockCollaborator); testBeanProxy.setAge(5); - verify(mockCollaborator); + verify(mockCollaborator).oneIntAndOneObject(5,this.testBeanTarget); } @Test public void testNeedsJoinPoint() { - mockCollaborator.needsJoinPoint("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPoint("getAge"); } @Test public void testNeedsJoinPointStaticPart() { - mockCollaborator.needsJoinPointStaticPart("getAge"); - replay(mockCollaborator); testBeanProxy.getAge(); - verify(mockCollaborator); + verify(mockCollaborator).needsJoinPointStaticPart("getAge"); } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.xml index d12031f34eb..4aac362c73e 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.xml @@ -26,7 +26,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclarationOrderIndependenceTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclarationOrderIndependenceTests.java index cfeb2ca217c..07542c3cab0 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclarationOrderIndependenceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclarationOrderIndependenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -88,6 +88,7 @@ public final class DeclarationOrderIndependenceTests { /* (non-Javadoc) * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) */ + @Override public void setBeanName(String name) { this.beanName = name; } @@ -148,6 +149,7 @@ class TopsyTurvyTargetImpl implements TopsyTurvyTarget { /* (non-Javadoc) * @see org.springframework.aop.aspectj.TopsyTurvyTarget#doSomething() */ + @Override public void doSomething() { this.x = 10; } @@ -155,6 +157,7 @@ class TopsyTurvyTargetImpl implements TopsyTurvyTarget { /* (non-Javadoc) * @see org.springframework.aop.aspectj.TopsyTurvyTarget#getX() */ + @Override public int getX() { return x; } @@ -171,6 +174,7 @@ class AspectCollaborator implements TopsyTurvyAspect.Collaborator { /* (non-Javadoc) * @see org.springframework.aop.aspectj.TopsyTurvyAspect.Collaborator#afterReturningAdviceFired() */ + @Override public void afterReturningAdviceFired() { this.afterReturningFired = true; } @@ -178,6 +182,7 @@ class AspectCollaborator implements TopsyTurvyAspect.Collaborator { /* (non-Javadoc) * @see org.springframework.aop.aspectj.TopsyTurvyAspect.Collaborator#aroundAdviceFired() */ + @Override public void aroundAdviceFired() { this.aroundFired = true; } @@ -185,6 +190,7 @@ class AspectCollaborator implements TopsyTurvyAspect.Collaborator { /* (non-Javadoc) * @see org.springframework.aop.aspectj.TopsyTurvyAspect.Collaborator#beforeAdviceFired() */ + @Override public void beforeAdviceFired() { this.beforeFired = true; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsDelegateRefTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsDelegateRefTests.java index cde853bf6ae..bf495f0736e 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsDelegateRefTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsDelegateRefTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.java index c3e652a3a33..c2948de1ab1 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,19 +16,21 @@ package org.springframework.aop.aspectj; -import static org.junit.Assert.*; - import org.junit.Before; import org.junit.Test; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import test.mixin.Lockable; +import static org.junit.Assert.*; + /** * @author Rod Johnson * @author Chris Beams @@ -63,6 +65,8 @@ public final class DeclareParentsTests { // on the introduction, in which case this would not be a problem. @Test public void testLockingWorks() { + Assume.group(TestGroup.LONG_RUNNING); + Object introductionObject = ctx.getBean("introduction"); assertFalse("Introduction should not be proxied", AopUtils.isAopProxy(introductionObject)); diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.xml index d8b4887fe66..fc449b6943c 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/DeclareParentsTests.xml @@ -8,7 +8,7 @@ @@ -17,11 +17,11 @@ pointcut="execution(* set*(*)) and this(mixin)" arg-names="mixin" /> - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.java index 4740e656777..f9d810c6262 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -39,7 +39,7 @@ public final class ImplicitJPArgumentMatchingAtAspectJTests { @Aspect static class CounterAtAspectJAspect { - @Around(value="execution(* org.springframework.beans.TestBean.*(..)) and this(bean) and args(argument)", + @Around(value="execution(* org.springframework.tests.sample.beans.TestBean.*(..)) and this(bean) and args(argument)", argNames="bean,argument") public void increment(ProceedingJoinPoint pjp, TestBean bean, Object argument) throws Throwable { pjp.proceed(); diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.xml index 01bd862dd1b..c88962cd533 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingAtAspectJTests.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.java index fc02024d763..5c942d9ddc2 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.xml index 1c10ec952fe..6a4a56e7f01 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ImplicitJPArgumentMatchingTests.xml @@ -8,12 +8,12 @@ + expression="execution(* org.springframework.tests.sample.beans.TestBean.*(..)) and this(bean) and args(argument)"/> - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests-ambiguous.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests-ambiguous.xml index 3268b8ccecc..f8ca001d0de 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests-ambiguous.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests-ambiguous.xml @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.java index c5512be61d5..4c79347978d 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.xml index 57f3f9dd4d7..94725cb5e31 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/OverloadedAdviceTests.xml @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ProceedTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/ProceedTests.java index 70464c53128..e002a9fa1d0 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ProceedTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ProceedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -101,34 +101,42 @@ class SimpleBeanImpl implements SimpleBean { private String name; private String sex; + @Override public int getAge() { return age; } + @Override public float getMyFloat() { return aFloat; } + @Override public String getName() { return name; } + @Override public String getSex() { return sex; } + @Override public void setAge(int age) { this.age = age; } + @Override public void setMyFloat(float f) { this.aFloat = f; } + @Override public void setName(String name) { this.name = name; } + @Override public void setSex(String sex) { this.sex = sex; } @@ -143,6 +151,7 @@ class ProceedTestingAspect implements Ordered { private int order; public void setOrder(int order) { this.order = order; } + @Override public int getOrder() { return this.order; } public Object capitalize(ProceedingJoinPoint pjp, String value) throws Throwable { diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/PropertyDependentAspectTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/PropertyDependentAspectTests.java index bc6a0a1b41f..5551cbfcb22 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/PropertyDependentAspectTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/PropertyDependentAspectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/SharedPointcutWithArgsMismatchTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/SharedPointcutWithArgsMismatchTests.java index 93fd2a2b596..75e0aeabf0d 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/SharedPointcutWithArgsMismatchTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/SharedPointcutWithArgsMismatchTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/SubtypeSensitiveMatchingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/SubtypeSensitiveMatchingTests.java index bcd1234398d..2c597c0f049 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/SubtypeSensitiveMatchingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/SubtypeSensitiveMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -74,6 +74,7 @@ interface SerializableFoo extends Serializable { void foo(); } class SubtypeMatchingTestClassA implements NonSerializableFoo { + @Override public void foo() {} } @@ -81,6 +82,7 @@ class SubtypeMatchingTestClassA implements NonSerializableFoo { @SuppressWarnings("serial") class SubtypeMatchingTestClassB implements SerializableFoo { + @Override public void foo() {} } @@ -89,6 +91,7 @@ interface Bar { void bar(Object o); } class SubtypeMatchingTestClassC implements Bar { + @Override public void bar(Object o) {} } \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/TargetPointcutSelectionTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/TargetPointcutSelectionTests.java index f440f0490b0..f01bf14a475 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/TargetPointcutSelectionTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/TargetPointcutSelectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -82,6 +82,7 @@ public final class TargetPointcutSelectionTests { // include the advised method's implementation (instead a base class should include it) public static abstract class AbstractTestImpl implements TestInterface { + @Override public void interfaceMethod() { } } @@ -107,6 +108,7 @@ public final class TargetPointcutSelectionTests { public static class TestInterceptor extends TestAspect implements MethodInterceptor { + @Override public Object invoke(MethodInvocation mi) throws Throwable { increment(); return mi.proceed(); diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java index 6633bb808ea..f71d16605df 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -108,6 +108,7 @@ public final class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests { } public static class TestImpl implements TestInterface { + @Override public void doIt() { } } @@ -119,11 +120,13 @@ public final class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests { @TestAnnotation public static class AnnotatedClassTestImpl implements TestInterface { + @Override public void doIt() { } } public static class AnnotatedMethodTestImpl implements TestInterface { + @Override @TestAnnotation public void doIt() { } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsTests.java index bcd93c0523e..3a2bc6fda89 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -115,6 +115,7 @@ interface TestInterface { class TestImpl implements TestInterface { + @Override public void doIt() { } } \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/_TestTypes.java b/spring-context/src/test/java/org/springframework/aop/aspectj/_TestTypes.java index 935cf4bd583..1490cf357e1 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/_TestTypes.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/_TestTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -118,22 +118,27 @@ final class Counter implements ICounter { public Counter() { } + @Override public void increment() { count++; } + @Override public void decrement() { count--; } + @Override public int getCount() { return count; } + @Override public void setCount(int counter) { this.count = counter; } + @Override public void reset() { this.count = 0; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationBindingTests.java index 0829446808f..10f054ab9cb 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationPointcutTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationPointcutTests.java index 925038414ec..07f4d5c688b 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationPointcutTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AnnotationPointcutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -55,6 +55,7 @@ public final class AnnotationPointcutTests { class TestMethodInterceptor implements MethodInterceptor { + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { return "this value"; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests-context.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests-context.xml index 7d846604000..6490decb219 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests-context.xml @@ -13,7 +13,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests.java index e88d5ada0b4..9b6a0b61740 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectImplementingInterfaceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.*; import org.aspectj.lang.ProceedingJoinPoint; import org.junit.Test; import org.springframework.aop.framework.Advised; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -57,6 +57,7 @@ class InterfaceExtendingAspect implements AnInterface { pjp.proceed(); } + @Override public void interfaceMethod() { } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorAndLazyInitTargetSourceTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorAndLazyInitTargetSourceTests.java index 227903bab0b..7ca3e87e15a 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorAndLazyInitTargetSourceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorAndLazyInitTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -19,8 +19,8 @@ package org.springframework.aop.aspectj.autoproxy; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspects.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspects.xml index 3eedc35b006..da15419d113 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspects.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspects.xml @@ -23,11 +23,11 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsPlusAdvisor.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsPlusAdvisor.xml index 8a399d03618..2b23fab3029 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsPlusAdvisor.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsPlusAdvisor.xml @@ -9,17 +9,17 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithAbstractBean.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithAbstractBean.xml index c1c8376b305..88907c1b6c4 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithAbstractBean.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithAbstractBean.xml @@ -20,7 +20,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithOrdering.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithOrdering.xml index a299f40e300..53c2a50c662 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithOrdering.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-aspectsWithOrdering.xml @@ -17,7 +17,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-pertarget.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-pertarget.xml index e02baf027b8..efb221722a0 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-pertarget.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-pertarget.xml @@ -10,12 +10,12 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-perthis.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-perthis.xml index 408c5477395..25f545b5425 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-perthis.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-perthis.xml @@ -7,7 +7,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspect.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspect.xml index a916c5a1e51..e00377721c4 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspect.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspect.xml @@ -7,7 +7,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspectPrototype.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspectPrototype.xml index 047ef0daafe..9505a844d7f 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspectPrototype.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-twoAdviceAspectPrototype.xml @@ -8,7 +8,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesInclude.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesInclude.xml index c6da3d6ea83..16293b388e0 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesInclude.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesInclude.xml @@ -18,7 +18,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesJoinPointAspect.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesJoinPointAspect.xml index 44bc1872f6a..462d8bcdc65 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesJoinPointAspect.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests-usesJoinPointAspect.xml @@ -7,7 +7,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java index 9bb9c8d83a3..2306641f0e5 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -40,16 +40,18 @@ import org.springframework.aop.config.AopConfigUtils; import org.springframework.aop.framework.ProxyConfig; import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor; -import org.springframework.beans.INestedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.NestedTestBean; +import org.springframework.tests.sample.beans.INestedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.NestedTestBean; import org.springframework.beans.PropertyValue; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.MethodInvokingFactoryBean; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.GenericApplicationContext; @@ -112,10 +114,8 @@ public final class AspectJAutoProxyCreatorTests { @Test public void testAspectsAndAdvisorAppliedToPrototypeIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); ClassPathXmlApplicationContext ac = newContext("aspectsPlusAdvisor.xml"); StopWatch sw = new StopWatch(); sw.start("Prototype Creation"); @@ -134,10 +134,8 @@ public final class AspectJAutoProxyCreatorTests { @Test public void testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); ClassPathXmlApplicationContext ac = newContext("aspectsPlusAdvisor.xml"); StopWatch sw = new StopWatch(); sw.start("Prototype Creation"); @@ -156,10 +154,8 @@ public final class AspectJAutoProxyCreatorTests { @Test public void testAspectsAndAdvisorNotAppliedToManySingletonsIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ac = new GenericApplicationContext(); new XmlBeanDefinitionReader(ac).loadBeanDefinitions(new ClassPathResource(qName("aspectsPlusAdvisor.xml"), getClass())); @@ -387,6 +383,7 @@ class PerTargetAspect implements Ordered { ++count; } + @Override public int getOrder() { return this.order; } @@ -438,14 +435,17 @@ class DummyAspectWithParameter { class DummyFactoryBean implements FactoryBean { + @Override public Object getObject() throws Exception { throw new UnsupportedOperationException(); } + @Override public Class getObjectType() { throw new UnsupportedOperationException(); } + @Override public boolean isSingleton() { throw new UnsupportedOperationException(); } @@ -573,12 +573,14 @@ class TestBeanAdvisor extends StaticMethodMatcherPointcutAdvisor { public TestBeanAdvisor() { setAdvice(new MethodBeforeAdvice() { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { ++count; } }); } + @Override public boolean matches(Method method, Class targetClass) { return ITestBean.class.isAssignableFrom(targetClass); } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests-context.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests-context.xml index d585ce96211..b35902d133f 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests-context.xml @@ -6,7 +6,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests.java index 0c6b68d805f..b5c5b065d5f 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAfterThrowingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.*; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.aop.support.AopUtils; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -63,7 +63,7 @@ class ExceptionHandlingAspect { public IOException lastException; - @AfterThrowing(pointcut = "within(org.springframework.beans.ITestBean+)", throwing = "ex") + @AfterThrowing(pointcut = "within(org.springframework.tests.sample.beans.ITestBean+)", throwing = "ex") public void handleIOException(IOException ex) { handled++; lastException = ex; diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAnnotationBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAnnotationBindingTests.java index 1868a63a3d0..c5b7c8c5cf4 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAnnotationBindingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AtAspectJAnnotationBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -82,16 +82,19 @@ class AtAspectJAnnotationBindingTestAspect { class ResourceArrayFactoryBean implements FactoryBean { + @Override @TestAnnotation("some value") public Object getObject() throws Exception { return new Resource[0]; } + @Override @TestAnnotation("some value") public Class getObjectType() { return Resource[].class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/_TestTypes.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/_TestTypes.java index 66897ba62de..8060defdbf3 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/_TestTypes.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/_TestTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -72,22 +72,26 @@ interface AnnotatedTestBean { */ class AnnotatedTestBeanImpl implements AnnotatedTestBean { + @Override @TestAnnotation("this value") public String doThis() { return "doThis"; } + @Override @TestAnnotation("that value") public String doThat() { return "doThat"; } + @Override @TestAnnotation("array value") public String[] doArray() { return new String[] {"doThis", "doThat"}; } // not annotated + @Override public String doTheOther() { return "doTheOther"; } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-aspectj.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-aspectj.xml index 8b0975e8a93..759e4c89447 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-aspectj.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-aspectj.xml @@ -22,7 +22,7 @@ class="org.springframework.aop.aspectj.autoproxy.benchmark.TraceAspect" > - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-springAop.xml b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-springAop.xml index d6c4cccceec..453d22ccaf2 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-springAop.xml +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests-springAop.xml @@ -31,7 +31,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java index 918dd87535b..c750e8ae574 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,7 +33,7 @@ import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.StaticMethodMatcherPointcut; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.util.StopWatch; @@ -206,6 +206,7 @@ class MultiplyReturnValueInterceptor implements MethodInterceptor { return this.multiple; } + @Override public Object invoke(MethodInvocation mi) throws Throwable { ++invocations; int result = (Integer) mi.proceed(); @@ -219,6 +220,7 @@ class TraceAfterReturningAdvice implements AfterReturningAdvice { public int afterTakesInt; + @Override public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable { ++afterTakesInt; } @@ -226,6 +228,7 @@ class TraceAfterReturningAdvice implements AfterReturningAdvice { public static Advisor advisor() { return new DefaultPointcutAdvisor( new StaticMethodMatcherPointcut() { + @Override public boolean matches(Method method, Class targetClass) { return method.getParameterTypes().length == 1 && method.getParameterTypes()[0].equals(Integer.class); @@ -261,6 +264,7 @@ class TraceBeforeAdvice implements MethodBeforeAdvice { public int beforeStringReturn; + @Override public void before(Method method, Object[] args, Object target) throws Throwable { ++beforeStringReturn; } @@ -268,6 +272,7 @@ class TraceBeforeAdvice implements MethodBeforeAdvice { public static Advisor advisor() { return new DefaultPointcutAdvisor( new StaticMethodMatcherPointcut() { + @Override public boolean matches(Method method, Class targetClass) { return method.getReturnType().equals(String.class); } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/spr3064/SPR3064Tests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/spr3064/SPR3064Tests.java index 17e5943b3a0..9d47785b853 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/spr3064/SPR3064Tests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/spr3064/SPR3064Tests.java @@ -1,5 +1,5 @@ /** - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -81,6 +81,7 @@ interface Service { class ServiceImpl implements Service { + @Override @Transaction public void serveMe() { } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/AfterReturningGenericTypeMatchingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/AfterReturningGenericTypeMatchingTests.java index 336523137ae..ea160ca1130 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/AfterReturningGenericTypeMatchingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/AfterReturningGenericTypeMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -26,10 +26,10 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; -import test.beans.Employee; +import org.springframework.tests.sample.beans.Employee; /** * Tests ensuring that after-returning advice for generic parameters bound to diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericBridgeMethodMatchingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericBridgeMethodMatchingTests.java index b8c85fbef33..093a6fe69a4 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericBridgeMethodMatchingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericBridgeMethodMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -87,9 +87,11 @@ interface DerivedInterface extends BaseInterface { class DerivedStringParameterizedClass implements DerivedInterface { + @Override public void genericDerivedInterfaceMethod(String t) { } + @Override public void genericBaseInterfaceMethod(String t) { } } diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java index 6260e98b061..f0f8d6ff04c 100644 --- a/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -82,9 +82,11 @@ public final class GenericParameterMatchingTests { static class GenericImpl implements GenericInterface { + @Override public void save(T bean) { } + @Override public void saveAll(Collection beans) { } } diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-error.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-error.xml index 1761a3552e4..7abc4287b71 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-error.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-error.xml @@ -15,11 +15,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-ok.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-ok.xml index 68681cf9fbd..a68195265dc 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-ok.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests-ok.xml @@ -16,11 +16,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests.java index f2c174522bd..9a0ddffb8f9 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerAdviceTypeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-error.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-error.xml index 2a83b2078a5..f2b1e064721 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-error.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-error.xml @@ -12,11 +12,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-ok.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-ok.xml index 88cad34d9aa..4e098059b53 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-ok.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests-ok.xml @@ -12,11 +12,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests.java index 453040fe3d0..45bd83f77e5 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerArgNamesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests-context.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests-context.xml index 38f9d7b6201..855bda381c5 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests-context.xml @@ -19,11 +19,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java index 417512a71ef..3632c978038 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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 @@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.aop.framework.Advised; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; /** * @author Rob Harrop diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-error.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-error.xml index 1f84e8edac2..9df36d7a387 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-error.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-error.xml @@ -11,11 +11,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-ok.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-ok.xml index 3fe28a8663d..c9238290990 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-ok.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests-ok.xml @@ -11,11 +11,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests.java index f7f4d3e8123..fed5ac1eb5e 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerReturningTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests-context.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests-context.xml index 90ead2afe56..5fc378d78f6 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests-context.xml @@ -19,11 +19,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests.java index 09d3dacd844..4896d143b26 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,20 +16,20 @@ package org.springframework.aop.config; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import org.aspectj.lang.ProceedingJoinPoint; import org.junit.Before; import org.junit.Test; -import test.advice.CountingBeforeAdvice; - import org.springframework.aop.Advisor; import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; - -import static org.junit.Assert.*; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Unit tests for aop namespace. diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-error.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-error.xml index 73ed03922c3..1ddb6b9a005 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-error.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-error.xml @@ -11,11 +11,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-ok.xml b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-ok.xml index 85080527360..051d281260e 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-ok.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests-ok.xml @@ -11,11 +11,11 @@ - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests.java b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests.java index dcb1d9c3830..4af0a3b292f 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerThrowingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java index e06876b4304..753fb3341a7 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -16,14 +16,17 @@ package org.springframework.aop.config; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + import java.lang.reflect.Method; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; -import org.junit.After; import org.junit.Before; import org.junit.Test; - import org.springframework.beans.factory.BeanFactory; /** @@ -39,40 +42,27 @@ public final class MethodLocatingFactoryBeanTests { @Before public void setUp() { factory = new MethodLocatingFactoryBean(); - - // methods must set up expectations and call replay() manually for this mock - beanFactory = createMock(BeanFactory.class); - } - - @After - public void tearDown() { - verify(beanFactory); + beanFactory = mock(BeanFactory.class); } @Test public void testIsSingleton() { - replay(beanFactory); assertTrue(factory.isSingleton()); } @Test public void testGetObjectType() { - replay(beanFactory); assertEquals(Method.class, factory.getObjectType()); } @Test(expected=IllegalArgumentException.class) public void testWithNullTargetBeanName() { - replay(beanFactory); - factory.setMethodName("toString()"); factory.setBeanFactory(beanFactory); } @Test(expected=IllegalArgumentException.class) public void testWithEmptyTargetBeanName() { - replay(beanFactory); - factory.setTargetBeanName(""); factory.setMethodName("toString()"); factory.setBeanFactory(beanFactory); @@ -80,16 +70,12 @@ public final class MethodLocatingFactoryBeanTests { @Test(expected=IllegalArgumentException.class) public void testWithNullTargetMethodName() { - replay(beanFactory); - factory.setTargetBeanName(BEAN_NAME); factory.setBeanFactory(beanFactory); } @Test(expected=IllegalArgumentException.class) public void testWithEmptyTargetMethodName() { - replay(beanFactory); - factory.setTargetBeanName(BEAN_NAME); factory.setMethodName(""); factory.setBeanFactory(beanFactory); @@ -97,20 +83,16 @@ public final class MethodLocatingFactoryBeanTests { @Test(expected=IllegalArgumentException.class) public void testWhenTargetBeanClassCannotBeResolved() { - expect(beanFactory.getType(BEAN_NAME)).andReturn(null); - replay(beanFactory); - factory.setTargetBeanName(BEAN_NAME); factory.setMethodName("toString()"); factory.setBeanFactory(beanFactory); + verify(beanFactory).getType(BEAN_NAME); } @Test - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings("unchecked") public void testSunnyDayPath() throws Exception { - expect((Class) beanFactory.getType(BEAN_NAME)).andReturn(String.class); - replay(beanFactory); - + given(beanFactory.getType(BEAN_NAME)).willReturn((Class)String.class); factory.setTargetBeanName(BEAN_NAME); factory.setMethodName("toString()"); factory.setBeanFactory(beanFactory); @@ -122,11 +104,9 @@ public final class MethodLocatingFactoryBeanTests { } @Test(expected=IllegalArgumentException.class) - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings("unchecked") public void testWhereMethodCannotBeResolved() { - expect((Class) beanFactory.getType(BEAN_NAME)).andReturn(String.class); - replay(beanFactory); - + given(beanFactory.getType(BEAN_NAME)).willReturn((Class)String.class); factory.setTargetBeanName(BEAN_NAME); factory.setMethodName("loadOfOld()"); factory.setBeanFactory(beanFactory); diff --git a/spring-context/src/test/java/org/springframework/aop/config/PrototypeProxyTests-context.xml b/spring-context/src/test/java/org/springframework/aop/config/PrototypeProxyTests-context.xml index 0ca26dd9534..b1327c8bdb1 100644 --- a/spring-context/src/test/java/org/springframework/aop/config/PrototypeProxyTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/config/PrototypeProxyTests-context.xml @@ -5,22 +5,22 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - + - + - + - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java b/spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java index 5af410a894b..9fd4e9fa07c 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,6 +16,14 @@ package org.springframework.aop.framework; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.Method; @@ -29,25 +37,13 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; + import org.aopalliance.aop.Advice; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.junit.After; import org.junit.Before; import org.junit.Test; -import test.advice.CountingAfterReturningAdvice; -import test.advice.CountingBeforeAdvice; -import test.advice.MethodCounter; -import test.advice.MyThrowsHandler; -import test.interceptor.NopInterceptor; -import test.interceptor.SerializableNopInterceptor; -import test.interceptor.TimestampIntroductionInterceptor; -import test.mixin.LockMixin; -import test.mixin.LockMixinAdvisor; -import test.mixin.Lockable; -import test.mixin.LockedException; -import test.util.TimeStamped; - import org.springframework.aop.Advisor; import org.springframework.aop.AfterReturningAdvice; import org.springframework.aop.DynamicIntroductionAdvice; @@ -66,15 +62,26 @@ import org.springframework.aop.support.Pointcuts; import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor; import org.springframework.aop.target.HotSwappableTargetSource; import org.springframework.aop.target.SingletonTargetSource; -import org.springframework.beans.IOther; -import org.springframework.beans.ITestBean; -import org.springframework.beans.Person; -import org.springframework.beans.SerializablePerson; -import org.springframework.beans.TestBean; +import org.springframework.tests.TimeStamped; +import org.springframework.tests.aop.advice.CountingAfterReturningAdvice; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; +import org.springframework.tests.aop.advice.MethodCounter; +import org.springframework.tests.aop.advice.MyThrowsHandler; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.aop.interceptor.SerializableNopInterceptor; +import org.springframework.tests.aop.interceptor.TimestampIntroductionInterceptor; +import org.springframework.tests.sample.beans.IOther; +import org.springframework.tests.sample.beans.ITestBean; +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.util.StopWatch; -import static org.junit.Assert.*; +import test.mixin.LockMixin; +import test.mixin.LockMixinAdvisor; +import test.mixin.Lockable; +import test.mixin.LockedException; /** * @author Rod Johnson @@ -409,6 +416,7 @@ public abstract class AbstractAopProxyTests { final String s = "foo"; // Test return value MethodInterceptor mi = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (!context) { assertNoInvocationContext(); @@ -457,6 +465,7 @@ public abstract class AbstractAopProxyTests { final Exception expectedException = new Exception(); // Test return value MethodInterceptor mi = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { throw expectedException; } @@ -491,6 +500,7 @@ public abstract class AbstractAopProxyTests { final Exception unexpectedException = new Exception(); // Test return value MethodInterceptor mi = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { throw unexpectedException; } @@ -523,6 +533,7 @@ public abstract class AbstractAopProxyTests { final RuntimeException unexpectedException = new RuntimeException(); // Test return value MethodInterceptor mi = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { throw unexpectedException; } @@ -573,6 +584,7 @@ public abstract class AbstractAopProxyTests { AdvisedSupport pc = new AdvisedSupport(new Class[] {ITestBean.class, IOther.class}); pc.addAdvice(ExposeInvocationInterceptor.INSTANCE); TrapTargetInterceptor tii = new TrapTargetInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { // Assert that target matches BEFORE invocation returns assertEquals("Target is correct", expectedTarget, invocation.getThis()); @@ -727,6 +739,7 @@ public abstract class AbstractAopProxyTests { pc.addAdvice(di); final long ts = 37; pc.addAdvice(new DelegatingIntroductionInterceptor(new TimeStamped() { + @Override public long getTimeStamp() { return ts; } @@ -811,6 +824,7 @@ public abstract class AbstractAopProxyTests { /** * @see test.util.TimeStamped#getTimeStamp() */ + @Override public long getTimeStamp() { throw new UnsupportedOperationException(); } @@ -1132,6 +1146,7 @@ public abstract class AbstractAopProxyTests { pc.addInterface(ITestBean.class); MethodInterceptor twoBirthdayInterceptor = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation mi) throws Throwable { // Clone the invocation to proceed three times // "The Moor's Last Sigh": this technology can cause premature aging @@ -1144,6 +1159,7 @@ public abstract class AbstractAopProxyTests { }; @SuppressWarnings("serial") StaticMethodMatcherPointcutAdvisor advisor = new StaticMethodMatcherPointcutAdvisor(twoBirthdayInterceptor) { + @Override public boolean matches(Method m, Class targetClass) { return "haveBirthday".equals(m.getName()); } @@ -1173,6 +1189,7 @@ public abstract class AbstractAopProxyTests { * Changes the name, then changes it back. */ MethodInterceptor nameReverter = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation mi) throws Throwable { MethodInvocation clone = ((ReflectiveMethodInvocation) mi).invocableClone(); String oldName = ((ITestBean) mi.getThis()).getName(); @@ -1186,6 +1203,7 @@ public abstract class AbstractAopProxyTests { class NameSaver implements MethodInterceptor { private List names = new LinkedList(); + @Override public Object invoke(MethodInvocation mi) throws Throwable { names.add(mi.getArguments()[0]); return mi.proceed(); @@ -1219,12 +1237,14 @@ public abstract class AbstractAopProxyTests { ProxyFactory pc = new ProxyFactory(target); NopInterceptor overLoadVoids = new NopInterceptor(); pc.addAdvisor(new StaticMethodMatcherPointcutAdvisor(overLoadVoids) { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().equals("overload") && m.getParameterTypes().length == 0; } }); NopInterceptor overLoadInts = new NopInterceptor(); pc.addAdvisor(new StaticMethodMatcherPointcutAdvisor(overLoadInts) { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().equals("overload") && m.getParameterTypes().length == 1 && m.getParameterTypes()[0].equals(int.class); @@ -1255,19 +1275,23 @@ public abstract class AbstractAopProxyTests { Advised config = (Advised) proxy; // This class just checks proxy is bound before getTarget() call config.setTargetSource(new TargetSource() { + @Override public Class getTargetClass() { return TestBean.class; } + @Override public boolean isStatic() { return false; } + @Override public Object getTarget() throws Exception { assertEquals(proxy, AopContext.currentProxy()); return target; } + @Override public void releaseTarget(Object target) throws Exception { } }); @@ -1311,6 +1335,7 @@ public abstract class AbstractAopProxyTests { CountingBeforeAdvice cba = new CountingBeforeAdvice(); @SuppressWarnings("serial") Advisor matchesNoArgs = new StaticMethodMatcherPointcutAdvisor(cba) { + @Override public boolean matches(Method m, Class targetClass) { return m.getParameterTypes().length == 0; } @@ -1343,6 +1368,7 @@ public abstract class AbstractAopProxyTests { this.expectedValues = expectedValues; this.valuesToAdd = valuesToAdd; } + @Override public Object invoke(MethodInvocation invocation) throws Throwable { ReflectiveMethodInvocation rmi = (ReflectiveMethodInvocation) invocation; for (Iterator it = rmi.getUserAttributes().keySet().iterator(); it.hasNext(); ){ @@ -1390,6 +1416,7 @@ public abstract class AbstractAopProxyTests { CountingMultiAdvice cca = new CountingMultiAdvice(); @SuppressWarnings("serial") Advisor matchesNoArgs = new StaticMethodMatcherPointcutAdvisor(cca) { + @Override public boolean matches(Method m, Class targetClass) { return m.getParameterTypes().length == 0 || "exceptional".equals(m.getName()); } @@ -1428,6 +1455,7 @@ public abstract class AbstractAopProxyTests { final RuntimeException rex = new RuntimeException(); @SuppressWarnings("serial") CountingBeforeAdvice ba = new CountingBeforeAdvice() { + @Override public void before(Method m, Object[] args, Object target) throws Throwable { super.before(m, args, target); if (m.getName().startsWith("set")) @@ -1471,6 +1499,7 @@ public abstract class AbstractAopProxyTests { public void testAfterReturningAdvisorIsInvoked() { class SummingAfterAdvice implements AfterReturningAdvice { public int sum; + @Override public void afterReturning(Object returnValue, Method m, Object[] args, Object target) throws Throwable { sum += ((Integer) returnValue).intValue(); } @@ -1478,6 +1507,7 @@ public abstract class AbstractAopProxyTests { SummingAfterAdvice aa = new SummingAfterAdvice(); @SuppressWarnings("serial") Advisor matchesInt = new StaticMethodMatcherPointcutAdvisor(aa) { + @Override public boolean matches(Method m, Class targetClass) { return m.getReturnType() == int.class; } @@ -1535,6 +1565,7 @@ public abstract class AbstractAopProxyTests { MyThrowsHandler th = new MyThrowsHandler(); @SuppressWarnings("serial") Advisor matchesEchoInvocations = new StaticMethodMatcherPointcutAdvisor(th) { + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("echo"); } @@ -1609,6 +1640,7 @@ public abstract class AbstractAopProxyTests { private static class CheckMethodInvocationIsSameInAndOutInterceptor implements MethodInterceptor { + @Override public Object invoke(MethodInvocation mi) throws Throwable { Method m = mi.getMethod(); Object retval = mi.proceed(); @@ -1623,6 +1655,7 @@ public abstract class AbstractAopProxyTests { */ private static class CheckMethodInvocationViaThreadLocalIsSameInAndOutInterceptor implements MethodInterceptor { + @Override public Object invoke(MethodInvocation mi) throws Throwable { String task = "get invocation on way IN"; try { @@ -1649,6 +1682,7 @@ public abstract class AbstractAopProxyTests { */ private static class ProxyMatcherInterceptor implements MethodInterceptor { + @Override public Object invoke(MethodInvocation mi) throws Throwable { Object proxy = AopContext.currentProxy(); Object ret = mi.proceed(); @@ -1667,6 +1701,7 @@ public abstract class AbstractAopProxyTests { protected static class StringSetterNullReplacementAdvice extends DefaultPointcutAdvisor { private static MethodInterceptor cleaner = new MethodInterceptor() { + @Override public Object invoke(MethodInvocation mi) throws Throwable { // We know it can only be invoked if there's a single parameter of type string mi.getArguments()[0] = ""; @@ -1677,9 +1712,11 @@ public abstract class AbstractAopProxyTests { public StringSetterNullReplacementAdvice() { super(cleaner); setPointcut(new DynamicMethodMatcherPointcut() { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { return args[0] == null; } + @Override public boolean matches(Method m, Class targetClass) { return m.getName().startsWith("set") && m.getParameterTypes().length == 1 && @@ -1698,6 +1735,7 @@ public abstract class AbstractAopProxyTests { public TestDynamicPointcutAdvice(MethodInterceptor mi, final String pattern) { super(mi); setPointcut(new DynamicMethodMatcherPointcut() { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { boolean run = m.getName().indexOf(pattern) != -1; if (run) ++count; @@ -1716,11 +1754,13 @@ public abstract class AbstractAopProxyTests { public TestDynamicPointcutForSettersOnly(MethodInterceptor mi, final String pattern) { super(mi); setPointcut(new DynamicMethodMatcherPointcut() { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { boolean run = m.getName().indexOf(pattern) != -1; if (run) ++count; return run; } + @Override public boolean matches(Method m, Class clazz) { return m.getName().startsWith("set"); } @@ -1739,6 +1779,7 @@ public abstract class AbstractAopProxyTests { super(mi); this.pattern = pattern; } + @Override public boolean matches(Method m, Class targetClass) { boolean run = m.getName().indexOf(pattern) != -1; if (run) ++count; @@ -1757,6 +1798,7 @@ public abstract class AbstractAopProxyTests { public Object target; + @Override public Object invoke(MethodInvocation invocation) throws Throwable { this.target = invocation.getThis(); return invocation.proceed(); @@ -1766,6 +1808,7 @@ public abstract class AbstractAopProxyTests { private static class DummyIntroductionAdviceImpl implements DynamicIntroductionAdvice { + @Override public boolean implementsInterface(Class intf) { return true; } @@ -1774,6 +1817,7 @@ public abstract class AbstractAopProxyTests { public static class OwnSpouse extends TestBean { + @Override public ITestBean getSpouse() { return this; } @@ -1790,6 +1834,7 @@ public abstract class AbstractAopProxyTests { return getClass().hashCode(); } + @Override public void absquatulate() { } } @@ -1811,14 +1856,17 @@ public abstract class AbstractAopProxyTests { private int count; + @Override public int getCount() { return count; } + @Override public void incrementViaThis() { this.increment(); } + @Override public void incrementViaProxy() { INeedsToSeeProxy thisViaProxy = (INeedsToSeeProxy) AopContext.currentProxy(); thisViaProxy.increment(); @@ -1829,6 +1877,7 @@ public abstract class AbstractAopProxyTests { protected void checkAdvised(Advised advised) { } + @Override public void increment() { ++count; } @@ -1837,6 +1886,7 @@ public abstract class AbstractAopProxyTests { public static class TargetChecker extends NeedsToSeeProxy { + @Override protected void checkAdvised(Advised advised) { // TODO replace this check: no longer possible //assertEquals(advised.getTarget(), this); @@ -1854,11 +1904,13 @@ public abstract class AbstractAopProxyTests { this.expectedSource = expectedSource; } + @Override public void activated(AdvisedSupport advised) { assertEquals(expectedSource, advised); ++activates; } + @Override public void adviceChanged(AdvisedSupport advised) { assertEquals(expectedSource, advised); ++adviceChanges; @@ -1870,10 +1922,12 @@ public abstract class AbstractAopProxyTests { public int refreshes; + @Override public void activated(AdvisedSupport advised) { ++refreshes; } + @Override public void adviceChanged(AdvisedSupport advised) { ++refreshes; } @@ -1894,17 +1948,21 @@ public abstract class AbstractAopProxyTests { public static class Overloads implements IOverloads { + @Override public void overload() { } + @Override public int overload(int i) { return i; } + @Override public String overload(String s) { return s; } + @Override public void noAdvice() { } } @@ -1914,10 +1972,12 @@ public abstract class AbstractAopProxyTests { public static class CountingMultiAdvice extends MethodCounter implements MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice { + @Override public void before(Method m, Object[] args, Object target) throws Throwable { count(m); } + @Override public void afterReturning(Object o, Method m, Object[] args, Object target) throws Throwable { count(m); @@ -1983,6 +2043,7 @@ public abstract class AbstractAopProxyTests { /** * @see org.springframework.aop.TargetSource#getTargetClass() */ + @Override public Class getTargetClass() { return target.getClass(); } @@ -1990,6 +2051,7 @@ public abstract class AbstractAopProxyTests { /** * @see org.springframework.aop.TargetSource#getTarget() */ + @Override public Object getTarget() throws Exception { ++gets; return target; @@ -1998,6 +2060,7 @@ public abstract class AbstractAopProxyTests { /** * @see org.springframework.aop.TargetSource#releaseTarget(java.lang.Object) */ + @Override public void releaseTarget(Object pTarget) throws Exception { if (pTarget != this.target) throw new RuntimeException("Released wrong target"); @@ -2016,6 +2079,7 @@ public abstract class AbstractAopProxyTests { /** * @see org.springframework.aop.TargetSource#isStatic() */ + @Override public boolean isStatic() { return false; } @@ -2025,12 +2089,14 @@ public abstract class AbstractAopProxyTests { static abstract class ExposedInvocationTestBean extends TestBean { + @Override public String getName() { MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); assertions(invocation); return super.getName(); } + @Override public void absquatulate() { MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); assertions(invocation); @@ -2042,6 +2108,7 @@ public abstract class AbstractAopProxyTests { static class InvocationCheckExposedInvocationTestBean extends ExposedInvocationTestBean { + @Override protected void assertions(MethodInvocation invocation) { TestCase.assertTrue(invocation.getThis() == this); TestCase.assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(), diff --git a/spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java b/spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java index a52cbe3cc07..9b423759f79 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,30 +17,31 @@ package org.springframework.aop.framework; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.Serializable; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; - import org.junit.Test; - -import org.springframework.cglib.core.CodeGenerationException; - import org.springframework.aop.ClassFilter; import org.springframework.aop.MethodMatcher; import org.springframework.aop.Pointcut; import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.DefaultPointcutAdvisor; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.cglib.core.CodeGenerationException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextException; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; -import test.advice.CountingBeforeAdvice; -import test.interceptor.NopInterceptor; import test.mixin.LockMixinAdvisor; /** @@ -58,6 +59,7 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri private static final String DEPENDENCY_CHECK_CONTEXT = CglibProxyTests.class.getSimpleName() + "-with-dependency-checking.xml"; + @Override protected Object createProxy(ProxyCreatorSupport as) { as.setProxyTargetClass(true); Object proxy = as.createAopProxy().getProxy(); @@ -65,11 +67,13 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri return proxy; } + @Override protected AopProxy createAopProxy(AdvisedSupport as) { as.setProxyTargetClass(true); return new CglibAopProxy(as); } + @Override protected boolean requiresTarget() { return true; } @@ -207,10 +211,12 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri MethodInterceptor advice = new NopInterceptor(); Pointcut pointcut = new Pointcut() { + @Override public ClassFilter getClassFilter() { return ClassFilter.TRUE; } + @Override public MethodMatcher getMethodMatcher() { return MethodMatcher.TRUE; } @@ -492,6 +498,7 @@ class UnsupportedInterceptor implements MethodInterceptor { /** * @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation) */ + @Override public Object invoke(MethodInvocation mi) throws Throwable { throw new UnsupportedOperationException(mi.getMethod().getName()); } diff --git a/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java b/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java index b845070078f..77101f6cc90 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,11 +16,9 @@ package org.springframework.aop.framework; -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; import java.io.Serializable; @@ -29,9 +27,9 @@ import org.aopalliance.intercept.MethodInvocation; import org.springframework.aop.interceptor.ExposeInvocationInterceptor; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.IOther; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.IOther; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @since 13.03.2003 @@ -42,6 +40,7 @@ import org.springframework.beans.TestBean; @SuppressWarnings("serial") public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements Serializable { + @Override protected Object createProxy(ProxyCreatorSupport as) { assertFalse("Not forcible CGLIB", as.isProxyTargetClass()); Object proxy = as.createAopProxy().getProxy(); @@ -49,6 +48,7 @@ public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements return proxy; } + @Override protected AopProxy createAopProxy(AdvisedSupport as) { return new JdkDynamicAopProxy(as); } @@ -78,22 +78,21 @@ public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements public void testInterceptorIsInvokedWithNoTarget() throws Throwable { // Test return value int age = 25; - MethodInterceptor mi = createMock(MethodInterceptor.class); + MethodInterceptor mi = mock(MethodInterceptor.class); AdvisedSupport pc = new AdvisedSupport(new Class[] { ITestBean.class }); pc.addAdvice(mi); AopProxy aop = createAopProxy(pc); - expect(mi.invoke(null)).andReturn(age); - replay(mi); + given(mi.invoke(null)).willReturn(age); ITestBean tb = (ITestBean) aop.getProxy(); assertTrue("correct return value", tb.getAge() == age); - verify(mi); } public void testTargetCanGetInvocationWithPrivateClass() throws Throwable { final ExposedInvocationTestBean expectedTarget = new ExposedInvocationTestBean() { + @Override protected void assertions(MethodInvocation invocation) { assertTrue(invocation.getThis() == this); assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(), @@ -104,6 +103,7 @@ public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements AdvisedSupport pc = new AdvisedSupport(new Class[] { ITestBean.class, IOther.class }); pc.addAdvice(ExposeInvocationInterceptor.INSTANCE); TrapTargetInterceptor tii = new TrapTargetInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { // Assert that target matches BEFORE invocation returns assertEquals("Target is correct", expectedTarget, invocation.getThis()); @@ -165,10 +165,12 @@ public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements public static class FooBar implements Foo, Bar { + @Override public Bar getBarThis() { return this; } + @Override public Foo getFooThis() { return this; } @@ -189,6 +191,7 @@ public final class JdkDynamicProxyTests extends AbstractAopProxyTests implements private final String name = "Rob Harrop"; + @Override public String getName() { return this.name; } diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-autowiring.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-autowiring.xml index 27e7988a7a7..3cda6a7921a 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-autowiring.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-autowiring.xml @@ -3,12 +3,12 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-context.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-context.xml index 8c0a313a7c3..7675fe6e0e4 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-context.xml @@ -4,19 +4,19 @@ - + custom 666 - + - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean - debugInterceptor + debugInterceptor - + - org.springframework.beans.ITestBean - + org.springframework.tests.sample.beans.ITestBean + global*,test - + - + - org.springframework.beans.ITestBean - + org.springframework.tests.sample.beans.ITestBean + false test - + - org.springframework.beans.ITestBean - + org.springframework.tests.sample.beans.ITestBean + false test - + true @@ -74,7 +74,7 @@ testCircleTarget1 - + custom 666 @@ -85,18 +85,18 @@ testCircleTarget2 - + custom 666 - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean pointcutForVoid test - + - + org.springframework.context.ApplicationListener debugInterceptor,global*,target2 @@ -137,10 +137,10 @@ - + - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean false @@ -155,7 +155,7 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean test.mixin.Lockable diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-double-targetsource.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-double-targetsource.xml index 795cea64182..dde1f91017d 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-double-targetsource.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-double-targetsource.xml @@ -10,13 +10,13 @@ - + Eve - + Adam @@ -27,12 +27,12 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean countingBeforeAdvice,adamTargetSource @@ -42,7 +42,7 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean adam diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-frozen.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-frozen.xml index 45a4c2707b7..d0f5a89896c 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-frozen.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-frozen.xml @@ -4,25 +4,25 @@ - + custom 666 - + + - - + - - - org.springframework.beans.ITestBean - - - debugInterceptor + > + org.springframework.tests.sample.beans.ITestBean + + + debugInterceptor true true - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-inner-bean-target.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-inner-bean-target.xml index 92faa57c4fc..e59244c49cb 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-inner-bean-target.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-inner-bean-target.xml @@ -9,31 +9,30 @@ - + - + + > - + innerBeanTarget - + nopInterceptor - - - - - - - \ No newline at end of file + + + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-invalid.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-invalid.xml index de65fec0fe1..fd46c5552fd 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-invalid.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-invalid.xml @@ -5,7 +5,7 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean @@ -14,7 +14,7 @@ Must have target after *. --> - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean global* diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-notlast-targetsource.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-notlast-targetsource.xml index 92ef595c55c..47cd14f94d4 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-notlast-targetsource.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-notlast-targetsource.xml @@ -9,12 +9,12 @@ - + Adam - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean adam,countingBeforeAdvice diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-prototype.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-prototype.xml index f437df5edf0..291385ce50a 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-prototype.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-prototype.xml @@ -7,15 +7,15 @@ - + 10 - + 10 - + debugInterceptor,test diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-serialization.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-serialization.xml index 4131b85d785..396bfada125 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-serialization.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-serialization.xml @@ -6,35 +6,35 @@ --> - + - + - serializableNopInterceptor - org.springframework.beans.Person + serializableNopInterceptor + org.springframework.tests.sample.beans.Person - + serializableSingleton - + serializablePrototype - serializableNopInterceptor,prototypeTarget - org.springframework.beans.Person + serializableNopInterceptor,prototypeTarget + org.springframework.tests.sample.beans.Person false nopInterceptor - + - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-targetsource.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-targetsource.xml index 4e9ab797adc..07f2825c1fc 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-targetsource.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-targetsource.xml @@ -8,18 +8,18 @@ - + Adam - - + + - + - + - org.springframework.beans.ITestBean + class="org.springframework.aop.framework.ProxyFactoryBean"> + org.springframework.tests.sample.beans.ITestBean nopInterceptor,unsupportedInterceptor - - - + + + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-throws-advice.xml b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-throws-advice.xml index 1efb2ae3053..036dac321fa 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-throws-advice.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests-throws-advice.xml @@ -9,18 +9,18 @@ - - - - - - - - - + + + + + + + + + countingBeforeAdvice,nopInterceptor,throwsAdvice,target - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java index 6c255751b4d..f55c1a41b30 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,16 @@ package org.springframework.aop.framework; -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.FileNotFoundException; import java.io.IOException; @@ -39,30 +47,29 @@ import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.DefaultIntroductionAdvisor; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.DynamicMethodMatcherPointcut; -import org.springframework.beans.ITestBean; -import org.springframework.beans.Person; -import org.springframework.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationListener; import org.springframework.context.TestListener; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.TimeStamped; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; +import org.springframework.tests.aop.advice.MyThrowsHandler; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.aop.interceptor.TimestampIntroductionInterceptor; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.Person; +import org.springframework.tests.sample.beans.SideEffectBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.util.SerializationTestUtils; -import test.advice.CountingBeforeAdvice; -import test.advice.MyThrowsHandler; -import test.interceptor.NopInterceptor; -import test.interceptor.TimestampIntroductionInterceptor; import test.mixin.Lockable; import test.mixin.LockedException; -import test.util.TimeStamped; - -import test.beans.SideEffectBean; /** * @since 13.03.2003 @@ -93,7 +100,9 @@ public final class ProxyFactoryBeanTests { public void setUp() throws Exception { DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); parent.registerBeanDefinition("target2", new RootBeanDefinition(TestListener.class)); - this.factory = new XmlBeanFactory(new ClassPathResource(CONTEXT, getClass()), parent); + this.factory = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader((BeanDefinitionRegistry) this.factory).loadBeanDefinitions( + new ClassPathResource(CONTEXT, getClass())); } @Test @@ -133,7 +142,8 @@ public final class ProxyFactoryBeanTests { private void testDoubleTargetSourceIsRejected(String name) { try { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(DBL_TARGETSOURCE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(DBL_TARGETSOURCE_CONTEXT, CLASS)); bf.getBean(name); fail("Should not allow TargetSource to be specified in interceptorNames as well as targetSource property"); } @@ -147,7 +157,8 @@ public final class ProxyFactoryBeanTests { @Test public void testTargetSourceNotAtEndOfInterceptorNamesIsRejected() { try { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(NOTLAST_TARGETSOURCE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(NOTLAST_TARGETSOURCE_CONTEXT, CLASS)); bf.getBean("targetSourceNotLast"); fail("TargetSource or non-advised object must be last in interceptorNames"); } @@ -160,7 +171,8 @@ public final class ProxyFactoryBeanTests { @Test public void testGetObjectTypeWithDirectTarget() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); // We have a counting before advice here CountingBeforeAdvice cba = (CountingBeforeAdvice) bf.getBean("countingBeforeAdvice"); @@ -176,7 +188,8 @@ public final class ProxyFactoryBeanTests { @Test public void testGetObjectTypeWithTargetViaTargetSource() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); ITestBean tb = (ITestBean) bf.getBean("viaTargetSource"); assertTrue(tb.getName().equals("Adam")); ProxyFactoryBean pfb = (ProxyFactoryBean) bf.getBean("&viaTargetSource"); @@ -185,7 +198,8 @@ public final class ProxyFactoryBeanTests { @Test public void testGetObjectTypeWithNoTargetOrTargetSource() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(TARGETSOURCE_CONTEXT, CLASS)); ITestBean tb = (ITestBean) bf.getBean("noTarget"); try { @@ -246,7 +260,8 @@ public final class ProxyFactoryBeanTests { // Initial count value set in bean factory XML int INITIAL_COUNT = 10; - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(PROTOTYPE_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(PROTOTYPE_CONTEXT, CLASS)); // Check it works without AOP SideEffectBean raw = (SideEffectBean) bf.getBean("prototypeTarget"); @@ -307,6 +322,7 @@ public final class ProxyFactoryBeanTests { final Exception ex = new UnsupportedOperationException("invoke"); // Add evil interceptor to head of list config.addAdvice(0, new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { throw ex; } @@ -337,7 +353,8 @@ public final class ProxyFactoryBeanTests { */ @Test public void testTargetAsInnerBean() { - ListableBeanFactory bf = new XmlBeanFactory(new ClassPathResource(INNER_BEAN_TARGET_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(INNER_BEAN_TARGET_CONTEXT, CLASS)); ITestBean itb = (ITestBean) bf.getBean("testBean"); assertEquals("innerBeanTarget", itb.getName()); assertEquals("Only have proxy and interceptor: no target", 3, bf.getBeanDefinitionCount()); @@ -440,7 +457,8 @@ public final class ProxyFactoryBeanTests { @Test public void testCanAddThrowsAdviceWithoutAdvisor() throws Throwable { - BeanFactory f = new XmlBeanFactory(new ClassPathResource(THROWS_ADVICE_CONTEXT, CLASS)); + DefaultListableBeanFactory f = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(f).loadBeanDefinitions(new ClassPathResource(THROWS_ADVICE_CONTEXT, CLASS)); MyThrowsHandler th = (MyThrowsHandler) f.getBean("throwsAdvice"); CountingBeforeAdvice cba = (CountingBeforeAdvice) f.getBean("countingBeforeAdvice"); assertEquals(0, cba.getCalls()); @@ -497,9 +515,10 @@ public final class ProxyFactoryBeanTests { @Test public void testEmptyInterceptorNames() { - XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource(INVALID_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(INVALID_CONTEXT, CLASS)); try { - factory.getBean("emptyInterceptorNames"); + bf.getBean("emptyInterceptorNames"); fail("Interceptor names cannot be empty"); } catch (BeanCreationException ex) { @@ -512,9 +531,10 @@ public final class ProxyFactoryBeanTests { */ @Test public void testGlobalsWithoutTarget() { - XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource(INVALID_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(INVALID_CONTEXT, CLASS)); try { - factory.getBean("globalsWithoutTarget"); + bf.getBean("globalsWithoutTarget"); fail("Should require target name"); } catch (BeanCreationException ex) { @@ -553,7 +573,8 @@ public final class ProxyFactoryBeanTests { @Test public void testSerializableSingletonProxy() throws Exception { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); Person p = (Person) bf.getBean("serializableSingleton"); assertSame("Should be a Singleton", p, bf.getBean("serializableSingleton")); Person p2 = (Person) SerializationTestUtils.serializeAndDeserialize(p); @@ -575,7 +596,8 @@ public final class ProxyFactoryBeanTests { @Test public void testSerializablePrototypeProxy() throws Exception { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); Person p = (Person) bf.getBean("serializablePrototype"); assertNotSame("Should not be a Singleton", p, bf.getBean("serializablePrototype")); Person p2 = (Person) SerializationTestUtils.serializeAndDeserialize(p); @@ -586,7 +608,8 @@ public final class ProxyFactoryBeanTests { @Test public void testSerializableSingletonProxyFactoryBean() throws Exception { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); Person p = (Person) bf.getBean("serializableSingleton"); ProxyFactoryBean pfb = (ProxyFactoryBean) bf.getBean("&serializableSingleton"); ProxyFactoryBean pfb2 = (ProxyFactoryBean) SerializationTestUtils.serializeAndDeserialize(pfb); @@ -598,14 +621,16 @@ public final class ProxyFactoryBeanTests { @Test public void testProxyNotSerializableBecauseOfAdvice() throws Exception { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(SERIALIZATION_CONTEXT, CLASS)); Person p = (Person) bf.getBean("interceptorNotSerializableSingleton"); assertFalse("Not serializable because an interceptor isn't serializable", SerializationTestUtils.isSerializable(p)); } @Test public void testPrototypeAdvisor() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(CONTEXT, CLASS)); ITestBean bean1 = (ITestBean) bf.getBean("prototypeTestBeanProxy"); ITestBean bean2 = (ITestBean) bf.getBean("prototypeTestBeanProxy"); @@ -636,7 +661,8 @@ public final class ProxyFactoryBeanTests { @Test public void testPrototypeInterceptorSingletonTarget() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(CONTEXT, CLASS)); ITestBean bean1 = (ITestBean) bf.getBean("prototypeTestBeanProxySingletonTarget"); ITestBean bean2 = (ITestBean) bf.getBean("prototypeTestBeanProxySingletonTarget"); @@ -670,13 +696,15 @@ public final class ProxyFactoryBeanTests { */ @Test public void testInnerBeanTargetUsingAutowiring() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(AUTOWIRING_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(AUTOWIRING_CONTEXT, CLASS)); bf.getBean("testBean"); } @Test public void testFrozenFactoryBean() { - BeanFactory bf = new XmlBeanFactory(new ClassPathResource(FROZEN_CONTEXT, CLASS)); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource(FROZEN_CONTEXT, CLASS)); Advised advised = (Advised)bf.getBean("frozen"); assertTrue("The proxy should be frozen", advised.isFrozen()); @@ -705,12 +733,14 @@ public final class ProxyFactoryBeanTests { public PointcutForVoid() { setAdvice(new MethodInterceptor() { + @Override public Object invoke(MethodInvocation invocation) throws Throwable { methodNames.add(invocation.getMethod().getName()); return invocation.proceed(); } }); setPointcut(new DynamicMethodMatcherPointcut() { + @Override public boolean matches(Method m, Class targetClass, Object[] args) { return m.getReturnType() == Void.TYPE; } @@ -734,10 +764,12 @@ public final class ProxyFactoryBeanTests { */ public static class GlobalAspectInterfaceInterceptor implements IntroductionInterceptor { + @Override public boolean implementsInterface(Class intf) { return intf.equals(AddedGlobalInterface.class); } + @Override public Object invoke(MethodInvocation mi) throws Throwable { if (mi.getMethod().getDeclaringClass().equals(AddedGlobalInterface.class)) { return new Integer(-1); @@ -751,22 +783,27 @@ public final class ProxyFactoryBeanTests { private IntroductionInterceptor gi = new GlobalAspectInterfaceInterceptor(); + @Override public ClassFilter getClassFilter() { return ClassFilter.TRUE; } + @Override public Advice getAdvice() { return this.gi; } + @Override public Class[] getInterfaces() { return new Class[] { AddedGlobalInterface.class }; } + @Override public boolean isPerInstance() { return false; } + @Override public void validateInterfaces() { } } diff --git a/spring-context/src/test/java/org/springframework/aop/framework/_TestTypes.java b/spring-context/src/test/java/org/springframework/aop/framework/_TestTypes.java index 216510950ed..ea1924b1018 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/_TestTypes.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/_TestTypes.java @@ -27,14 +27,17 @@ interface IEcho { class Echo implements IEcho { private int a; + @Override public int echoException(int i, Throwable t) throws Throwable { if (t != null) throw t; return i; } + @Override public void setA(int a) { this.a = a; } + @Override public int getA() { return a; } diff --git a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-with-bpp.xml b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-with-bpp.xml index 0aa3b46d648..a58e040b67d 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-with-bpp.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-with-bpp.xml @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean simpleBeforeAdviceAdvisor,testBeanTarget diff --git a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-without-bpp.xml b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-without-bpp.xml index 36718003309..69bd476f3b2 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-without-bpp.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests-without-bpp.xml @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean simpleBeforeAdviceAdvisor,testBeanTarget diff --git a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java index 39dc7410b81..e708c9f1791 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.aop.Advisor; import org.springframework.aop.BeforeAdvice; import org.springframework.aop.framework.Advised; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -96,10 +96,12 @@ interface SimpleBeforeAdvice extends BeforeAdvice { @SuppressWarnings("serial") class SimpleBeforeAdviceAdapter implements AdvisorAdapter, Serializable { + @Override public boolean supportsAdvice(Advice advice) { return (advice instanceof SimpleBeforeAdvice); } + @Override public MethodInterceptor getInterceptor(Advisor advisor) { SimpleBeforeAdvice advice = (SimpleBeforeAdvice) advisor.getAdvice(); return new SimpleBeforeAdviceInterceptor(advice) ; @@ -112,6 +114,7 @@ class SimpleBeforeAdviceImpl implements SimpleBeforeAdvice { private int invocationCounter; + @Override public void before() throws Throwable { ++invocationCounter; } @@ -131,6 +134,7 @@ final class SimpleBeforeAdviceInterceptor implements MethodInterceptor { this.advice = advice; } + @Override public Object invoke(MethodInvocation mi) throws Throwable { advice.before(); return mi.proceed(); diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests-common-interceptors.xml b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests-common-interceptors.xml index 286f8c840dd..c64c7e6ef74 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests-common-interceptors.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests-common-interceptors.xml @@ -20,7 +20,7 @@ - + - + Rod - + Rod - + Rod diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests.java b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests.java index 185075670f9..bf1fc8b5a78 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,9 @@ package org.springframework.aop.framework.autoproxy; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -29,13 +31,13 @@ import org.springframework.aop.target.CommonsPoolTargetSource; import org.springframework.aop.target.LazyInitTargetSource; import org.springframework.aop.target.PrototypeTargetSource; import org.springframework.aop.target.ThreadLocalTargetSource; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.sample.beans.CountingTestBean; +import org.springframework.tests.sample.beans.ITestBean; -import test.advice.CountingBeforeAdvice; -import test.interceptor.NopInterceptor; import test.mixin.Lockable; /** @@ -204,20 +206,9 @@ public final class AdvisorAutoProxyCreatorTests { } - -class CountingTestBean extends TestBean { - - public static int count = 0; - - public CountingTestBean() { - count++; - } - -} - - class SelectivePrototypeTargetSourceCreator extends AbstractBeanFactoryBasedTargetSourceCreator { + @Override protected AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource( Class beanClass, String beanName) { if (!beanName.startsWith("prototype")) { diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AutoProxyCreatorTests.java b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AutoProxyCreatorTests.java index f8b0e7a01ff..d9a838ee2ab 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AutoProxyCreatorTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/AutoProxyCreatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -24,11 +24,11 @@ import org.junit.Test; import org.springframework.aop.TargetSource; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; -import org.springframework.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.DummyFactory; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.support.RootBeanDefinition; @@ -55,7 +55,8 @@ public final class AutoProxyCreatorTests { proxyCreator.getPropertyValues().add("beanNames", "singletonToBeProxied,innerBean,singletonFactoryToBeProxied"); sac.getDefaultListableBeanFactory().registerBeanDefinition("beanNameAutoProxyCreator", proxyCreator); - RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, RootBeanDefinition.AUTOWIRE_BY_TYPE); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); + bd.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE); RootBeanDefinition innerBean = new RootBeanDefinition(TestBean.class); bd.getPropertyValues().add("spouse", new BeanDefinitionHolder(innerBean, "innerBean")); sac.getDefaultListableBeanFactory().registerBeanDefinition("singletonToBeProxied", bd); @@ -281,6 +282,7 @@ public final class AutoProxyCreatorTests { this.proxyObject = proxyObject; } + @Override protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String name, TargetSource customTargetSource) { if (StaticMessageSource.class.equals(beanClass)) { return DO_NOT_PROXY; @@ -308,6 +310,7 @@ public final class AutoProxyCreatorTests { public int nrOfInvocations = 0; + @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (!invocation.getMethod().getName().equals("finalize")) { this.nrOfInvocations++; diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests-context.xml b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests-context.xml index 53d945697e8..d53272f0d58 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests-context.xml @@ -24,6 +24,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests.java b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests.java index 77bbaf3e3c2..49216292485 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests.java +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorInitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import java.lang.reflect.Method; import org.junit.Test; import org.springframework.aop.MethodBeforeAdvice; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -47,6 +47,7 @@ public final class BeanNameAutoProxyCreatorInitTests { class NullChecker implements MethodBeforeAdvice { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { check(args); } diff --git a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorTests-context.xml b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorTests-context.xml index 0f4b265b721..c9727ea856e 100644 --- a/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorTests-context.xml +++ b/spring-context/src/test/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreatorTests-context.xml @@ -59,7 +59,7 @@ - + - + - + prototypePerson diff --git a/spring-context/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceTests.java b/spring-context/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceTests.java index cf6e0789b6e..5ec8db261f8 100644 --- a/spring-context/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceTests.java +++ b/spring-context/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,10 @@ package org.springframework.aop.target; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.util.NoSuchElementException; @@ -25,14 +28,15 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.aop.framework.Advised; -import org.springframework.beans.Person; -import org.springframework.beans.SerializablePerson; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.tests.sample.beans.Person; +import org.springframework.tests.sample.beans.SerializablePerson; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.util.SerializationTestUtils; -import test.beans.SideEffectBean; +import org.springframework.tests.sample.beans.SideEffectBean; /** * Tests for pooling invoker interceptor. @@ -50,11 +54,13 @@ public class CommonsPoolTargetSourceTests { */ private static final int INITIAL_COUNT = 10; - private XmlBeanFactory beanFactory; + private DefaultListableBeanFactory beanFactory; @Before public void setUp() throws Exception { - this.beanFactory = new XmlBeanFactory(new ClassPathResource(getClass().getSimpleName() + "-context.xml", getClass())); + this.beanFactory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions( + new ClassPathResource(getClass().getSimpleName() + "-context.xml", getClass())); } /** diff --git a/spring-context/src/test/java/org/springframework/beans/Colour.java b/spring-context/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-context/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-context/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/IOther.java b/spring-context/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/ITestBean.java b/spring-context/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-context/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index e44bac1740b..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList<>(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet<>(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap<>(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList<>(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-context/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/Person.java b/spring-context/src/test/java/org/springframework/beans/Person.java deleted file mode 100644 index a78998ad5d4..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/Person.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * - * @author Rod Johnson - */ -public interface Person { - - String getName(); - void setName(String name); - int getAge(); - void setAge(int i); - - /** - * Test for non-property method matching. - * If the parameter is a Throwable, it will be thrown rather than - * returned. - */ - Object echo(Object o) throws Throwable; -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/SerializablePerson.java b/spring-context/src/test/java/org/springframework/beans/SerializablePerson.java deleted file mode 100644 index 13c2c5447a5..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/SerializablePerson.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.util.ObjectUtils; - -/** - * Serializable implementation of the Person interface. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class SerializablePerson implements Person, Serializable { - - private String name; - private int age; - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Object echo(Object o) throws Throwable { - if (o instanceof Throwable) { - throw (Throwable) o; - } - return o; - } - - public boolean equals(Object other) { - if (!(other instanceof SerializablePerson)) { - return false; - } - SerializablePerson p = (SerializablePerson) other; - return p.age == age && ObjectUtils.nullSafeEquals(name, p.name); - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java b/spring-context/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java deleted file mode 100644 index a04d1796443..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans.factory; - -import java.beans.PropertyEditorSupport; -import java.util.StringTokenizer; - -import junit.framework.TestCase; -import junit.framework.Assert; - -import org.springframework.beans.BeansException; -import org.springframework.beans.PropertyBatchUpdateException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; - -/** - * Subclasses must implement setUp() to initialize bean factory - * and any other variables they need. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractBeanFactoryTests extends TestCase { - - protected abstract BeanFactory getBeanFactory(); - - /** - * Roderick beans inherits from rod, overriding name only. - */ - public void testInheritance() { - assertTrue(getBeanFactory().containsBean("rod")); - assertTrue(getBeanFactory().containsBean("roderick")); - TestBean rod = (TestBean) getBeanFactory().getBean("rod"); - TestBean roderick = (TestBean) getBeanFactory().getBean("roderick"); - assertTrue("not == ", rod != roderick); - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - assertTrue("roderick.name is Roderick", roderick.getName().equals("Roderick")); - assertTrue("roderick.age was inherited", roderick.getAge() == rod.getAge()); - } - - public void testGetBeanWithNullArg() { - try { - getBeanFactory().getBean((String) null); - fail("Can't get null bean"); - } - catch (IllegalArgumentException ex) { - // OK - } - } - - /** - * Test that InitializingBean objects receive the afterPropertiesSet() callback - */ - public void testInitializingBeanCallback() { - MustBeInitialized mbi = (MustBeInitialized) getBeanFactory().getBean("mustBeInitialized"); - // The dummy business method will throw an exception if the - // afterPropertiesSet() callback wasn't invoked - mbi.businessMethod(); - } - - /** - * Test that InitializingBean/BeanFactoryAware/DisposableBean objects receive the - * afterPropertiesSet() callback before BeanFactoryAware callbacks - */ - public void testLifecycleCallbacks() { - LifecycleBean lb = (LifecycleBean) getBeanFactory().getBean("lifecycle"); - Assert.assertEquals("lifecycle", lb.getBeanName()); - // The dummy business method will throw an exception if the - // necessary callbacks weren't invoked in the right order. - lb.businessMethod(); - assertTrue("Not destroyed", !lb.isDestroyed()); - } - - public void testFindsValidInstance() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - TestBean rod = (TestBean) o; - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - assertTrue("Actual type is correct", ex.getActualType() == getBeanFactory().getBean("rod").getClass()); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetSharedInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetSharedInstanceByMatchingClassNoCatch() { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - - public void testGetSharedInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testSharedInstancesAreEqual() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean1 is a TestBean", o instanceof TestBean); - Object o1 = getBeanFactory().getBean("rod"); - assertTrue("Rod bean2 is a TestBean", o1 instanceof TestBean); - assertTrue("Object equals applies", o == o1); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testPrototypeInstancesAreIndependent() { - TestBean tb1 = (TestBean) getBeanFactory().getBean("kathy"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("kathy"); - assertTrue("ref equal DOES NOT apply", tb1 != tb2); - assertTrue("object equal true", tb1.equals(tb2)); - tb1.setAge(1); - tb2.setAge(2); - assertTrue("1 age independent = 1", tb1.getAge() == 1); - assertTrue("2 age independent = 2", tb2.getAge() == 2); - assertTrue("object equal now false", !tb1.equals(tb2)); - } - - public void testNotThere() { - assertFalse(getBeanFactory().containsBean("Mr Squiggle")); - try { - Object o = getBeanFactory().getBean("Mr Squiggle"); - fail("Can't find missing bean"); - } - catch (BeansException ex) { - //ex.printStackTrace(); - //fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testValidEmpty() { - try { - Object o = getBeanFactory().getBean("validEmpty"); - assertTrue("validEmpty bean is a TestBean", o instanceof TestBean); - TestBean ve = (TestBean) o; - assertTrue("Valid empty has defaults", ve.getName() == null && ve.getAge() == 0 && ve.getSpouse() == null); - } - catch (BeansException ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on valid empty"); - } - } - - public void xtestTypeMismatch() { - try { - Object o = getBeanFactory().getBean("typeMismatch"); - fail("Shouldn't succeed with type mismatch"); - } - catch (BeanCreationException wex) { - assertEquals("typeMismatch", wex.getBeanName()); - assertTrue(wex.getCause() instanceof PropertyBatchUpdateException); - PropertyBatchUpdateException ex = (PropertyBatchUpdateException) wex.getCause(); - // Further tests - assertTrue("Has one error ", ex.getExceptionCount() == 1); - assertTrue("Error is for field age", ex.getPropertyAccessException("age") != null); - assertTrue("We have rejected age in exception", ex.getPropertyAccessException("age").getPropertyChangeEvent().getNewValue().equals("34x")); - } - } - - public void testGrandparentDefinitionFoundInBeanFactory() throws Exception { - TestBean dad = (TestBean) getBeanFactory().getBean("father"); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testFactorySingleton() throws Exception { - assertTrue(getBeanFactory().isSingleton("&singletonFactory")); - assertTrue(getBeanFactory().isSingleton("singletonFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton from factory has correct name, not " + tb.getName(), tb.getName().equals(DummyFactory.SINGLETON_NAME)); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton references ==", tb == tb2); - assertTrue("FactoryBean is BeanFactoryAware", factory.getBeanFactory() != null); - } - - public void testFactoryPrototype() throws Exception { - assertTrue(getBeanFactory().isSingleton("&prototypeFactory")); - assertFalse(getBeanFactory().isSingleton("prototypeFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue(!tb.getName().equals(DummyFactory.SINGLETON_NAME)); - TestBean tb2 = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue("Prototype references !=", tb != tb2); - } - - /** - * Check that we can get the factory bean itself. - * This is only possible if we're dealing with a factory - * @throws Exception - */ - public void testGetFactoryItself() throws Exception { - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue(factory != null); - } - - /** - * Check that afterPropertiesSet gets called on factory - * @throws Exception - */ - public void testFactoryIsInitialized() throws Exception { - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized()); - } - - /** - * It should be illegal to dereference a normal bean - * as a factory - */ - public void testRejectsFactoryGetOnNormalBean() { - try { - getBeanFactory().getBean("&rod"); - fail("Shouldn't permit factory get on normal bean"); - } - catch (BeanIsNotAFactoryException ex) { - // Ok - } - } - - // TODO: refactor in AbstractBeanFactory (tests for AbstractBeanFactory) - // and rename this class - public void testAliasing() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ConfigurableBeanFactory)) { - return; - } - ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) bf; - - String alias = "rods alias"; - try { - cbf.getBean(alias); - fail("Shouldn't permit factory get on normal bean"); - } - catch (NoSuchBeanDefinitionException ex) { - // Ok - assertTrue(alias.equals(ex.getBeanName())); - } - - // Create alias - cbf.registerAlias("rod", alias); - Object rod = getBeanFactory().getBean("rod"); - Object aliasRod = getBeanFactory().getBean(alias); - assertTrue(rod == aliasRod); - } - - - public static class TestBeanEditor extends PropertyEditorSupport { - - public void setAsText(String text) { - TestBean tb = new TestBean(); - StringTokenizer st = new StringTokenizer(text, "_"); - tb.setName(st.nextToken()); - tb.setAge(Integer.parseInt(st.nextToken())); - setValue(tb); - } - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java b/spring-context/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java deleted file mode 100644 index d683491a1f6..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import junit.framework.Assert; - -import org.springframework.beans.TestBean; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFactoryTests { - - /** Subclasses must initialize this */ - protected ListableBeanFactory getListableBeanFactory() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ListableBeanFactory)) { - throw new IllegalStateException("ListableBeanFactory required"); - } - return (ListableBeanFactory) bf; - } - - /** - * Subclasses can override this. - */ - public void testCount() { - assertCount(13); - } - - protected final void assertCount(int count) { - String[] defnames = getListableBeanFactory().getBeanDefinitionNames(); - Assert.assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count); - } - - public void assertTestBeanCount(int count) { - String[] defNames = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, false); - Assert.assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " + - defNames.length, defNames.length == count); - - int countIncludingFactoryBeans = count + 2; - String[] names = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, true); - Assert.assertTrue("We should have " + countIncludingFactoryBeans + - " beans for class org.springframework.beans.TestBean, not " + names.length, - names.length == countIncludingFactoryBeans); - } - - public void testGetDefinitionsForNoSuchClass() { - String[] defnames = getListableBeanFactory().getBeanNamesForType(String.class); - Assert.assertTrue("No string definitions", defnames.length == 0); - } - - /** - * Check that count refers to factory class, not bean class. (We don't know - * what type factories may return, and it may even change over time.) - */ - public void testGetCountForFactoryClass() { - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - } - - public void testContainsBeanDefinition() { - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("rod")); - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("roderick")); - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/factory/LifecycleBean.java b/spring-context/src/test/java/org/springframework/beans/factory/LifecycleBean.java deleted file mode 100644 index 19b7da62f8d..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/LifecycleBean.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; - -/** - * Simple test of BeanFactory initialization and lifecycle callbacks. - * - * @author Rod Johnson - * @author Colin Sampaleanu - * @since 12.03.2003 - */ -public class LifecycleBean implements BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - protected boolean initMethodDeclared = false; - - protected String beanName; - - protected BeanFactory owningFactory; - - protected boolean postProcessedBeforeInit; - - protected boolean inited; - - protected boolean initedViaDeclaredInitMethod; - - protected boolean postProcessedAfterInit; - - protected boolean destroyed; - - - public void setInitMethodDeclared(boolean initMethodDeclared) { - this.initMethodDeclared = initMethodDeclared; - } - - public boolean isInitMethodDeclared() { - return initMethodDeclared; - } - - public void setBeanName(String name) { - this.beanName = name; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.owningFactory = beanFactory; - } - - public void postProcessBeforeInit() { - if (this.inited || this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessBeforeInit after afterPropertiesSet"); - } - if (this.postProcessedBeforeInit) { - throw new RuntimeException("Factory called postProcessBeforeInit twice"); - } - this.postProcessedBeforeInit = true; - } - - public void afterPropertiesSet() { - if (this.owningFactory == null) { - throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); - } - if (!this.postProcessedBeforeInit) { - throw new RuntimeException("Factory didn't call postProcessBeforeInit before afterPropertiesSet on lifecycle bean"); - } - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory initialized via declared init method before initializing via afterPropertiesSet"); - } - if (this.inited) { - throw new RuntimeException("Factory called afterPropertiesSet twice"); - } - this.inited = true; - } - - public void declaredInitMethod() { - if (!this.inited) { - throw new RuntimeException("Factory didn't call afterPropertiesSet before declared init method"); - } - - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called declared init method twice"); - } - this.initedViaDeclaredInitMethod = true; - } - - public void postProcessAfterInit() { - if (!this.inited) { - throw new RuntimeException("Factory called postProcessAfterInit before afterPropertiesSet"); - } - if (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessAfterInit before calling declared init method"); - } - if (this.postProcessedAfterInit) { - throw new RuntimeException("Factory called postProcessAfterInit twice"); - } - this.postProcessedAfterInit = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited || (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) || - !this.postProcessedAfterInit) { - throw new RuntimeException("Factory didn't initialize lifecycle object correctly"); - } - } - - public void destroy() { - if (this.destroyed) { - throw new IllegalStateException("Already destroyed"); - } - this.destroyed = true; - } - - public boolean isDestroyed() { - return destroyed; - } - - - public static class PostProcessor implements BeanPostProcessor { - - public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessBeforeInit(); - } - return bean; - } - - public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessAfterInit(); - } - return bean; - } - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java b/spring-context/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java deleted file mode 100644 index 0e8a09a5a78..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory.access; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.util.ClassUtils; - -/** - * @author Colin Sampaleanu - * @author Chris Beams - */ -public class SingletonBeanFactoryLocatorTests { - - @Test - public void testBasicFunctionality() { - SingletonBeanFactoryLocator facLoc = new SingletonBeanFactoryLocator( - "classpath*:" + ClassUtils.addResourcePathToPackagePath(getClass(), "ref1.xml")); - - basicFunctionalityTest(facLoc); - } - - /** - * Worker method so subclass can use it too. - */ - protected void basicFunctionalityTest(SingletonBeanFactoryLocator facLoc) { - BeanFactoryReference bfr = facLoc.useBeanFactory("a.qualified.name.of.some.sort"); - BeanFactory fac = bfr.getFactory(); - BeanFactoryReference bfr2 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr2.getFactory(); - // verify that the same instance is returned - TestBean tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("beans1.bean1")); - tb.setName("was beans1.bean1"); - BeanFactoryReference bfr3 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr3.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - BeanFactoryReference bfr4 = facLoc.useBeanFactory("a.qualified.name.which.is.an.alias"); - fac = bfr4.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - // Now verify that we can call release in any order. - // Unfortunately this doesn't validate complete release after the last one. - bfr2.release(); - bfr3.release(); - bfr.release(); - bfr4.release(); - } - - /** - * This test can run multiple times, but due to static keyed lookup of the locators, - * 2nd and subsequent calls will actuall get back same locator instance. This is not - * an issue really, since the contained beanfactories will still be loaded and released. - */ - @Test - public void testGetInstance() { - // Try with and without 'classpath*:' prefix, and with 'classpath:' prefix. - BeanFactoryLocator facLoc = SingletonBeanFactoryLocator.getInstance( - ClassUtils.addResourcePathToPackagePath(getClass(), "ref1.xml")); - getInstanceTest1(facLoc); - - facLoc = SingletonBeanFactoryLocator.getInstance( - "classpath*:/" + ClassUtils.addResourcePathToPackagePath(getClass(), "ref1.xml")); - getInstanceTest2(facLoc); - - // This will actually get another locator instance, as the key is the resource name. - facLoc = SingletonBeanFactoryLocator.getInstance( - "classpath:" + ClassUtils.addResourcePathToPackagePath(getClass(), "ref1.xml")); - getInstanceTest3(facLoc); - - } - - /** - * Worker method so subclass can use it too - */ - protected void getInstanceTest1(BeanFactoryLocator facLoc) { - BeanFactoryReference bfr = facLoc.useBeanFactory("a.qualified.name.of.some.sort"); - BeanFactory fac = bfr.getFactory(); - BeanFactoryReference bfr2 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr2.getFactory(); - // verify that the same instance is returned - TestBean tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("beans1.bean1")); - tb.setName("was beans1.bean1"); - BeanFactoryReference bfr3 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr3.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - - BeanFactoryReference bfr4 = facLoc.useBeanFactory("a.qualified.name.which.is.an.alias"); - fac = bfr4.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - - bfr.release(); - bfr3.release(); - bfr2.release(); - bfr4.release(); - } - - /** - * Worker method so subclass can use it too - */ - protected void getInstanceTest2(BeanFactoryLocator facLoc) { - BeanFactoryReference bfr; - BeanFactory fac; - BeanFactoryReference bfr2; - TestBean tb; - BeanFactoryReference bfr3; - BeanFactoryReference bfr4; - bfr = facLoc.useBeanFactory("a.qualified.name.of.some.sort"); - fac = bfr.getFactory(); - bfr2 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr2.getFactory(); - // verify that the same instance is returned - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("beans1.bean1")); - tb.setName("was beans1.bean1"); - bfr3 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr3.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - bfr4 = facLoc.useBeanFactory("a.qualified.name.which.is.an.alias"); - fac = bfr4.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - bfr.release(); - bfr2.release(); - bfr4.release(); - bfr3.release(); - } - - /** - * Worker method so subclass can use it too - */ - protected void getInstanceTest3(BeanFactoryLocator facLoc) { - BeanFactoryReference bfr; - BeanFactory fac; - BeanFactoryReference bfr2; - TestBean tb; - BeanFactoryReference bfr3; - BeanFactoryReference bfr4; - bfr = facLoc.useBeanFactory("a.qualified.name.of.some.sort"); - fac = bfr.getFactory(); - bfr2 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr2.getFactory(); - // verify that the same instance is returned - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("beans1.bean1")); - tb.setName("was beans1.bean1"); - bfr3 = facLoc.useBeanFactory("another.qualified.name"); - fac = bfr3.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - bfr4 = facLoc.useBeanFactory("a.qualified.name.which.is.an.alias"); - fac = bfr4.getFactory(); - tb = (TestBean) fac.getBean("beans1.bean1"); - assertTrue(tb.getName().equals("was beans1.bean1")); - bfr4.release(); - bfr3.release(); - bfr2.release(); - bfr.release(); - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/access/TestBean.java b/spring-context/src/test/java/org/springframework/beans/factory/access/TestBean.java deleted file mode 100644 index 39fdf5be5b8..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/access/TestBean.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans.factory.access; - -import java.util.List; - -/** - * Scrap bean for use in tests. - * - * @author Colin Sampaleanu - */ -public class TestBean { - - private String name; - - private List list; - - private Object objRef; - - /** - * @return Returns the name. - */ - public String getName() { - return name; - } - - /** - * @param name The name to set. - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return Returns the list. - */ - public List getList() { - return list; - } - - /** - * @param list The list to set. - */ - public void setList(List list) { - this.list = list; - } - - /** - * @return Returns the object. - */ - public Object getObjRef() { - return objRef; - } - - /** - * @param object The object to set. - */ - public void setObjRef(Object object) { - this.objRef = object; - } -} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/access/ref1.xml b/spring-context/src/test/java/org/springframework/beans/factory/access/ref1.xml deleted file mode 100644 index 2dde7a31b37..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/access/ref1.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-context/src/test/java/org/springframework/beans/factory/annotation/BridgeMethodAutowiringTests.java b/spring-context/src/test/java/org/springframework/beans/factory/annotation/BridgeMethodAutowiringTests.java index 822da917c54..c69ab5658b1 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/annotation/BridgeMethodAutowiringTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/annotation/BridgeMethodAutowiringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -49,6 +49,7 @@ class UserServiceImpl extends GenericServiceImpl { protected Foo object; + @Override @Inject @Named("userObject") public void setObject(Foo object) { diff --git a/spring-context/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java b/spring-context/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java deleted file mode 100644 index 8da9a81a6f8..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory.parsing; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.springframework.core.CollectionFactory; - -/** - * @author Rob Harrop - * @author Juergen Hoeller - */ -public class CollectingReaderEventListener implements ReaderEventListener { - - private final List defaults = new LinkedList(); - - private final Map componentDefinitions = CollectionFactory.createLinkedMapIfPossible(8); - - private final Map> aliasMap = CollectionFactory.createLinkedMapIfPossible(8); - - private final List imports = new LinkedList(); - - - public void defaultsRegistered(DefaultsDefinition defaultsDefinition) { - this.defaults.add(defaultsDefinition); - } - - public List getDefaults() { - return Collections.unmodifiableList(this.defaults); - } - - public void componentRegistered(ComponentDefinition componentDefinition) { - this.componentDefinitions.put(componentDefinition.getName(), componentDefinition); - } - - public ComponentDefinition getComponentDefinition(String name) { - return this.componentDefinitions.get(name); - } - - public ComponentDefinition[] getComponentDefinitions() { - Collection collection = this.componentDefinitions.values(); - return collection.toArray(new ComponentDefinition[collection.size()]); - } - - public void aliasRegistered(AliasDefinition aliasDefinition) { - List aliases = this.aliasMap.get(aliasDefinition.getBeanName()); - if(aliases == null) { - aliases = new ArrayList(); - this.aliasMap.put(aliasDefinition.getBeanName(), aliases); - } - aliases.add(aliasDefinition); - } - - public List getAliases(String beanName) { - List aliases = this.aliasMap.get(beanName); - return aliases == null ? null : Collections.unmodifiableList(aliases); - } - - public void importProcessed(ImportDefinition importDefinition) { - this.imports.add(importDefinition); - } - - public List getImports() { - return Collections.unmodifiableList(this.imports); - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java b/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java index 4a32d4582cf..d7cf863defa 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java deleted file mode 100644 index f17b3dfc89e..00000000000 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/DependenciesBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans.factory.xml; - -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; - -/** - * Simple bean used to test dependency checking. - * - * Note: would be defined within {@link XmlBeanFactoryTestTypes}, but must be a public type - * in order to satisfy test dependencies. - * - * @author Rod Johnson - * @author Chris Beams - * @since 04.09.2003 - */ -public final class DependenciesBean implements BeanFactoryAware { - - private int age; - - private String name; - - private TestBean spouse; - - private BeanFactory beanFactory; - - - public void setAge(int age) { - this.age = age; - } - - public int getAge() { - return age; - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setSpouse(TestBean spouse) { - this.spouse = spouse; - } - - public TestBean getSpouse() { - return spouse; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - -} diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests-context.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests-context.xml index 017af485203..9eaf910d083 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests-context.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests-context.xml @@ -22,7 +22,7 @@ interceptor - + Jenny 30 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests.java index 96adebee0f7..96e2ab404a9 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/LookupMethodWrappedByCglibProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; import org.springframework.aop.interceptor.DebugInterceptor; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java index 09bd64d34df..91d1d7565ad 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -389,14 +389,17 @@ public final class QualifierAnnotationTests { @Qualifier(FACTORY_QUALIFIER) public static class QualifiedFactoryBean implements FactoryBean { + @Override public Theta getObject() { return new Theta() {}; } + @Override public Class getObjectType() { return Theta.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerWithExpressionLanguageTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerWithExpressionLanguageTests.java index b1e6c818f0d..c21ee9078fb 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerWithExpressionLanguageTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandlerWithExpressionLanguageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ package org.springframework.beans.factory.xml; import static org.junit.Assert.assertEquals; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java index cebec37bd66..6f68b6bf600 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,14 +27,14 @@ import java.util.Set; import javax.sql.DataSource; import org.springframework.beans.BeansException; -import org.springframework.beans.ITestBean; -import org.springframework.beans.IndexedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.DummyFactory; +import org.springframework.tests.sample.beans.factory.DummyFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.support.MethodReplacer; @@ -256,6 +256,7 @@ class DummyBoImpl implements DummyBo { this.dao = dao; } + @Override public void something() { } @@ -430,6 +431,7 @@ class FixedMethodReplacer implements MethodReplacer { public static final String VALUE = "fixedMethodReplacer"; + @Override public Object reimplement(Object obj, Method method, Object[] args) throws Throwable { return VALUE; } @@ -513,6 +515,7 @@ abstract class OverrideOneMethod extends MethodReplaceCandidate implements Overr protected abstract TestBean protectedOverrideSingleton(); + @Override public TestBean getPrototypeDependency(Object someParam) { return new TestBean(); } @@ -540,6 +543,7 @@ abstract class OverrideOneMethod extends MethodReplaceCandidate implements Overr return "replaceMe:" + someParam; } + @Override public String replaceMe(String someParam) { return "replaceMe:" + someParam; } @@ -595,6 +599,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return initMethodDeclared; } + @Override public void setBeanName(String name) { this.beanName = name; } @@ -603,6 +608,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return beanName; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.owningFactory = beanFactory; } @@ -617,6 +623,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial this.postProcessedBeforeInit = true; } + @Override public void afterPropertiesSet() { if (this.owningFactory == null) { throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); @@ -668,6 +675,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial } } + @Override public void destroy() { if (this.destroyed) { throw new IllegalStateException("Already destroyed"); @@ -682,6 +690,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial public static class PostProcessor implements BeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { if (bean instanceof ProtectedLifecycleBean) { ((ProtectedLifecycleBean) bean).postProcessBeforeInit(); @@ -689,6 +698,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { if (bean instanceof ProtectedLifecycleBean) { ((ProtectedLifecycleBean) bean).postProcessAfterInit(); @@ -706,6 +716,7 @@ class ProtectedLifecycleBean implements BeanNameAware, BeanFactoryAware, Initial @SuppressWarnings("serial") class ReverseMethodReplacer implements MethodReplacer, Serializable { + @Override public Object reimplement(Object obj, Method method, Object[] args) throws Throwable { String s = (String) args[0]; return new StringBuffer(s).reverse().toString(); diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-autowire.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-autowire.xml index 4fcad300bab..43510574bae 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-autowire.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-autowire.xml @@ -3,22 +3,22 @@ - - - - @@ -38,12 +38,12 @@ - - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-child.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-child.xml index 654e76e7fb5..fc90f7905c7 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-child.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-child.xml @@ -8,13 +8,13 @@ - override - override @@ -42,7 +42,7 @@ - + myname diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-collections.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-collections.xml index 9a735571d89..7729dbc7882 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-collections.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-collections.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + Jenny 30 @@ -11,8 +11,8 @@ - - + + Simple bean, without any collections. @@ -22,8 +22,8 @@ 27 - - + + Rod 32 @@ -34,8 +34,8 @@ - - + + Jenny 30 @@ -44,12 +44,12 @@ - + David 27 - + Rod 32 @@ -63,7 +63,7 @@ - + loner 26 @@ -73,8 +73,8 @@ - - + + @@ -84,7 +84,7 @@ - + @@ -97,26 +97,26 @@ - + verbose - - + + - + - + - - + + @@ -126,7 +126,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -198,8 +198,8 @@ - - + + @@ -207,7 +207,7 @@ - + bar @@ -217,15 +217,15 @@ - + - - - + + + bar @@ -233,8 +233,8 @@ - - + + @@ -243,7 +243,7 @@ - + one @@ -251,8 +251,8 @@ - - + + java.lang.String @@ -260,8 +260,8 @@ - - + + 0 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-complexFactoryCircle.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-complexFactoryCircle.xml index 85eb3620b0f..8370424f739 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-complexFactoryCircle.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-complexFactoryCircle.xml @@ -11,16 +11,16 @@ - + - + - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorArg.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorArg.xml index bc4f87d63a4..d500c48881e 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorArg.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorArg.xml @@ -13,7 +13,7 @@ - + @@ -117,7 +117,7 @@ - + Kerry1 @@ -126,7 +126,7 @@ - + Kerry2 @@ -135,7 +135,7 @@ - + /test @@ -187,13 +187,13 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorOverrides.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorOverrides.xml index ea061046ce3..d703fddd21f 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorOverrides.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-constructorOverrides.xml @@ -18,7 +18,7 @@ - Jenny 30 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultAutowire.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultAutowire.xml index 0094234b090..3815538559d 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultAutowire.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultAutowire.xml @@ -3,19 +3,19 @@ - + - + - + - + Kerry diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultLazyInit.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultLazyInit.xml index 5021766b1c0..3451c1b37c0 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultLazyInit.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-defaultLazyInit.xml @@ -15,6 +15,6 @@ destroy-method="customDestroy" /> - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml index feb3bea4994..10ae8ae09fb 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-delegationOverrides.xml @@ -58,7 +58,7 @@ - Jenny 30 @@ -68,7 +68,7 @@ - Simple bean, without any collections. diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-factoryCircle.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-factoryCircle.xml index f94371ee0c7..86da8d595d4 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-factoryCircle.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-factoryCircle.xml @@ -3,7 +3,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-initializers.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-initializers.xml index 1a6eb553328..06281490175 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-initializers.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-initializers.xml @@ -11,7 +11,7 @@ - - - - + + + Jenny 30 @@ -12,9 +12,8 @@ - + - - - \ No newline at end of file + + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-invalidOverridesNoSuchMethod.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-invalidOverridesNoSuchMethod.xml index e8b85a509af..cd232df3c00 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-invalidOverridesNoSuchMethod.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-invalidOverridesNoSuchMethod.xml @@ -11,7 +11,7 @@ - + Jenny 30 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-localCollectionsUsingXsd.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-localCollectionsUsingXsd.xml index da6d7405eb3..2e49f71a540 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-localCollectionsUsingXsd.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-localCollectionsUsingXsd.xml @@ -12,7 +12,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-overrides.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-overrides.xml index bf0849bc98c..0a92c7426d0 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-overrides.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-overrides.xml @@ -35,32 +35,32 @@ - + Jenny 30 - + - + Jenny 30 - + - + - + Simple bean, without any collections. @@ -71,12 +71,12 @@ 27 - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-parent.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-parent.xml index 98f23096735..f575bcb44a9 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-parent.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-parent.xml @@ -3,7 +3,7 @@ - + parent 1 @@ -13,11 +13,11 @@ 1 - + parent 2 - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-reftypes.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-reftypes.xml index c8adc19bb3d..f8e32809066 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-reftypes.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-reftypes.xml @@ -1,102 +1,102 @@ - - + + Jenny 30 - - + + - - + + Andrew 36 - + - - + + Georgia 33 - + - + - + - + - + - + - + - + - + - + outer 0 - + hasInner 5 - + inner1 6 - + inner2 7 - - + + inner5 6 @@ -105,7 +105,7 @@ - + inner3 8 @@ -120,32 +120,32 @@ - + - + inner1 6 - + hasInner 5 - + inner1 6 - + inner2 7 - - + + inner5 6 @@ -153,11 +153,11 @@ - + - + inner3 8 @@ -173,9 +173,9 @@ - + - + inner1 6 diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resource.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resource.xml index 3386242887d..9eb0813411a 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resource.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resource.xml @@ -5,7 +5,7 @@ - + classpath:org/springframework/beans/factory/xml/test.properties diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resourceImport.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resourceImport.xml index e5515885eff..31fa7a16bab 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resourceImport.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-resourceImport.xml @@ -3,7 +3,7 @@ - + classpath:org/springframework/beans/factory/xml/test.properties diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedAllDepCheck.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedAllDepCheck.xml index 4b315b7582d..daa269998ee 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedAllDepCheck.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedAllDepCheck.xml @@ -3,14 +3,14 @@ - 33 Rod - diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedObjectDepCheck.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedObjectDepCheck.xml index 8c1d0d3f37c..65fbd833c9f 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedObjectDepCheck.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedObjectDepCheck.xml @@ -3,11 +3,11 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedSimpleDepCheck.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedSimpleDepCheck.xml index 92981195029..9088b962e0f 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedSimpleDepCheck.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-satisfiedSimpleDepCheck.xml @@ -3,7 +3,7 @@ - 33 Rod diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNameInAlias.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNameInAlias.xml index cc049ed23cd..393028d4f1f 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNameInAlias.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNameInAlias.xml @@ -3,8 +3,8 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNames.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNames.xml index e991af7167a..90de5444371 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNames.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-testWithDuplicateNames.xml @@ -3,8 +3,8 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingObjects.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingObjects.xml index 19faed79258..a771266aa9a 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingObjects.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingObjects.xml @@ -3,7 +3,7 @@ - 33 Rod diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingSimple.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingSimple.xml index df21ad72626..8cd2e725690 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingSimple.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedAllDepCheckMissingSimple.xml @@ -3,13 +3,13 @@ - tony --> - diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedObjectDepCheck.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedObjectDepCheck.xml index f18e9e77c29..a96c4d303d8 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedObjectDepCheck.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedObjectDepCheck.xml @@ -3,7 +3,7 @@ - diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedSimpleDepCheck.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedSimpleDepCheck.xml index 8463f132a12..4968b12b3a6 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedSimpleDepCheck.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests-unsatisfiedSimpleDepCheck.xml @@ -3,7 +3,7 @@ - diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java index 91c0c5f4b3f..b4e6a07538c 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -42,13 +42,8 @@ import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.AopUtils; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; import org.springframework.beans.FatalBeanException; -import org.springframework.beans.ITestBean; -import org.springframework.beans.IndexedTestBean; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.ResourceTestBean; -import org.springframework.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCurrentlyInCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; @@ -56,7 +51,6 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanIsAbstractException; import org.springframework.beans.factory.CannotLoadBeanClassException; import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.DummyFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.UnsatisfiedDependencyException; @@ -69,6 +63,13 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.UrlResource; import org.springframework.core.io.support.EncodedResource; +import org.springframework.tests.sample.beans.DependenciesBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.ResourceTestBean; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; import org.springframework.util.FileCopyUtils; import org.springframework.util.SerializationTestUtils; import org.springframework.util.StopWatch; @@ -116,7 +117,6 @@ public final class XmlBeanFactoryTests { private static final ClassPathResource NO_SUCH_FACTORY_METHOD_CONTEXT = classPathResource("-noSuchFactoryMethod.xml"); private static final ClassPathResource RECURSIVE_IMPORT_CONTEXT = classPathResource("-recursiveImport.xml"); private static final ClassPathResource RESOURCE_CONTEXT = classPathResource("-resource.xml"); - private static final ClassPathResource RESOURCE_IMPORT_CONTEXT = classPathResource("-resourceImport.xml"); private static final ClassPathResource SATISFIED_ALL_DEP_CONTEXT = classPathResource("-satisfiedAllDepCheck.xml"); private static final ClassPathResource SATISFIED_OBJECT_DEP_CONTEXT = classPathResource("-satisfiedObjectDepCheck.xml"); private static final ClassPathResource SATISFIED_SIMPLE_DEP_CONTEXT = classPathResource("-satisfiedSimpleDepCheck.xml"); @@ -135,7 +135,8 @@ public final class XmlBeanFactoryTests { /* SPR-2368 */ public @Test void testCollectionsReferredToAsRefLocals() throws Exception { - XmlBeanFactory factory = new XmlBeanFactory(COLLECTIONS_XSD_CONTEXT); + DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(factory).loadBeanDefinitions(COLLECTIONS_XSD_CONTEXT); factory.preInstantiateSingletons(); } @@ -296,8 +297,10 @@ public final class XmlBeanFactoryTests { } public @Test void testInheritanceFromParentFactoryPrototype() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); assertEquals(TestBean.class, child.getType("inheritsFromParentFactory")); TestBean inherits = (TestBean) child.getBean("inheritsFromParentFactory"); // Name property value is overridden @@ -309,8 +312,10 @@ public final class XmlBeanFactoryTests { } public @Test void testInheritanceWithDifferentClass() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); assertEquals(DerivedTestBean.class, child.getType("inheritsWithClass")); DerivedTestBean inherits = (DerivedTestBean) child.getBean("inheritsWithDifferentClass"); // Name property value is overridden @@ -321,8 +326,10 @@ public final class XmlBeanFactoryTests { } public @Test void testInheritanceWithClass() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); assertEquals(DerivedTestBean.class, child.getType("inheritsWithClass")); DerivedTestBean inherits = (DerivedTestBean) child.getBean("inheritsWithClass"); // Name property value is overridden @@ -333,8 +340,10 @@ public final class XmlBeanFactoryTests { } public @Test void testPrototypeInheritanceFromParentFactoryPrototype() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); assertEquals(TestBean.class, child.getType("prototypeInheritsFromParentFactoryPrototype")); TestBean inherits = (TestBean) child.getBean("prototypeInheritsFromParentFactoryPrototype"); // Name property value is overridden @@ -350,8 +359,10 @@ public final class XmlBeanFactoryTests { } public @Test void testPrototypeInheritanceFromParentFactorySingleton() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); TestBean inherits = (TestBean) child.getBean("protoypeInheritsFromParentFactorySingleton"); // Name property value is overridden assertTrue(inherits.getName().equals("prototypeOverridesInheritedSingleton")); @@ -380,7 +391,8 @@ public final class XmlBeanFactoryTests { } public @Test void testAbstractParentBeans() { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); parent.preInstantiateSingletons(); assertTrue(parent.isSingleton("inheritedTestBeanWithoutClass")); @@ -404,7 +416,8 @@ public final class XmlBeanFactoryTests { } public @Test void testDependenciesMaterializeThis() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(DEP_MATERIALIZE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(DEP_MATERIALIZE_CONTEXT); assertEquals(2, xbf.getBeansOfType(DummyBo.class, true, false).size()); assertEquals(3, xbf.getBeansOfType(DummyBo.class, true, true).size()); @@ -421,8 +434,10 @@ public final class XmlBeanFactoryTests { } public @Test void testChildOverridesParentBean() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); TestBean inherits = (TestBean) child.getBean("inheritedTestBean"); // Name property value is overridden assertTrue(inherits.getName().equals("overrideParentBean")); @@ -437,8 +452,10 @@ public final class XmlBeanFactoryTests { * If a singleton does this the factory will fail to load. */ public @Test void testBogusParentageFromParentFactory() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); try { child.getBean("bogusParent", TestBean.class); fail(); @@ -456,8 +473,10 @@ public final class XmlBeanFactoryTests { * instances even if derived from a prototype */ public @Test void testSingletonInheritsFromParentFactoryPrototype() throws Exception { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); TestBean inherits = (TestBean) child.getBean("singletonInheritsFromParentFactoryPrototype"); // Name property value is overriden assertTrue(inherits.getName().equals("prototype-override")); @@ -468,16 +487,20 @@ public final class XmlBeanFactoryTests { } public @Test void testSingletonFromParent() { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); TestBean beanFromParent = (TestBean) parent.getBean("inheritedTestBeanSingleton"); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); TestBean beanFromChild = (TestBean) child.getBean("inheritedTestBeanSingleton"); assertTrue("singleton from parent and child is the same", beanFromParent == beanFromChild); } public @Test void testNestedPropertyValue() { - XmlBeanFactory parent = new XmlBeanFactory(PARENT_CONTEXT); - XmlBeanFactory child = new XmlBeanFactory(CHILD_CONTEXT, parent); + DefaultListableBeanFactory parent = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(parent).loadBeanDefinitions(PARENT_CONTEXT); + DefaultListableBeanFactory child = new DefaultListableBeanFactory(parent); + new XmlBeanDefinitionReader(child).loadBeanDefinitions(CHILD_CONTEXT); IndexedTestBean bean = (IndexedTestBean) child.getBean("indexedTestBean"); assertEquals("name applied correctly", "myname", bean.getArray()[0].getName()); } @@ -571,19 +594,22 @@ public final class XmlBeanFactoryTests { } public @Test void testFactoryReferenceCircle() { - XmlBeanFactory xbf = new XmlBeanFactory(FACTORY_CIRCLE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(FACTORY_CIRCLE_CONTEXT); TestBean tb = (TestBean) xbf.getBean("singletonFactory"); DummyFactory db = (DummyFactory) xbf.getBean("&singletonFactory"); assertTrue(tb == db.getOtherTestBean()); } public @Test void testFactoryReferenceWithDoublePrefix() { - XmlBeanFactory xbf = new XmlBeanFactory(FACTORY_CIRCLE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(FACTORY_CIRCLE_CONTEXT); assertThat(xbf.getBean("&&singletonFactory"), instanceOf(DummyFactory.class)); } public @Test void testComplexFactoryReferenceCircle() { - XmlBeanFactory xbf = new XmlBeanFactory(COMPLEX_FACTORY_CIRCLE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(COMPLEX_FACTORY_CIRCLE_CONTEXT); xbf.getBean("proxy1"); // check that unused instances from autowiring got removed assertEquals(4, xbf.getSingletonCount()); @@ -594,7 +620,8 @@ public final class XmlBeanFactoryTests { public @Test void testNoSuchFactoryBeanMethod() { try { - XmlBeanFactory xbf = new XmlBeanFactory(NO_SUCH_FACTORY_METHOD_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(NO_SUCH_FACTORY_METHOD_CONTEXT); assertNotNull(xbf.getBean("defaultTestBean")); fail("Should not get invalid bean"); } @@ -604,7 +631,8 @@ public final class XmlBeanFactoryTests { } public @Test void testInitMethodIsInvoked() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(INITIALIZERS_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INITIALIZERS_CONTEXT); DoubleInitializer in = (DoubleInitializer) xbf.getBean("init-method1"); // Initializer should have doubled value assertEquals(14, in.getNum()); @@ -614,7 +642,8 @@ public final class XmlBeanFactoryTests { * Test that if a custom initializer throws an exception, it's handled correctly */ public @Test void testInitMethodThrowsException() { - XmlBeanFactory xbf = new XmlBeanFactory(INITIALIZERS_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INITIALIZERS_CONTEXT); try { xbf.getBean("init-method2"); fail(); @@ -627,7 +656,8 @@ public final class XmlBeanFactoryTests { } public @Test void testNoSuchInitMethod() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(INITIALIZERS_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INITIALIZERS_CONTEXT); try { xbf.getBean("init-method3"); fail(); @@ -645,7 +675,8 @@ public final class XmlBeanFactoryTests { */ public @Test void testInitializingBeanAndInitMethod() throws Exception { InitAndIB.constructed = false; - XmlBeanFactory xbf = new XmlBeanFactory(INITIALIZERS_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INITIALIZERS_CONTEXT); assertFalse(InitAndIB.constructed); xbf.preInstantiateSingletons(); assertFalse(InitAndIB.constructed); @@ -664,7 +695,8 @@ public final class XmlBeanFactoryTests { */ public @Test void testInitializingBeanAndSameInitMethod() throws Exception { InitAndIB.constructed = false; - XmlBeanFactory xbf = new XmlBeanFactory(INITIALIZERS_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INITIALIZERS_CONTEXT); assertFalse(InitAndIB.constructed); xbf.preInstantiateSingletons(); assertFalse(InitAndIB.constructed); @@ -680,7 +712,8 @@ public final class XmlBeanFactoryTests { public @Test void testDefaultLazyInit() throws Exception { InitAndIB.constructed = false; - XmlBeanFactory xbf = new XmlBeanFactory(DEFAULT_LAZY_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(DEFAULT_LAZY_CONTEXT); assertFalse(InitAndIB.constructed); xbf.preInstantiateSingletons(); assertTrue(InitAndIB.constructed); @@ -693,8 +726,9 @@ public final class XmlBeanFactoryTests { } public @Test void testNoSuchXmlFile() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - new XmlBeanFactory(MISSING_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(MISSING_CONTEXT); fail("Must not create factory from missing XML"); } catch (BeanDefinitionStoreException expected) { @@ -702,8 +736,9 @@ public final class XmlBeanFactoryTests { } public @Test void testInvalidXmlFile() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - new XmlBeanFactory(INVALID_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(INVALID_CONTEXT); fail("Must not create factory from invalid XML"); } catch (BeanDefinitionStoreException expected) { @@ -711,8 +746,9 @@ public final class XmlBeanFactoryTests { } public @Test void testUnsatisfiedObjectDependencyCheck() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - XmlBeanFactory xbf = new XmlBeanFactory(UNSATISFIED_OBJECT_DEP_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(UNSATISFIED_OBJECT_DEP_CONTEXT); xbf.getBean("a", DependenciesBean.class); fail("Must have thrown an UnsatisfiedDependencyException"); } @@ -721,8 +757,9 @@ public final class XmlBeanFactoryTests { } public @Test void testUnsatisfiedSimpleDependencyCheck() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - XmlBeanFactory xbf = new XmlBeanFactory(UNSATISFIED_SIMPLE_DEP_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(UNSATISFIED_SIMPLE_DEP_CONTEXT); xbf.getBean("a", DependenciesBean.class); fail("Must have thrown an UnsatisfiedDependencyException"); } @@ -731,21 +768,24 @@ public final class XmlBeanFactoryTests { } public @Test void testSatisfiedObjectDependencyCheck() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(SATISFIED_OBJECT_DEP_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(SATISFIED_OBJECT_DEP_CONTEXT); DependenciesBean a = (DependenciesBean) xbf.getBean("a"); assertNotNull(a.getSpouse()); assertEquals(xbf, a.getBeanFactory()); } public @Test void testSatisfiedSimpleDependencyCheck() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(SATISFIED_SIMPLE_DEP_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(SATISFIED_SIMPLE_DEP_CONTEXT); DependenciesBean a = (DependenciesBean) xbf.getBean("a"); assertEquals(a.getAge(), 33); } public @Test void testUnsatisfiedAllDependencyCheck() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - XmlBeanFactory xbf = new XmlBeanFactory(UNSATISFIED_ALL_DEP_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(UNSATISFIED_ALL_DEP_CONTEXT); xbf.getBean("a", DependenciesBean.class); fail("Must have thrown an UnsatisfiedDependencyException"); } @@ -754,7 +794,8 @@ public final class XmlBeanFactoryTests { } public @Test void testSatisfiedAllDependencyCheck() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(SATISFIED_ALL_DEP_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(SATISFIED_ALL_DEP_CONTEXT); DependenciesBean a = (DependenciesBean) xbf.getBean("a"); assertEquals(a.getAge(), 33); assertNotNull(a.getName()); @@ -762,23 +803,27 @@ public final class XmlBeanFactoryTests { } public @Test void testAutowire() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(AUTOWIRE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(AUTOWIRE_CONTEXT); TestBean spouse = new TestBean("kerry", 0); xbf.registerSingleton("spouse", spouse); doTestAutowire(xbf); } public @Test void testAutowireWithParent() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(AUTOWIRE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(AUTOWIRE_CONTEXT); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); MutablePropertyValues pvs = new MutablePropertyValues(); pvs.add("name", "kerry"); - lbf.registerBeanDefinition("spouse", new RootBeanDefinition(TestBean.class, pvs)); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); + bd.setPropertyValues(pvs); + lbf.registerBeanDefinition("spouse", bd); xbf.setParentBeanFactory(lbf); doTestAutowire(xbf); } - private void doTestAutowire(XmlBeanFactory xbf) throws Exception { + private void doTestAutowire(DefaultListableBeanFactory xbf) throws Exception { DependenciesBean rod1 = (DependenciesBean) xbf.getBean("rod1"); TestBean kerry = (TestBean) xbf.getBean("spouse"); // should have been autowired @@ -827,7 +872,8 @@ public final class XmlBeanFactoryTests { } public @Test void testAutowireWithDefault() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(DEFAULT_AUTOWIRE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(DEFAULT_AUTOWIRE_CONTEXT); DependenciesBean rod1 = (DependenciesBean) xbf.getBean("rod1"); // should have been autowired @@ -848,7 +894,8 @@ public final class XmlBeanFactoryTests { } public @Test void testAutowireByConstructor() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); ConstructorDependenciesBean rod1 = (ConstructorDependenciesBean) xbf.getBean("rod1"); TestBean kerry = (TestBean) xbf.getBean("kerry2"); // should have been autowired @@ -884,7 +931,8 @@ public final class XmlBeanFactoryTests { } public @Test void testAutowireByConstructorWithSimpleValues() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); ConstructorDependenciesBean rod5 = (ConstructorDependenciesBean) xbf.getBean("rod5"); TestBean kerry1 = (TestBean) xbf.getBean("kerry1"); @@ -912,7 +960,8 @@ public final class XmlBeanFactoryTests { } public @Test void testRelatedCausesFromConstructorResolution() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); try { xbf.getBean("rod2Accessor"); @@ -925,7 +974,8 @@ public final class XmlBeanFactoryTests { } public @Test void testConstructorArgResolution() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); TestBean kerry1 = (TestBean) xbf.getBean("kerry1"); TestBean kerry2 = (TestBean) xbf.getBean("kerry2"); @@ -972,7 +1022,8 @@ public final class XmlBeanFactoryTests { } public @Test void testPrototypeWithExplicitArguments() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); SimpleConstructorArgBean cd1 = (SimpleConstructorArgBean) xbf.getBean("rod18"); assertEquals(0, cd1.getAge()); SimpleConstructorArgBean cd2 = (SimpleConstructorArgBean) xbf.getBean("rod18", 98); @@ -986,13 +1037,15 @@ public final class XmlBeanFactoryTests { } public @Test void testConstructorArgWithSingleMatch() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); File file = (File) xbf.getBean("file"); assertEquals(File.separator + "test", file.getPath()); } public @Test void testThrowsExceptionOnTooManyArguments() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); try { xbf.getBean("rod7", ConstructorDependenciesBean.class); fail("Should have thrown BeanCreationException"); @@ -1002,7 +1055,8 @@ public final class XmlBeanFactoryTests { } public @Test void testThrowsExceptionOnAmbiguousResolution() throws Exception { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); try { xbf.getBean("rod8", ConstructorDependenciesBean.class); fail("Must have thrown UnsatisfiedDependencyException"); @@ -1058,7 +1112,8 @@ public final class XmlBeanFactoryTests { PreparingBean2.destroyed = false; DependingBean.destroyCount = 0; HoldingBean.destroyCount = 0; - XmlBeanFactory xbf = new XmlBeanFactory(resource); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(resource); xbf.preInstantiateSingletons(); xbf.destroySingletons(); assertTrue(PreparingBean1.prepared); @@ -1078,7 +1133,8 @@ public final class XmlBeanFactoryTests { * must rather only be picked up when the bean is instantiated. */ public @Test void testClassNotFoundWithDefaultBeanClassLoader() { - BeanFactory factory = new XmlBeanFactory(CLASS_NOT_FOUND_CONTEXT); + DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(factory).loadBeanDefinitions(CLASS_NOT_FOUND_CONTEXT); // cool, no errors, so the rubbish class name in the bean def was not resolved try { // let's resolve the bean definition; must blow up @@ -1100,7 +1156,8 @@ public final class XmlBeanFactoryTests { } public @Test void testResourceAndInputStream() throws IOException { - XmlBeanFactory xbf = new XmlBeanFactory(RESOURCE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(RESOURCE_CONTEXT); // comes from "resourceImport.xml" ResourceTestBean resource1 = (ResourceTestBean) xbf.getBean("resource1"); // comes from "resource.xml" @@ -1122,7 +1179,8 @@ public final class XmlBeanFactoryTests { } public @Test void testClassPathResourceWithImport() { - XmlBeanFactory xbf = new XmlBeanFactory(RESOURCE_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(RESOURCE_CONTEXT); // comes from "resourceImport.xml" xbf.getBean("resource1", ResourceTestBean.class); // comes from "resource.xml" @@ -1131,7 +1189,8 @@ public final class XmlBeanFactoryTests { public @Test void testUrlResourceWithImport() { URL url = getClass().getResource(RESOURCE_CONTEXT.getPath()); - XmlBeanFactory xbf = new XmlBeanFactory(new UrlResource(url)); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(new UrlResource(url)); // comes from "resourceImport.xml" xbf.getBean("resource1", ResourceTestBean.class); // comes from "resource.xml" @@ -1140,7 +1199,8 @@ public final class XmlBeanFactoryTests { public @Test void testFileSystemResourceWithImport() throws URISyntaxException { String file = getClass().getResource(RESOURCE_CONTEXT.getPath()).toURI().getPath(); - XmlBeanFactory xbf = new XmlBeanFactory(new FileSystemResource(file)); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(new FileSystemResource(file)); // comes from "resourceImport.xml" xbf.getBean("resource1", ResourceTestBean.class); // comes from "resource.xml" @@ -1148,8 +1208,9 @@ public final class XmlBeanFactoryTests { } public @Test void testRecursiveImport() { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - new XmlBeanFactory(RECURSIVE_IMPORT_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(RECURSIVE_IMPORT_CONTEXT); fail("Should have thrown BeanDefinitionStoreException"); } catch (BeanDefinitionStoreException ex) { @@ -1344,7 +1405,8 @@ public final class XmlBeanFactoryTests { } public @Test void testConstructorArgWithSingleSimpleTypeMatch() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); SingleSimpleTypeConstructorBean bean = (SingleSimpleTypeConstructorBean) xbf.getBean("beanWithBoolean"); assertTrue(bean.isSingleBoolean()); @@ -1354,7 +1416,8 @@ public final class XmlBeanFactoryTests { } public @Test void testConstructorArgWithDoubleSimpleTypeMatch() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); SingleSimpleTypeConstructorBean bean = (SingleSimpleTypeConstructorBean) xbf.getBean("beanWithBooleanAndString"); assertTrue(bean.isSecondBoolean()); @@ -1366,33 +1429,38 @@ public final class XmlBeanFactoryTests { } public @Test void testDoubleBooleanAutowire() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); DoubleBooleanConstructorBean bean = (DoubleBooleanConstructorBean) xbf.getBean("beanWithDoubleBoolean"); assertEquals(Boolean.TRUE, bean.boolean1); assertEquals(Boolean.FALSE, bean.boolean2); } public @Test void testDoubleBooleanAutowireWithIndex() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); DoubleBooleanConstructorBean bean = (DoubleBooleanConstructorBean) xbf.getBean("beanWithDoubleBooleanAndIndex"); assertEquals(Boolean.FALSE, bean.boolean1); assertEquals(Boolean.TRUE, bean.boolean2); } public @Test void testLenientDependencyMatching() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); LenientDependencyTestBean bean = (LenientDependencyTestBean) xbf.getBean("lenientDependencyTestBean"); assertTrue(bean.tb instanceof DerivedTestBean); } public @Test void testLenientDependencyMatchingFactoryMethod() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); LenientDependencyTestBean bean = (LenientDependencyTestBean) xbf.getBean("lenientDependencyTestBeanFactoryMethod"); assertTrue(bean.tb instanceof DerivedTestBean); } public @Test void testNonLenientDependencyMatching() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("lenientDependencyTestBean"); bd.setLenientConstructorResolution(false); try { @@ -1407,7 +1475,8 @@ public final class XmlBeanFactoryTests { } public @Test void testNonLenientDependencyMatchingFactoryMethod() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("lenientDependencyTestBeanFactoryMethod"); bd.setLenientConstructorResolution(false); try { @@ -1422,7 +1491,8 @@ public final class XmlBeanFactoryTests { } public @Test void testJavaLangStringConstructor() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("string"); bd.setLenientConstructorResolution(false); String str = (String) xbf.getBean("string"); @@ -1430,7 +1500,8 @@ public final class XmlBeanFactoryTests { } public @Test void testCustomStringConstructor() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("stringConstructor"); bd.setLenientConstructorResolution(false); StringConstructorTestBean tb = (StringConstructorTestBean) xbf.getBean("stringConstructor"); @@ -1438,7 +1509,8 @@ public final class XmlBeanFactoryTests { } public @Test void testPrimitiveConstructorArray() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); ConstructorArrayTestBean bean = (ConstructorArrayTestBean) xbf.getBean("constructorArray"); assertTrue(bean.array instanceof int[]); assertEquals(1, ((int[]) bean.array).length); @@ -1446,7 +1518,8 @@ public final class XmlBeanFactoryTests { } public @Test void testIndexedPrimitiveConstructorArray() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); ConstructorArrayTestBean bean = (ConstructorArrayTestBean) xbf.getBean("indexedConstructorArray"); assertTrue(bean.array instanceof int[]); assertEquals(1, ((int[]) bean.array).length); @@ -1454,14 +1527,16 @@ public final class XmlBeanFactoryTests { } public @Test void testStringConstructorArrayNoType() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); ConstructorArrayTestBean bean = (ConstructorArrayTestBean) xbf.getBean("constructorArrayNoType"); assertTrue(bean.array instanceof String[]); assertEquals(0, ((String[]) bean.array).length); } public @Test void testStringConstructorArrayNoTypeNonLenient() { - XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT); + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT); AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("constructorArrayNoType"); bd.setLenientConstructorResolution(false); ConstructorArrayTestBean bean = (ConstructorArrayTestBean) xbf.getBean("constructorArrayNoType"); @@ -1470,8 +1545,9 @@ public final class XmlBeanFactoryTests { } public @Test void testWithDuplicateName() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - new XmlBeanFactory(TEST_WITH_DUP_NAMES_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(TEST_WITH_DUP_NAMES_CONTEXT); fail("Duplicate name not detected"); } catch (BeansException ex) { @@ -1480,8 +1556,9 @@ public final class XmlBeanFactoryTests { } public @Test void testWithDuplicateNameInAlias() throws Exception { + DefaultListableBeanFactory xbf = new DefaultListableBeanFactory(); try { - new XmlBeanFactory(TEST_WITH_DUP_NAME_IN_ALIAS_CONTEXT); + new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(TEST_WITH_DUP_NAME_IN_ALIAS_CONTEXT); fail("Duplicate name not detected"); } catch (BeansException e) { @@ -1511,6 +1588,7 @@ public final class XmlBeanFactoryTests { public Object lastArg; + @Override public Object reimplement(Object obj, Method method, Object[] args) throws Throwable { assertEquals(1, args.length); assertEquals("doSomething", method.getName()); @@ -1558,6 +1636,7 @@ public final class XmlBeanFactoryTests { constructed = true; } + @Override public void afterPropertiesSet() { if (this.initMethodInvoked) { fail(); @@ -1579,6 +1658,7 @@ public final class XmlBeanFactoryTests { this.initMethodInvoked = true; } + @Override public void destroy() { if (this.customDestroyed) { fail(); @@ -1611,6 +1691,7 @@ public final class XmlBeanFactoryTests { prepared = true; } + @Override public void destroy() { destroyed = true; } @@ -1627,6 +1708,7 @@ public final class XmlBeanFactoryTests { prepared = true; } + @Override public void destroy() { destroyed = true; } @@ -1654,12 +1736,14 @@ public final class XmlBeanFactoryTests { public void setInTheMiddleBean(InTheMiddleBean bean) { } + @Override public void afterPropertiesSet() { if (!(PreparingBean1.prepared && PreparingBean2.prepared)) { throw new IllegalStateException("Need prepared PreparingBeans!"); } } + @Override public void destroy() { if (PreparingBean1.destroyed || PreparingBean2.destroyed) { throw new IllegalStateException("Should not be destroyed after PreparingBeans"); @@ -1692,6 +1776,7 @@ public final class XmlBeanFactoryTests { this.dependingBean = dependingBean; } + @Override public void destroy() { if (this.dependingBean.destroyed) { throw new IllegalStateException("Should not be destroyed after DependingBean"); @@ -1794,10 +1879,12 @@ public final class XmlBeanFactoryTests { public static class WrappingPostProcessor implements BeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { ProxyFactory pf = new ProxyFactory(bean); return pf.getProxy(); diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests-context.xml b/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests-context.xml index 1fbd8330863..17c9c7e8f5b 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests-context.xml +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests-context.xml @@ -10,11 +10,11 @@ - + - + @@ -24,14 +24,14 @@ - + - + diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java index d2366862757..68accbae1d4 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -16,31 +16,27 @@ package org.springframework.beans.factory.xml.support; -import java.io.IOException; import static java.lang.String.format; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import test.interceptor.NopInterceptor; - import org.springframework.aop.Advisor; import org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDecorator; import org.springframework.aop.framework.Advised; import org.springframework.aop.interceptor.DebugInterceptor; import org.springframework.aop.support.AopUtils; import org.springframework.beans.BeanInstantiationException; -import org.springframework.beans.ITestBean; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; @@ -60,6 +56,13 @@ import org.springframework.context.ApplicationListener; import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; /** * Unit tests for custom XML namespace handler implementations. @@ -194,6 +197,7 @@ public class CustomNamespaceHandlerTests { super(CLASS.getClassLoader()); } + @Override public InputSource resolveEntity(String publicId, String systemId) throws IOException { InputSource source = super.resolveEntity(publicId, systemId); if (source == null) { @@ -216,6 +220,7 @@ public class CustomNamespaceHandlerTests { */ final class TestNamespaceHandler extends NamespaceHandlerSupport { + @Override public void init() { registerBeanDefinitionParser("testBean", new TestBeanDefinitionParser()); registerBeanDefinitionParser("person", new PersonDefinitionParser()); @@ -228,6 +233,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static class TestBeanDefinitionParser implements BeanDefinitionParser { + @Override public BeanDefinition parse(Element element, ParserContext parserContext) { RootBeanDefinition definition = new RootBeanDefinition(); definition.setBeanClass(TestBean.class); @@ -245,10 +251,12 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static final class PersonDefinitionParser extends AbstractSingleBeanDefinitionParser { + @Override protected Class getBeanClass(Element element) { return TestBean.class; } + @Override protected void doParse(Element element, BeanDefinitionBuilder builder) { builder.addPropertyValue("name", element.getAttribute("name")); builder.addPropertyValue("age", element.getAttribute("age")); @@ -257,6 +265,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static class PropertyModifyingBeanDefinitionDecorator implements BeanDefinitionDecorator { + @Override public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { Element element = (Element) node; BeanDefinition def = definition.getBeanDefinition(); @@ -272,6 +281,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static class DebugBeanDefinitionDecorator extends AbstractInterceptorDrivenBeanDefinitionDecorator { + @Override protected BeanDefinition createInterceptorDefinition(Node node) { return new RootBeanDefinition(DebugInterceptor.class); } @@ -279,6 +289,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static class NopInterceptorBeanDefinitionDecorator extends AbstractInterceptorDrivenBeanDefinitionDecorator { + @Override protected BeanDefinition createInterceptorDefinition(Node node) { return new RootBeanDefinition(NopInterceptor.class); } @@ -286,6 +297,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { private static class ObjectNameBeanDefinitionDecorator implements BeanDefinitionDecorator { + @Override public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { Attr objectNameAttribute = (Attr) node; definition.getBeanDefinition().setAttribute("objectName", objectNameAttribute.getValue()); diff --git a/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java b/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java index 80fa6f50e21..4c72d9d5937 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java +++ b/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -32,105 +32,127 @@ public class AnnotatedClassCacheableService implements CacheableService private final AtomicLong counter = new AtomicLong(); public static final AtomicLong nullInvocations = new AtomicLong(); + @Override public Object cache(Object arg1) { return counter.getAndIncrement(); } + @Override public Object conditional(int field) { return null; } + @Override @CacheEvict("default") public void invalidate(Object arg1) { } + @Override @CacheEvict("default") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } + @Override @CacheEvict(value = "default", allEntries = true) public void evictAll(Object arg1) { } + @Override @CacheEvict(value = "default", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @CacheEvict(value = "default", key = "#p0") public void evict(Object arg1, Object arg2) { } + @Override @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @Cacheable(value = "default", key = "#p0") public Object key(Object arg1, Object arg2) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName + #root.caches[0].name") public Object name(Object arg1) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Object rootVars(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut("default") public Object update(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut(value = "default", condition = "#arg.equals(3)") public Object conditionalUpdate(Object arg) { return arg; } + @Override public Object nullValue(Object arg1) { nullInvocations.incrementAndGet(); return null; } + @Override public Number nullInvocations() { return nullInvocations.get(); } + @Override public Long throwChecked(Object arg1) throws Exception { throw new UnsupportedOperationException(arg1.toString()); } + @Override public Long throwUnchecked(Object arg1) { throw new UnsupportedOperationException(); } // multi annotations + @Override @Caching(cacheable = { @Cacheable("primary"), @Cacheable("secondary") }) public Object multiCache(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(evict = { @CacheEvict("primary"), @CacheEvict(value = "secondary", key = "#a0"), @CacheEvict(value = "primary", key = "#p0 + 'A'") }) public Object multiEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", key = "#root.methodName") }, evict = { @CacheEvict("secondary") }) public Object multiCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", condition = "#a0 == 3") }, evict = { @CacheEvict("secondary") }) public Object multiConditionalCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(put = { @CachePut("primary"), @CachePut("secondary") }) public Object multiUpdate(Object arg1) { return arg1; diff --git a/spring-context/src/test/java/org/springframework/cache/config/AnnotationNamespaceDrivenTests.java b/spring-context/src/test/java/org/springframework/cache/config/AnnotationNamespaceDrivenTests.java index 44b931dfe6b..b6785792a58 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/AnnotationNamespaceDrivenTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/AnnotationNamespaceDrivenTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -16,7 +16,7 @@ package org.springframework.cache.config; -import junit.framework.Assert; +import static org.junit.Assert.assertSame; import org.junit.Test; import org.springframework.cache.interceptor.CacheInterceptor; @@ -39,6 +39,6 @@ public class AnnotationNamespaceDrivenTests extends AbstractAnnotationTests { public void testKeyStrategy() throws Exception { CacheInterceptor ci = ctx.getBean("org.springframework.cache.interceptor.CacheInterceptor#0", CacheInterceptor.class); - Assert.assertSame(ctx.getBean("keyGenerator"), ci.getKeyGenerator()); + assertSame(ctx.getBean("keyGenerator"), ci.getKeyGenerator()); } } diff --git a/spring-context/src/test/java/org/springframework/cache/config/CacheableService.java b/spring-context/src/test/java/org/springframework/cache/config/CacheableService.java index 09e2fc4c4b1..81dd758d19d 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/CacheableService.java +++ b/spring-context/src/test/java/org/springframework/cache/config/CacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java b/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java index fc46127cd47..f9f19b47594 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java +++ b/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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,83 +33,100 @@ public class DefaultCacheableService implements CacheableService { private final AtomicLong counter = new AtomicLong(); private final AtomicLong nullInvocations = new AtomicLong(); + @Override @Cacheable("default") public Long cache(Object arg1) { return counter.getAndIncrement(); } + @Override @CacheEvict("default") public void invalidate(Object arg1) { } + @Override @CacheEvict("default") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } + @Override @CacheEvict(value = "default", allEntries = true) public void evictAll(Object arg1) { } + @Override @CacheEvict(value = "default", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @CacheEvict(value = "default", key = "#p0") public void evict(Object arg1, Object arg2) { } + @Override @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } + @Override @Cacheable(value = "default", condition = "#classField == 3") public Long conditional(int classField) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#p0") public Long key(Object arg1, Object arg2) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName") public Long name(Object arg1) { return counter.getAndIncrement(); } + @Override @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Long rootVars(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut("default") public Long update(Object arg1) { return counter.getAndIncrement(); } + @Override @CachePut(value = "default", condition = "#arg.equals(3)") public Long conditionalUpdate(Object arg) { return Long.valueOf(arg.toString()); } + @Override @Cacheable("default") public Long nullValue(Object arg1) { nullInvocations.incrementAndGet(); return null; } + @Override public Number nullInvocations() { return nullInvocations.get(); } + @Override @Cacheable("default") public Long throwChecked(Object arg1) throws Exception { throw new Exception(arg1.toString()); } + @Override @Cacheable("default") public Long throwUnchecked(Object arg1) { throw new UnsupportedOperationException(arg1.toString()); @@ -117,26 +134,31 @@ public class DefaultCacheableService implements CacheableService { // multi annotations + @Override @Caching(cacheable = { @Cacheable("primary"), @Cacheable("secondary") }) public Long multiCache(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(evict = { @CacheEvict("primary"), @CacheEvict(value = "secondary", key = "#p0"), @CacheEvict(value = "primary", key = "#p0 + 'A'") }) public Long multiEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", key = "#root.methodName") }, evict = { @CacheEvict("secondary") }) public Long multiCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(cacheable = { @Cacheable(value = "primary", condition = "#p0 == 3") }, evict = { @CacheEvict("secondary") }) public Long multiConditionalCacheAndEvict(Object arg1) { return counter.getAndIncrement(); } + @Override @Caching(put = { @CachePut("primary"), @CachePut("secondary") }) public Long multiUpdate(Object arg1) { return Long.valueOf(arg1.toString()); diff --git a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java index 29114dd9678..0a611c0bbfe 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -16,12 +16,11 @@ package org.springframework.cache.config; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import java.util.Arrays; -import junit.framework.Assert; - import org.junit.Test; import org.springframework.beans.factory.BeanCreationException; import org.springframework.cache.CacheManager; @@ -53,7 +52,7 @@ public class EnableCachingTests extends AbstractAnnotationTests { @Test public void testKeyStrategy() throws Exception { CacheInterceptor ci = ctx.getBean(CacheInterceptor.class); - Assert.assertSame(ctx.getBean(KeyGenerator.class), ci.getKeyGenerator()); + assertSame(ctx.getBean(KeyGenerator.class), ci.getKeyGenerator()); } // --- local tests ------- @@ -115,6 +114,7 @@ public class EnableCachingTests extends AbstractAnnotationTests { @Configuration @EnableCaching static class EnableCachingConfig implements CachingConfigurer { + @Override @Bean public CacheManager cacheManager() { SimpleCacheManager cm = new SimpleCacheManager(); @@ -135,6 +135,7 @@ public class EnableCachingTests extends AbstractAnnotationTests { return new AnnotatedClassCacheableService(); } + @Override @Bean public KeyGenerator keyGenerator() { return new SomeKeyGenerator(); @@ -174,9 +175,11 @@ public class EnableCachingTests extends AbstractAnnotationTests { @Bean public CacheManager cm2() { return new NoOpCacheManager(); } + @Override public CacheManager cacheManager() { return cm1(); } + @Override public KeyGenerator keyGenerator() { return null; } diff --git a/spring-context/src/test/java/org/springframework/context/ACATester.java b/spring-context/src/test/java/org/springframework/context/ACATester.java index 3faf3ba364b..c6a63ddb623 100644 --- a/spring-context/src/test/java/org/springframework/context/ACATester.java +++ b/spring-context/src/test/java/org/springframework/context/ACATester.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ public class ACATester implements ApplicationContextAware { private ApplicationContext ac; + @Override public void setApplicationContext(ApplicationContext ctx) throws ApplicationContextException { // check reinitialization if (this.ac != null) { diff --git a/spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java index a0493b62ec2..6f407fb24e0 100644 --- a/spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -18,10 +18,10 @@ package org.springframework.context; import java.util.Locale; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.AbstractListableBeanFactoryTests; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; +import org.springframework.beans.factory.xml.AbstractListableBeanFactoryTests; +import org.springframework.tests.sample.beans.LifecycleBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -39,10 +39,12 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe protected TestListener parentListener = new TestListener(); + @Override protected void setUp() throws Exception { this.applicationContext = createContext(); } + @Override protected BeanFactory getBeanFactory() { return applicationContext; } diff --git a/spring-context/src/test/java/org/springframework/context/BeanThatBroadcasts.java b/spring-context/src/test/java/org/springframework/context/BeanThatBroadcasts.java index f525d38fe16..f4454c64daa 100644 --- a/spring-context/src/test/java/org/springframework/context/BeanThatBroadcasts.java +++ b/spring-context/src/test/java/org/springframework/context/BeanThatBroadcasts.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -26,6 +26,7 @@ public class BeanThatBroadcasts implements ApplicationContextAware { public int receivedCount; + @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; if (applicationContext.getDisplayName().indexOf("listener") != -1) { diff --git a/spring-context/src/test/java/org/springframework/context/BeanThatListens.java b/spring-context/src/test/java/org/springframework/context/BeanThatListens.java index 3bda3d37230..479ddb33de2 100644 --- a/spring-context/src/test/java/org/springframework/context/BeanThatListens.java +++ b/spring-context/src/test/java/org/springframework/context/BeanThatListens.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -43,6 +43,7 @@ public class BeanThatListens implements ApplicationListener { } + @Override public void onApplicationEvent(ApplicationEvent event) { eventCount++; if (beanThatBroadcasts != null) { diff --git a/spring-context/src/test/java/org/springframework/context/LifecycleContextBean.java b/spring-context/src/test/java/org/springframework/context/LifecycleContextBean.java index 720a7cd9b4b..96f39c3296a 100644 --- a/spring-context/src/test/java/org/springframework/context/LifecycleContextBean.java +++ b/spring-context/src/test/java/org/springframework/context/LifecycleContextBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.context; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; +import org.springframework.tests.sample.beans.LifecycleBean; /** * Simple bean to test ApplicationContext lifecycle methods for beans @@ -30,18 +30,21 @@ public class LifecycleContextBean extends LifecycleBean implements ApplicationCo protected ApplicationContext owningContext; + @Override public void setBeanFactory(BeanFactory beanFactory) { super.setBeanFactory(beanFactory); if (this.owningContext != null) throw new RuntimeException("Factory called setBeanFactory after setApplicationContext"); } + @Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (this.owningContext == null) throw new RuntimeException("Factory didn't call setAppliationContext before afterPropertiesSet on lifecycle bean"); } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if (this.owningFactory == null) throw new RuntimeException("Factory called setApplicationContext before setBeanFactory"); diff --git a/spring-context/src/test/java/org/springframework/context/TestListener.java b/spring-context/src/test/java/org/springframework/context/TestListener.java index 834439484c9..8bcaa6d6c17 100644 --- a/spring-context/src/test/java/org/springframework/context/TestListener.java +++ b/spring-context/src/test/java/org/springframework/context/TestListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ public class TestListener implements ApplicationListener { eventCount = 0; } + @Override public void onApplicationEvent(ApplicationEvent e) { ++eventCount; } diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java b/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java index c93760bf67e..33bdac26e81 100644 --- a/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java +++ b/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,9 @@ package org.springframework.context.access; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import org.junit.Test; import org.springframework.context.ConfigurableApplicationContext; @@ -32,10 +33,7 @@ public class ContextBeanFactoryReferenceTests { @Test public void testAllOperations() { - ConfigurableApplicationContext ctx = createMock(ConfigurableApplicationContext.class); - - ctx.close(); - replay(ctx); + ConfigurableApplicationContext ctx = mock(ConfigurableApplicationContext.class); ContextBeanFactoryReference bfr = new ContextBeanFactoryReference(ctx); @@ -49,6 +47,6 @@ public class ContextBeanFactoryReferenceTests { // expected } - verify(ctx); + verify(ctx).close(); } } diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-collections.xml b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-collections.xml index 30b7c590c89..81770ea423f 100644 --- a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-collections.xml +++ b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-collections.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + Jenny 30 @@ -11,8 +11,8 @@ - - + + Simple bean, without any collections. @@ -22,8 +22,8 @@ 27 - - + + Rod 32 @@ -34,8 +34,8 @@ - - + + Jenny 30 @@ -44,12 +44,12 @@ - + David 27 - + Rod 32 @@ -63,7 +63,7 @@ - + loner 26 @@ -73,8 +73,8 @@ - - + + @@ -84,7 +84,7 @@ - + @@ -97,26 +97,26 @@ - + verbose - - + + - + - + - - + + @@ -126,7 +126,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -198,8 +198,8 @@ - - + + @@ -207,7 +207,7 @@ - + bar @@ -217,15 +217,15 @@ - + - - - + + + bar @@ -233,8 +233,8 @@ - - + + @@ -243,7 +243,7 @@ - + one @@ -251,8 +251,8 @@ - - + + java.lang.String @@ -260,8 +260,8 @@ - - + + 0 diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-parent.xml b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-parent.xml index 6f5675fffd6..99d732a1642 100644 --- a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-parent.xml +++ b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests-parent.xml @@ -3,7 +3,7 @@ - + parent 1 @@ -13,11 +13,11 @@ 1 - + parent 2 - + diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests.java b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests.java index eb3bc80d39b..8001716e485 100644 --- a/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests.java +++ b/spring-context/src/test/java/org/springframework/context/access/ContextJndiBeanFactoryLocatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.access.BootstrapException; import org.springframework.context.ApplicationContext; -import org.springframework.mock.jndi.SimpleNamingContextBuilder; +import org.springframework.tests.mock.jndi.SimpleNamingContextBuilder; /** * @author Colin Sampaleanu diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java b/spring-context/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java index 96750057f5c..59137c75169 100644 --- a/spring-context/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java +++ b/spring-context/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -16,14 +16,16 @@ package org.springframework.context.access; -import static org.junit.Assert.*; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import org.junit.Test; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.access.BeanFactoryLocator; import org.springframework.beans.factory.access.BeanFactoryReference; import org.springframework.beans.factory.access.SingletonBeanFactoryLocatorTests; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.util.ClassUtils; @@ -43,10 +45,13 @@ public class ContextSingletonBeanFactoryLocatorTests extends SingletonBeanFactor public void testBaseBeanFactoryDefs() { // Just test the base BeanFactory/AppContext defs we are going to work // with in other tests. - new XmlBeanFactory(new ClassPathResource("/org/springframework/beans/factory/access/beans1.xml")); - new XmlBeanFactory(new ClassPathResource("/org/springframework/beans/factory/access/beans2.xml")); + new XmlBeanDefinitionReader(new DefaultListableBeanFactory()).loadBeanDefinitions(new ClassPathResource( + "/org/springframework/beans/factory/access/beans1.xml")); + new XmlBeanDefinitionReader(new DefaultListableBeanFactory()).loadBeanDefinitions(new ClassPathResource( + "/org/springframework/beans/factory/access/beans2.xml")); } + @Override @Test public void testBasicFunctionality() { ContextSingletonBeanFactoryLocator facLoc = new ContextSingletonBeanFactoryLocator( @@ -71,6 +76,7 @@ public class ContextSingletonBeanFactoryLocatorTests extends SingletonBeanFactor * 2nd and subsequent calls will actually get back same locator instance. This is not * really an issue, since the contained bean factories will still be loaded and released. */ + @Override @Test public void testGetInstance() { // Try with and without 'classpath*:' prefix, and with 'classpath:' prefix. diff --git a/spring-context/src/test/java/org/springframework/context/access/DefaultLocatorFactoryTests.java b/spring-context/src/test/java/org/springframework/context/access/DefaultLocatorFactoryTests.java index eee36e9d9bc..633127e84b7 100644 --- a/spring-context/src/test/java/org/springframework/context/access/DefaultLocatorFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/context/access/DefaultLocatorFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java index 50ed95df10d..e3ed03301f4 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AbstractCircularImportDetectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConfigurationClassParser; import org.springframework.context.annotation.Import; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java index a829ee49f97..23973400039 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -159,18 +159,22 @@ public class AnnotationConfigApplicationContextTests { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.register(AutowiredConfig.class); context.getBeanFactory().addBeanPostProcessor(new BeanPostProcessor() { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) { return (bean instanceof TestBean ? null : bean); } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) { return bean; } }); context.getBeanFactory().addBeanPostProcessor(new BeanPostProcessor() { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) { bean.getClass().getName(); return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) { bean.getClass().getName(); return bean; @@ -230,14 +234,17 @@ public class AnnotationConfigApplicationContextTests { static class UntypedFactoryBean implements FactoryBean { + @Override public Object getObject() { return null; } + @Override public Class getObjectType() { return null; } + @Override public boolean isSingleton() { return false; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java index 87921285875..0a9cfdf655f 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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,19 +17,22 @@ package org.springframework.context.annotation; import static org.junit.Assert.*; +import static org.junit.Assume.assumeFalse; import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.context.support.GenericApplicationContext; import org.springframework.util.StopWatch; @@ -44,10 +47,8 @@ public class AnnotationProcessorPerformanceTests { @Test public void testPrototypeCreationWithResourcePropertiesIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ctx = new GenericApplicationContext(); AnnotationConfigUtils.registerAnnotationConfigProcessors(ctx); ctx.refresh(); @@ -70,10 +71,8 @@ public class AnnotationProcessorPerformanceTests { @Test public void testPrototypeCreationWithOverriddenResourcePropertiesIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ctx = new GenericApplicationContext(); AnnotationConfigUtils.registerAnnotationConfigProcessors(ctx); ctx.refresh(); @@ -97,10 +96,8 @@ public class AnnotationProcessorPerformanceTests { @Test public void testPrototypeCreationWithAutowiredPropertiesIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ctx = new GenericApplicationContext(); AnnotationConfigUtils.registerAnnotationConfigProcessors(ctx); ctx.refresh(); @@ -123,10 +120,8 @@ public class AnnotationProcessorPerformanceTests { @Test public void testPrototypeCreationWithOverriddenAutowiredPropertiesIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ctx = new GenericApplicationContext(); AnnotationConfigUtils.registerAnnotationConfigProcessors(ctx); ctx.refresh(); @@ -151,6 +146,7 @@ public class AnnotationProcessorPerformanceTests { private static class ResourceAnnotatedTestBean extends TestBean { + @Override @Resource @Required public void setSpouse(ITestBean spouse) { super.setSpouse(spouse); @@ -160,6 +156,7 @@ public class AnnotationProcessorPerformanceTests { private static class AutowiredAnnotatedTestBean extends TestBean { + @Override @Autowired @Required public void setSpouse(ITestBean spouse) { super.setSpouse(spouse); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationScopeMetadataResolverTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationScopeMetadataResolverTests.java index 8e8cf870959..16565d9b1d7 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationScopeMetadataResolverTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationScopeMetadataResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java index 01e25e80300..61b2612d29c 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AsmCircularImportDetectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java index 50b8cd20459..55d08669d09 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import org.aspectj.lang.annotation.Aspect; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanDefinition; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ClassPathFactoryBeanDefinitionScannerTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ClassPathFactoryBeanDefinitionScannerTests.java index 1f81d31669d..4475d87e4a8 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ClassPathFactoryBeanDefinitionScannerTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ClassPathFactoryBeanDefinitionScannerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -20,10 +20,10 @@ import junit.framework.TestCase; import org.springframework.aop.scope.ScopedObject; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.TestBean; +import org.springframework.tests.context.SimpleMapScope; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.config.SimpleMapScope; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.annotation4.DependencyBean; import org.springframework.context.annotation4.FactoryMethodComponent; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java b/spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java index b4135bf6468..331a2f0af2a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -25,22 +25,23 @@ import javax.ejb.EJB; import org.junit.Test; import org.springframework.beans.BeansException; -import org.springframework.beans.INestedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.NestedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.mock.jndi.ExpectedLookupTemplate; +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.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.support.GenericApplicationContext; import org.springframework.jndi.support.SimpleJndiBeanFactory; -import org.springframework.mock.jndi.ExpectedLookupTemplate; import org.springframework.util.SerializationTestUtils; import static org.junit.Assert.*; @@ -171,9 +172,15 @@ public class CommonAnnotationBeanPostProcessorTests { CommonAnnotationBeanPostProcessor bpp = new CommonAnnotationBeanPostProcessor(); bpp.setResourceFactory(bf); bf.addBeanPostProcessor(bpp); - bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ResourceInjectionBean.class, false)); - bf.registerBeanDefinition("testBean", new RootBeanDefinition(TestBean.class, false)); - bf.registerBeanDefinition("testBean2", new RootBeanDefinition(TestBean.class, false)); + RootBeanDefinition abd = new RootBeanDefinition(ResourceInjectionBean.class); + abd.setScope(BeanDefinition.SCOPE_PROTOTYPE); + bf.registerBeanDefinition("annotatedBean", abd); + RootBeanDefinition tbd1 = new RootBeanDefinition(TestBean.class); + tbd1.setScope(BeanDefinition.SCOPE_PROTOTYPE); + bf.registerBeanDefinition("testBean", tbd1); + RootBeanDefinition tbd2 = new RootBeanDefinition(TestBean.class); + tbd2.setScope(BeanDefinition.SCOPE_PROTOTYPE); + bf.registerBeanDefinition("testBean2", tbd2); ResourceInjectionBean bean = (ResourceInjectionBean) bf.getBean("annotatedBean"); assertTrue(bean.initCalled); @@ -202,11 +209,16 @@ public class CommonAnnotationBeanPostProcessorTests { CommonAnnotationBeanPostProcessor bpp = new CommonAnnotationBeanPostProcessor(); bpp.setBeanFactory(bf); bf.addBeanPostProcessor(bpp); - bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ExtendedResourceInjectionBean.class, false)); - bf.registerBeanDefinition("testBean4", new RootBeanDefinition(TestBean.class, false)); + RootBeanDefinition abd = new RootBeanDefinition(ExtendedResourceInjectionBean.class); + abd.setScope(BeanDefinition.SCOPE_PROTOTYPE); + bf.registerBeanDefinition("annotatedBean", abd); + RootBeanDefinition tbd = new RootBeanDefinition(TestBean.class); + tbd.setScope(BeanDefinition.SCOPE_PROTOTYPE); + bf.registerBeanDefinition("testBean4", tbd); bf.registerResolvableDependency(BeanFactory.class, bf); bf.registerResolvableDependency(INestedTestBean.class, new ObjectFactory() { + @Override public Object getObject() throws BeansException { return new NestedTestBean(); } @@ -452,6 +464,7 @@ public class CommonAnnotationBeanPostProcessorTests { public static class InitDestroyBeanPostProcessor implements DestructionAwareBeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof AnnotatedInitDestroyBean) { assertFalse(((AnnotatedInitDestroyBean) bean).initCalled); @@ -459,6 +472,7 @@ public class CommonAnnotationBeanPostProcessorTests { return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof AnnotatedInitDestroyBean) { assertTrue(((AnnotatedInitDestroyBean) bean).initCalled); @@ -466,6 +480,7 @@ public class CommonAnnotationBeanPostProcessorTests { return bean; } + @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { if (bean instanceof AnnotatedInitDestroyBean) { assertFalse(((AnnotatedInitDestroyBean) bean).destroyCalled); @@ -566,6 +581,7 @@ public class CommonAnnotationBeanPostProcessorTests { @Resource private BeanFactory beanFactory; + @Override @Resource public void setTestBean2(TestBean testBean2) { super.setTestBean2(testBean2); @@ -597,6 +613,7 @@ public class CommonAnnotationBeanPostProcessorTests { return testBean6; } + @Override @PostConstruct protected void init2() { if (this.testBean3 == null || this.testBean4 == null) { @@ -605,6 +622,7 @@ public class CommonAnnotationBeanPostProcessorTests { super.init2(); } + @Override @PreDestroy protected void destroy2() { super.destroy2(); @@ -627,6 +645,7 @@ public class CommonAnnotationBeanPostProcessorTests { @Resource private BeanFactory beanFactory; + @Override @EJB public void setTestBean2(TestBean testBean2) { super.setTestBean2(testBean2); @@ -650,6 +669,7 @@ public class CommonAnnotationBeanPostProcessorTests { return testBean4; } + @Override @PostConstruct protected void init2() { if (this.testBean3 == null || this.testBean4 == null) { @@ -658,6 +678,7 @@ public class CommonAnnotationBeanPostProcessorTests { super.init2(); } + @Override @PreDestroy protected void destroy2() { super.destroy2(); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java index 7b461584a0a..f6d90975c2d 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -31,12 +31,12 @@ import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annotation.CustomAutowireConfigurer; import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.config.SimpleMapScope; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.ComponentScanParserTests.CustomAnnotationAutowiredBean; import org.springframework.context.support.GenericApplicationContext; +import org.springframework.tests.context.SimpleMapScope; import org.springframework.util.SerializationTestUtils; import example.scannable.CustomComponent; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserScopedProxyTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserScopedProxyTests.java index 4cbfd9b34e7..31a87271caf 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserScopedProxyTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserScopedProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -23,8 +23,8 @@ import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.beans.FatalBeanException; -import org.springframework.beans.factory.config.SimpleMapScope; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.tests.context.SimpleMapScope; import org.springframework.util.SerializationTestUtils; /** diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java index 75bef42a0f8..5a4508b9037 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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,6 +147,7 @@ public class ComponentScanParserTests { public static class CustomTypeFilter implements TypeFilter { + @Override public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) { return metadataReader.getClassMetadata().getClassName().contains("Custom"); } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserWithUserDefinedStrategiesTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserWithUserDefinedStrategiesTests.java index c7237a2f6ba..02749a2e516 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserWithUserDefinedStrategiesTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserWithUserDefinedStrategiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java index d917b0d6086..b35fc045745 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassAndBFPPTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import static org.junit.Assert.assertThat; import org.junit.Test; import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -75,6 +75,7 @@ public class ConfigurationClassAndBFPPTests { @Bean public BeanFactoryPostProcessor bfpp() { return new BeanFactoryPostProcessor() { + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { // no-op } @@ -90,6 +91,7 @@ public class ConfigurationClassAndBFPPTests { @Bean public static final BeanFactoryPostProcessor bfpp() { return new BeanFactoryPostProcessor() { + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { // no-op } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java index eb288746fd2..6972adada9a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostConstructAndAutowiringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import static org.junit.Assert.assertThat; import javax.annotation.PostConstruct; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; /** diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java index d52a9db656f..815c487294d 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.context.annotation; import static org.junit.Assert.*; import org.junit.Test; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.support.ChildBeanDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndAutowiringTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndAutowiringTests.java index 14d1932dca6..81e7b1af66b 100755 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndAutowiringTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndAutowiringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -95,12 +95,15 @@ class DummyBean { class MyFactoryBean implements FactoryBean { + @Override public String getObject() throws Exception { return "foo"; } + @Override public Class getObjectType() { return String.class; } + @Override public boolean isSingleton() { return true; } @@ -115,15 +118,18 @@ class MyParameterizedFactoryBean implements FactoryBean { this.obj = obj; } + @Override public T getObject() throws Exception { return obj; } + @Override @SuppressWarnings("unchecked") public Class getObjectType() { return (Class)obj.getClass(); } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndParametersTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndParametersTests.java index b2c1db67d97..570d2a53aac 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndParametersTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanAndParametersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -63,14 +63,17 @@ class Bar { class FooFactoryBean implements FactoryBean { + @Override public Foo getObject() { return new Foo(); } + @Override public Class getObjectType() { return Foo.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java index d89deb4415c..7baf82681eb 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/DestroyMethodInferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -140,6 +140,7 @@ public class DestroyMethodInferenceTests { static class WithInheritedCloseMethod implements Closeable { boolean closed = false; + @Override public void close() throws IOException { closed = true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java b/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java index df6b5fb8e96..9a3ced52d70 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -16,10 +16,10 @@ package org.springframework.context.annotation; -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expectLastCall; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; +import static org.mockito.Matchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; import java.lang.instrument.ClassFileTransformer; @@ -40,7 +40,7 @@ public class EnableLoadTimeWeavingTests { public void control() { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(getClass(), "EnableLoadTimeWeavingTests-context.xml"); - ctx.getBean("loadTimeWeaver"); + ctx.getBean("loadTimeWeaver", LoadTimeWeaver.class); } @Test @@ -48,7 +48,8 @@ public class EnableLoadTimeWeavingTests { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(EnableLTWConfig_withAjWeavingDisabled.class); ctx.refresh(); - ctx.getBean("loadTimeWeaver"); + LoadTimeWeaver loadTimeWeaver = ctx.getBean("loadTimeWeaver", LoadTimeWeaver.class); + verifyZeroInteractions(loadTimeWeaver); } @Test @@ -56,7 +57,10 @@ public class EnableLoadTimeWeavingTests { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(EnableLTWConfig_withAjWeavingAutodetect.class); ctx.refresh(); - ctx.getBean("loadTimeWeaver"); + LoadTimeWeaver loadTimeWeaver = ctx.getBean("loadTimeWeaver", LoadTimeWeaver.class); + // no expectations -> a class file transformer should NOT be added + // because no META-INF/aop.xml is present on the classpath + verifyZeroInteractions(loadTimeWeaver); } @Test @@ -64,41 +68,34 @@ public class EnableLoadTimeWeavingTests { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(EnableLTWConfig_withAjWeavingEnabled.class); ctx.refresh(); - ctx.getBean("loadTimeWeaver"); + LoadTimeWeaver loadTimeWeaver = ctx.getBean("loadTimeWeaver", LoadTimeWeaver.class); + verify(loadTimeWeaver).addTransformer(isA(ClassFileTransformer.class)); } @Configuration @EnableLoadTimeWeaving(aspectjWeaving=AspectJWeaving.DISABLED) static class EnableLTWConfig_withAjWeavingDisabled implements LoadTimeWeavingConfigurer { + @Override public LoadTimeWeaver getLoadTimeWeaver() { - LoadTimeWeaver mockLTW = createMock(LoadTimeWeaver.class); - // no expectations -> a class file transformer should NOT be added - replay(mockLTW); - return mockLTW; + return mock(LoadTimeWeaver.class); } } @Configuration @EnableLoadTimeWeaving(aspectjWeaving=AspectJWeaving.AUTODETECT) static class EnableLTWConfig_withAjWeavingAutodetect implements LoadTimeWeavingConfigurer { + @Override public LoadTimeWeaver getLoadTimeWeaver() { - LoadTimeWeaver mockLTW = createMock(LoadTimeWeaver.class); - // no expectations -> a class file transformer should NOT be added - // because no META-INF/aop.xml is present on the classpath - replay(mockLTW); - return mockLTW; + return mock(LoadTimeWeaver.class); } } @Configuration @EnableLoadTimeWeaving(aspectjWeaving=AspectJWeaving.ENABLED) static class EnableLTWConfig_withAjWeavingEnabled implements LoadTimeWeavingConfigurer { + @Override public LoadTimeWeaver getLoadTimeWeaver() { - LoadTimeWeaver mockLTW = createMock(LoadTimeWeaver.class); - mockLTW.addTransformer(isA(ClassFileTransformer.class)); - expectLastCall(); - replay(mockLTW); - return mockLTW; + return mock(LoadTimeWeaver.class); } } } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/FooServiceDependentConverter.java b/spring-context/src/test/java/org/springframework/context/annotation/FooServiceDependentConverter.java index 4546a22de08..eab6f37b7fe 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/FooServiceDependentConverter.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/FooServiceDependentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import org.springframework.core.convert.converter.Converter; /** * @author Juergen Hoeller */ -public class FooServiceDependentConverter implements Converter { +public class FooServiceDependentConverter implements Converter { private FooService fooService; @@ -31,8 +31,9 @@ public class FooServiceDependentConverter implements Converter initMethods = new ArrayList(); final List destroyMethods = new ArrayList(); + @Override @PostConstruct public void afterPropertiesSet() throws Exception { this.initMethods.add("afterPropertiesSet"); } + @Override @PreDestroy public void destroy() throws Exception { this.destroyMethods.add("destroy"); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java index 50453f6b5d2..48780c545fe 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/Spr6602Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -85,14 +85,17 @@ public class Spr6602Tests { public static class BarFactory implements FactoryBean { + @Override public Bar getObject() throws Exception { return new Bar(); } + @Override public Class getObjectType() { return Bar.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/TestBeanNameGenerator.java b/spring-context/src/test/java/org/springframework/context/annotation/TestBeanNameGenerator.java index 1f77d726b9a..f57fac7fd84 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/TestBeanNameGenerator.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/TestBeanNameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -24,6 +24,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; */ public class TestBeanNameGenerator extends AnnotationBeanNameGenerator { + @Override public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { String beanName = super.generateBeanName(definition, registry); return "testing." + beanName; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/TestScopeMetadataResolver.java b/spring-context/src/test/java/org/springframework/context/annotation/TestScopeMetadataResolver.java index 5471d438af4..bde4c67cb08 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/TestScopeMetadataResolver.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/TestScopeMetadataResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ import org.springframework.beans.factory.config.BeanDefinition; */ public class TestScopeMetadataResolver implements ScopeMetadataResolver { + @Override public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDefinition) { ScopeMetadata metadata = new ScopeMetadata(); metadata.setScopeName("myCustomScope"); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level1/Level1Config.java b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level1/Level1Config.java index 0ec8a5b7575..29a53ac60da 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level1/Level1Config.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level1/Level1Config.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.context.annotation.componentscan.level1; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level2/Level2Config.java b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level2/Level2Config.java index cc8c42f5ed4..5039456d340 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level2/Level2Config.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/level2/Level2Config.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.context.annotation.componentscan.level2; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java index e061bc7edf5..45bea621805 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -19,14 +19,15 @@ package org.springframework.context.annotation.configuration; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; -import test.beans.Colour; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.Colour; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; @@ -79,7 +80,9 @@ public class AutowiredConfigurationTests { */ @Test(expected=BeanCreationException.class) public void testAutowiredConfigurationConstructorsAreNotSupported() { - XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("annotation-config.xml", AutowiredConstructorConfig.class)); + DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(factory).loadBeanDefinitions( + new ClassPathResource("annotation-config.xml", AutowiredConstructorConfig.class)); GenericApplicationContext ctx = new GenericApplicationContext(factory); ctx.registerBeanDefinition("config1", new RootBeanDefinition(AutowiredConstructorConfig.class)); ctx.registerBeanDefinition("config2", new RootBeanDefinition(ColorConfig.class)); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanAnnotationAttributePropagationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanAnnotationAttributePropagationTests.java index da770cb924e..f0dcbab8abb 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanAnnotationAttributePropagationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanAnnotationAttributePropagationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java index 0db15b1d7fd..ba336cdb8f2 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanMethodQualificationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import org.junit.Test; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java index 445397c384d..39c2654d0b1 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationBeanNameTests.java @@ -65,6 +65,7 @@ public class ConfigurationBeanNameTests { public void registerOuterConfig_withBeanNameGenerator() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.setBeanNameGenerator(new AnnotationBeanNameGenerator() { + @Override public String generateBeanName( BeanDefinition definition, BeanDefinitionRegistry registry) { return "custom-" + super.generateBeanName(definition, registry); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java index c983ea4e3ac..f846eb2632c 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,21 +16,22 @@ package org.springframework.context.annotation.configuration; -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.junit.Test; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ConfigurationClassPostProcessor; import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.io.ClassPathResource; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** @@ -47,8 +48,10 @@ import test.beans.TestBean; */ public class ConfigurationClassAspectIntegrationTests { private void assertAdviceWasApplied(Class configClass) { - GenericApplicationContext ctx = new GenericApplicationContext( - new XmlBeanFactory(new ClassPathResource("aspectj-autoproxy-config.xml", ConfigurationClassAspectIntegrationTests.class))); + DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(factory).loadBeanDefinitions( + new ClassPathResource("aspectj-autoproxy-config.xml", ConfigurationClassAspectIntegrationTests.class)); + GenericApplicationContext ctx = new GenericApplicationContext(factory); ctx.addBeanFactoryPostProcessor(new ConfigurationClassPostProcessor()); ctx.registerBeanDefinition("config", new RootBeanDefinition(configClass)); ctx.refresh(); @@ -78,7 +81,7 @@ public class ConfigurationClassAspectIntegrationTests { return new TestBean("name"); } - @Before("execution(* test.beans.TestBean.absquatulate(..)) && target(testBean)") + @Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)") public void touchBean(TestBean testBean) { testBean.setName("advisedName"); } @@ -99,7 +102,7 @@ public class ConfigurationClassAspectIntegrationTests { @Aspect static class NameChangingAspect { - @Before("execution(* test.beans.TestBean.absquatulate(..)) && target(testBean)") + @Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)") public void touchBean(TestBean testBean) { testBean.setName("advisedName"); } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassCglibCallbackDeregistrationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassCglibCallbackDeregistrationTests.java index 1d21211ad79..c18cc981e7e 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassCglibCallbackDeregistrationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassCglibCallbackDeregistrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -70,6 +70,7 @@ public class ConfigurationClassCglibCallbackDeregistrationTests { @Configuration static class DisposableConfig implements DisposableBean { boolean destroyed = false; + @Override public void destroy() throws Exception { this.destroyed = true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java index 8073f92b831..54846f4133c 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.List; import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.BeanFactory; @@ -284,12 +284,14 @@ public class ConfigurationClassProcessingTests { public void setNameSuffix(String nameSuffix) { this.nameSuffix = nameSuffix; } + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) { if (bean instanceof ITestBean) { ((ITestBean) bean).setName(((ITestBean) bean).getName() + nameSuffix); } return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) { return bean; } @@ -302,6 +304,7 @@ public class ConfigurationClassProcessingTests { //@Bean public BeanFactoryPostProcessor beanFactoryPostProcessor() { return new BeanFactoryPostProcessor() { + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { BeanDefinition bd = beanFactory.getBeanDefinition("beanPostProcessor"); bd.getPropertyValues().addPropertyValue("nameSuffix", "-processed-" + myProp); @@ -334,6 +337,7 @@ public class ConfigurationClassProcessingTests { super.setSpouse(spouse); } + @Override public void onApplicationEvent(ContextRefreshedEvent event) { this.refreshed = true; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java index c81b3d9ab86..960b5ee8052 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassWithPlaceholderConfigurerBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -28,8 +28,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * A configuration class that registers a placeholder configurer @Bean method diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java index c556e868983..00844065470 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationMetaAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java index 6250ffd310b..7e5570ee4e3 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties index 3ecf4accbb4..59146595c2a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties @@ -1 +1 @@ -propertiesDeclaredBean.(class)=test.beans.TestBean \ No newline at end of file +propertiesDeclaredBean.(class)=org.springframework.tests.sample.beans.TestBean \ No newline at end of file diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java index 7bdf1daac51..6bb97b2a95a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportResourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -132,7 +132,7 @@ public class ImportResourceTests { @Aspect static class AnAspect { - @Before("execution(* test.beans.TestBean.*(..))") + @Before("execution(* org.springframework.tests.sample.beans.TestBean.*(..))") public void advice() { } } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java index c27d84c1310..c39cff7977b 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -19,8 +19,8 @@ package org.springframework.context.annotation.configuration; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.parsing.BeanDefinitionParsingException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml index 68d5f0286dc..344716316fe 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml index 44fc77e3b5e..1b95433a63e 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java index 2d4783496a1..e895a207c3a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportedConfigurationClassEnhancementTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -30,7 +30,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.util.ClassUtils; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Unit tests cornering the bug exposed in SPR-6779. diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ScopingTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ScopingTests.java index b0d617e9cf3..52aaaac7e91 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ScopingTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ScopingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -27,8 +27,8 @@ import org.junit.After; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.aop.scope.ScopedObject; import org.springframework.beans.factory.ObjectFactory; @@ -379,6 +379,7 @@ public class ScopingTests { private Map beans = new HashMap(); + @Override public Object get(String name, ObjectFactory objectFactory) { if (createNewScope) { beans.clear(); @@ -396,18 +397,22 @@ public class ScopingTests { return beans.get(name); } + @Override public String getConversationId() { return null; } + @Override public void registerDestructionCallback(String name, Runnable callback) { // do nothing } + @Override public Object remove(String name) { return beans.remove(name); } + @Override public Object resolveContextualObject(String key) { return null; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java index 9c8f2400035..02f0fd8e3e6 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/Spr7167Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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,6 +67,7 @@ class MyPostProcessor implements BeanFactoryPostProcessor { public MyPostProcessor(Dependency someDependency) { } + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { AbstractBeanDefinition bd = (AbstractBeanDefinition) beanFactory.getBeanDefinition("someDependency"); bd.setDescription("post processed by MyPostProcessor"); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java index be87313477b..206ac4d8bcb 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/annotation3/StubFooDao.java b/spring-context/src/test/java/org/springframework/context/annotation3/StubFooDao.java index 64f491bd4e9..5c53712e5aa 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation3/StubFooDao.java +++ b/spring-context/src/test/java/org/springframework/context/annotation3/StubFooDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -28,6 +28,7 @@ import example.scannable.FooDao; @Qualifier("testing") public class StubFooDao implements FooDao { + @Override public String findFoo(int id) { return "bar"; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation4/FactoryMethodComponent.java b/spring-context/src/test/java/org/springframework/context/annotation4/FactoryMethodComponent.java index 125c77c6363..6c59cf85228 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation4/FactoryMethodComponent.java +++ b/spring-context/src/test/java/org/springframework/context/annotation4/FactoryMethodComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.context.annotation4; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/spring-context/src/test/java/org/springframework/context/annotation4/SimpleBean.java b/spring-context/src/test/java/org/springframework/context/annotation4/SimpleBean.java index b2cc55fec21..fcfe98d94ad 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation4/SimpleBean.java +++ b/spring-context/src/test/java/org/springframework/context/annotation4/SimpleBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.context.annotation4; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.annotation.Bean; /** diff --git a/spring-context/src/test/java/org/springframework/context/annotation5/OtherFooDao.java b/spring-context/src/test/java/org/springframework/context/annotation5/OtherFooDao.java index 67f07601774..415cf895198 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation5/OtherFooDao.java +++ b/spring-context/src/test/java/org/springframework/context/annotation5/OtherFooDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -24,6 +24,7 @@ import example.scannable.FooDao; @MyRepository public class OtherFooDao implements FooDao { + @Override public String findFoo(int id) { return "other"; } diff --git a/spring-context/src/test/java/org/springframework/context/annotation6/ConfigForScanning.java b/spring-context/src/test/java/org/springframework/context/annotation6/ConfigForScanning.java index 8dbb67f34ae..42098c96e79 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation6/ConfigForScanning.java +++ b/spring-context/src/test/java/org/springframework/context/annotation6/ConfigForScanning.java @@ -3,7 +3,7 @@ package org.springframework.context.annotation6; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; @Configuration public class ConfigForScanning { diff --git a/spring-context/src/test/java/org/springframework/context/conversionservice/Bar.java b/spring-context/src/test/java/org/springframework/context/conversionservice/Bar.java index 80949157002..1c8bdb54dde 100644 --- a/spring-context/src/test/java/org/springframework/context/conversionservice/Bar.java +++ b/spring-context/src/test/java/org/springframework/context/conversionservice/Bar.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/conversionservice/ConversionServiceContextConfigTests.java b/spring-context/src/test/java/org/springframework/context/conversionservice/ConversionServiceContextConfigTests.java index c319cde5203..1771dd7cf57 100644 --- a/spring-context/src/test/java/org/springframework/context/conversionservice/ConversionServiceContextConfigTests.java +++ b/spring-context/src/test/java/org/springframework/context/conversionservice/ConversionServiceContextConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/conversionservice/StringToBarConverter.java b/spring-context/src/test/java/org/springframework/context/conversionservice/StringToBarConverter.java index 5248cb2644a..56090d33273 100644 --- a/spring-context/src/test/java/org/springframework/context/conversionservice/StringToBarConverter.java +++ b/spring-context/src/test/java/org/springframework/context/conversionservice/StringToBarConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ import org.springframework.core.convert.converter.Converter; */ public class StringToBarConverter implements Converter { + @Override public Bar convert(String source) { return new Bar(source); } diff --git a/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java b/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java index 24dec9ad54d..d124bac8306 100644 --- a/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java +++ b/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -20,13 +20,16 @@ import java.util.HashSet; import java.util.Set; import org.aopalliance.intercept.MethodInvocation; -import org.easymock.EasyMock; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.ApplicationContext; @@ -50,14 +53,12 @@ public class ApplicationContextEventTests { @SuppressWarnings("unchecked") ApplicationListener listener = mock(ApplicationListener.class); ApplicationEvent evt = new ContextClosedEvent(new StaticApplicationContext()); - listener.onApplicationEvent(evt); SimpleApplicationEventMulticaster smc = new SimpleApplicationEventMulticaster(); smc.addApplicationListener(listener); - replay(listener); smc.multicastEvent(evt); - verify(listener); + verify(listener).onApplicationEvent(evt); } @Test @@ -91,20 +92,18 @@ public class ApplicationContextEventTests { @Test public void testEventPublicationInterceptor() throws Throwable { - MethodInvocation invocation = EasyMock.createMock(MethodInvocation.class); - ApplicationContext ctx = EasyMock.createMock(ApplicationContext.class); + MethodInvocation invocation = mock(MethodInvocation.class); + ApplicationContext ctx = mock(ApplicationContext.class); EventPublicationInterceptor interceptor = new EventPublicationInterceptor(); interceptor.setApplicationEventClass(MyEvent.class); interceptor.setApplicationEventPublisher(ctx); interceptor.afterPropertiesSet(); - expect(invocation.proceed()).andReturn(new Object()); - expect(invocation.getThis()).andReturn(new Object()); - ctx.publishEvent(isA(MyEvent.class)); - replay(invocation, ctx); + given(invocation.proceed()).willReturn(new Object()); + given(invocation.getThis()).willReturn(new Object()); interceptor.invoke(invocation); - verify(invocation, ctx); + verify(ctx).publishEvent(isA(MyEvent.class)); } @Test @@ -214,10 +213,12 @@ public class ApplicationContextEventTests { public final Set seenEvents = new HashSet(); + @Override public void onApplicationEvent(ApplicationEvent event) { this.seenEvents.add(event); } + @Override public int getOrder() { return 0; } @@ -230,6 +231,7 @@ public class ApplicationContextEventTests { public static abstract class MyOrderedListenerBase implements MyOrderedListenerIfc { + @Override public int getOrder() { return 1; } @@ -244,6 +246,7 @@ public class ApplicationContextEventTests { this.otherListener = otherListener; } + @Override public void onApplicationEvent(MyEvent event) { assertTrue(otherListener.seenEvents.contains(event)); } @@ -254,6 +257,7 @@ public class ApplicationContextEventTests { public static final Set seenEvents = new HashSet(); + @Override public void onApplicationEvent(ApplicationEvent event) { seenEvents.add(event); } diff --git a/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java b/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java index 4e1f90468cf..1a0e064b757 100644 --- a/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -16,16 +16,16 @@ package org.springframework.context.event; -import static org.easymock.EasyMock.*; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; import org.junit.Before; import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.BeansException; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEventPublisher; @@ -44,13 +44,7 @@ public class EventPublicationInterceptorTests { @Before public void setUp() { - publisher = createMock(ApplicationEventPublisher.class); - replay(publisher); - } - - @After - public void tearDown() { - verify(publisher); + publisher = mock(ApplicationEventPublisher.class); } @Test(expected=IllegalArgumentException.class) @@ -90,8 +84,9 @@ public class EventPublicationInterceptorTests { final TestListener listener = new TestListener(); class TestContext extends StaticApplicationContext { + @Override protected void onRefresh() throws BeansException { - addListener(listener); + addApplicationListener(listener); } } @@ -140,14 +135,17 @@ public class EventPublicationInterceptorTests { public static class FactoryBeanTestListener extends TestListener implements FactoryBean { + @Override public Object getObject() throws Exception { return "test"; } + @Override public Class getObjectType() { return String.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/context/event/LifecycleEventTests.java b/spring-context/src/test/java/org/springframework/context/event/LifecycleEventTests.java index b1bbb815acb..380f29125db 100644 --- a/spring-context/src/test/java/org/springframework/context/event/LifecycleEventTests.java +++ b/spring-context/src/test/java/org/springframework/context/event/LifecycleEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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,6 +71,7 @@ public class LifecycleEventTests extends TestCase { private int stoppedCount; + @Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextStartedEvent) { this.context = ((ContextStartedEvent) event).getApplicationContext(); @@ -100,14 +101,17 @@ public class LifecycleEventTests extends TestCase { private boolean running; + @Override public boolean isRunning() { return this.running; } + @Override public void start() { this.running = true; } + @Override public void stop() { this.running = false; } diff --git a/spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java b/spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java index cfd70979e98..17176f9dcd6 100644 --- a/spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java +++ b/spring-context/src/test/java/org/springframework/context/expression/ApplicationContextExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.apache.commons.logging.LogFactory; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -38,6 +38,8 @@ import org.springframework.beans.factory.support.AutowireCandidateQualifier; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.context.annotation.AnnotationConfigUtils; import org.springframework.context.support.GenericApplicationContext; import org.springframework.util.SerializationTestUtils; @@ -57,14 +59,18 @@ public class ApplicationContextExpressionTests { AnnotationConfigUtils.registerAnnotationConfigProcessors(ac); ac.getBeanFactory().registerScope("myScope", new Scope() { + @Override public Object get(String name, ObjectFactory objectFactory) { return objectFactory.getObject(); } + @Override public Object remove(String name) { return null; } + @Override public void registerDestructionCallback(String name, Runnable callback) { } + @Override public Object resolveContextualObject(String key) { if (key.equals("mySpecialAttr")) { return "42"; @@ -73,6 +79,7 @@ public class ApplicationContextExpressionTests { return null; } } + @Override public String getConversationId() { return null; } @@ -213,10 +220,8 @@ public class ApplicationContextExpressionTests { @Test public void prototypeCreationIsFastEnough() { - if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - // Skip this test: Trace logging blows the time limit. - return; - } + Assume.group(TestGroup.PERFORMANCE); + Assume.notLogging(factoryLog); GenericApplicationContext ac = new GenericApplicationContext(); RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class); rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE); diff --git a/spring-context/src/test/java/org/springframework/context/expression/EnvironmentAccessorIntegrationTests.java b/spring-context/src/test/java/org/springframework/context/expression/EnvironmentAccessorIntegrationTests.java index 4dda9faf6c6..152cf5d758d 100644 --- a/spring-context/src/test/java/org/springframework/context/expression/EnvironmentAccessorIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/context/expression/EnvironmentAccessorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.GenericApplicationContext; import org.springframework.mock.env.MockPropertySource; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** diff --git a/spring-context/src/test/java/org/springframework/context/support/Assembler.java b/spring-context/src/test/java/org/springframework/context/support/Assembler.java index 60df14aeb85..26c750cff6d 100644 --- a/spring-context/src/test/java/org/springframework/context/support/Assembler.java +++ b/spring-context/src/test/java/org/springframework/context/support/Assembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/AutowiredService.java b/spring-context/src/test/java/org/springframework/context/support/AutowiredService.java index 3ab4a12d959..d7592088c72 100644 --- a/spring-context/src/test/java/org/springframework/context/support/AutowiredService.java +++ b/spring-context/src/test/java/org/springframework/context/support/AutowiredService.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/BeanFactoryPostProcessorTests.java b/spring-context/src/test/java/org/springframework/context/support/BeanFactoryPostProcessorTests.java index 2e36dde141e..152ecfb6ecd 100644 --- a/spring-context/src/test/java/org/springframework/context/support/BeanFactoryPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/BeanFactoryPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.*; import org.junit.Test; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; @@ -104,6 +104,7 @@ public class BeanFactoryPostProcessorTests { public boolean wasCalled = false; + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { wasCalled = true; } diff --git a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resource.xml b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resource.xml index e339891102f..6c959877127 100644 --- a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resource.xml +++ b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resource.xml @@ -5,7 +5,7 @@ - + classpath:org/springframework/beans/factory/xml/test.properties diff --git a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resourceImport.xml b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resourceImport.xml index 717148bc4c2..232374bd0ed 100644 --- a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resourceImport.xml +++ b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests-resourceImport.xml @@ -3,7 +3,7 @@ - + test.properties diff --git a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java index 68ddae1f8c2..7ff83e35eae 100644 --- a/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -30,7 +30,7 @@ import java.util.Map; import org.junit.Test; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ResourceTestBean; +import org.springframework.tests.sample.beans.ResourceTestBean; import org.springframework.beans.TypeMismatchException; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanFactoryUtils; @@ -320,6 +320,7 @@ public final class ClassPathXmlApplicationContextTests { @Test public void testResourceAndInputStream() throws IOException { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(RESOURCE_CONTEXT) { + @Override public Resource getResource(String location) { if (TEST_PROPERTIES.equals(location)) { return new ClassPathResource(TEST_PROPERTIES, ClassPathXmlApplicationContextTests.class); diff --git a/spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java index 34588e19a7a..676ff05a305 100644 --- a/spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import java.util.Set; import org.junit.Test; -import org.springframework.beans.ResourceTestBean; +import org.springframework.tests.sample.beans.ResourceTestBean; import org.springframework.context.ApplicationContext; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; @@ -54,14 +54,17 @@ public class ConversionServiceFactoryBeanTests { ConversionServiceFactoryBean factory = new ConversionServiceFactoryBean(); Set converters = new HashSet(); converters.add(new Converter() { + @Override public Foo convert(String source) { return new Foo(); } }); converters.add(new ConverterFactory() { + @Override public Converter getConverter(Class targetType) { return new Converter () { @SuppressWarnings("unchecked") + @Override public T convert(String source) { return (T) new Bar(); } @@ -69,9 +72,11 @@ public class ConversionServiceFactoryBeanTests { } }); converters.add(new GenericConverter() { + @Override public Set getConvertibleTypes() { return Collections.singleton(new ConvertiblePair(String.class, Baz.class)); } + @Override public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { return new Baz(); } diff --git a/spring-context/src/test/java/org/springframework/context/support/DefaultLifecycleProcessorTests.java b/spring-context/src/test/java/org/springframework/context/support/DefaultLifecycleProcessorTests.java index a561e2cbf38..86c960f82f6 100644 --- a/spring-context/src/test/java/org/springframework/context/support/DefaultLifecycleProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/DefaultLifecycleProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,6 @@ package org.springframework.context.support; import java.util.concurrent.CopyOnWriteArrayList; import org.junit.Test; - import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.BeanDefinition; @@ -27,6 +26,8 @@ import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.Lifecycle; import org.springframework.context.LifecycleProcessor; import org.springframework.context.SmartLifecycle; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import static org.junit.Assert.*; @@ -251,6 +252,8 @@ public class DefaultLifecycleProcessorTests { @Test public void smartLifecycleGroupShutdown() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CopyOnWriteArrayList stoppedBeans = new CopyOnWriteArrayList(); TestSmartLifecycleBean bean1 = TestSmartLifecycleBean.forShutdownTests(1, 300, stoppedBeans); TestSmartLifecycleBean bean2 = TestSmartLifecycleBean.forShutdownTests(3, 100, stoppedBeans); @@ -280,6 +283,8 @@ public class DefaultLifecycleProcessorTests { @Test public void singleSmartLifecycleShutdown() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CopyOnWriteArrayList stoppedBeans = new CopyOnWriteArrayList(); TestSmartLifecycleBean bean = TestSmartLifecycleBean.forShutdownTests(99, 300, stoppedBeans); StaticApplicationContext context = new StaticApplicationContext(); @@ -386,6 +391,8 @@ public class DefaultLifecycleProcessorTests { @Test public void dependentShutdownFirstEvenIfItsPhaseIsLower() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CopyOnWriteArrayList stoppedBeans = new CopyOnWriteArrayList(); TestSmartLifecycleBean beanMin = TestSmartLifecycleBean.forShutdownTests(Integer.MIN_VALUE, 100, stoppedBeans); TestSmartLifecycleBean bean1 = TestSmartLifecycleBean.forShutdownTests(1, 200, stoppedBeans); @@ -458,6 +465,8 @@ public class DefaultLifecycleProcessorTests { @Test public void dependentShutdownFirstAndIsSmartLifecycle() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CopyOnWriteArrayList stoppedBeans = new CopyOnWriteArrayList(); TestSmartLifecycleBean beanMin = TestSmartLifecycleBean.forShutdownTests(Integer.MIN_VALUE, 400, stoppedBeans); TestSmartLifecycleBean beanNegative = TestSmartLifecycleBean.forShutdownTests(-99, 100, stoppedBeans); @@ -521,6 +530,8 @@ public class DefaultLifecycleProcessorTests { @Test public void dependentShutdownFirstButNotSmartLifecycle() throws Exception { + Assume.group(TestGroup.PERFORMANCE); + CopyOnWriteArrayList stoppedBeans = new CopyOnWriteArrayList(); TestSmartLifecycleBean bean1 = TestSmartLifecycleBean.forShutdownTests(1, 200, stoppedBeans); TestLifecycleBean simpleBean = TestLifecycleBean.forShutdownTests(stoppedBeans); @@ -585,10 +596,12 @@ public class DefaultLifecycleProcessorTests { this.stoppedBeans = stoppedBeans; } + @Override public boolean isRunning() { return this.running; } + @Override public void start() { if (this.startedBeans != null) { this.startedBeans.add(this); @@ -596,6 +609,7 @@ public class DefaultLifecycleProcessorTests { this.running = true; } + @Override public void stop() { if (this.stoppedBeans != null) { this.stoppedBeans.add(this); @@ -627,10 +641,12 @@ public class DefaultLifecycleProcessorTests { this.shutdownDelay = shutdownDelay; } + @Override public int getPhase() { return this.phase; } + @Override public boolean isAutoStartup() { return this.autoStartup; } @@ -639,12 +655,14 @@ public class DefaultLifecycleProcessorTests { this.autoStartup = autoStartup; } + @Override public void stop(final Runnable callback) { // calling stop() before the delay to preserve // invocation order in the 'stoppedBeans' list stop(); final int delay = this.shutdownDelay; new Thread(new Runnable() { + @Override public void run() { try { Thread.sleep(delay); @@ -665,27 +683,33 @@ public class DefaultLifecycleProcessorTests { public boolean running = false; + @Override public boolean isAutoStartup() { return true; } + @Override public void stop(Runnable callback) { this.running = false; callback.run(); } + @Override public void start() { this.running = true; } + @Override public void stop() { this.running = false; } + @Override public boolean isRunning() { return this.running; } + @Override public int getPhase() { return 0; } @@ -698,39 +722,48 @@ public class DefaultLifecycleProcessorTests { DummySmartLifecycleBean bean = new DummySmartLifecycleBean(); + @Override public Object getObject() throws Exception { return this.bean; } + @Override public Class getObjectType() { return DummySmartLifecycleBean.class; } + @Override public boolean isSingleton() { return true; } + @Override public boolean isAutoStartup() { return true; } + @Override public void stop(Runnable callback) { this.running = false; callback.run(); } + @Override public void start() { this.running = true; } + @Override public void stop() { this.running = false; } + @Override public boolean isRunning() { return this.running; } + @Override public int getPhase() { return 0; } diff --git a/spring-context/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java b/spring-context/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java index a545e69e688..cd68925cc97 100644 --- a/spring-context/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java +++ b/spring-context/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java @@ -10,18 +10,22 @@ import org.springframework.context.ApplicationListener; */ public class FactoryBeanAndApplicationListener implements FactoryBean, ApplicationListener { + @Override public String getObject() throws Exception { return ""; } + @Override public Class getObjectType() { return String.class; } + @Override public boolean isSingleton() { return true; } + @Override public void onApplicationEvent(ApplicationEvent event) { } diff --git a/spring-context/src/test/java/org/springframework/context/support/LifecycleTestBean.java b/spring-context/src/test/java/org/springframework/context/support/LifecycleTestBean.java index 44dcf38bd68..450a7291a5e 100644 --- a/spring-context/src/test/java/org/springframework/context/support/LifecycleTestBean.java +++ b/spring-context/src/test/java/org/springframework/context/support/LifecycleTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -43,15 +43,18 @@ public class LifecycleTestBean implements Lifecycle { return stopOrder; } + @Override public boolean isRunning() { return this.running; } + @Override public void start() { this.startOrder = ++startCounter; this.running = true; } + @Override public void stop() { this.stopOrder = ++stopCounter; this.running = false; diff --git a/spring-context/src/test/java/org/springframework/context/support/Logic.java b/spring-context/src/test/java/org/springframework/context/support/Logic.java index 325ebc10a48..79daad0e297 100644 --- a/spring-context/src/test/java/org/springframework/context/support/Logic.java +++ b/spring-context/src/test/java/org/springframework/context/support/Logic.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ public class Logic implements BeanNameAware { /* (non-Javadoc) * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) */ + @Override public void setBeanName(String name) { this.name = name; } diff --git a/spring-context/src/test/java/org/springframework/context/support/NoOpAdvice.java b/spring-context/src/test/java/org/springframework/context/support/NoOpAdvice.java index 68f1ce529c4..9b4c7ec1079 100644 --- a/spring-context/src/test/java/org/springframework/context/support/NoOpAdvice.java +++ b/spring-context/src/test/java/org/springframework/context/support/NoOpAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java b/spring-context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java index e3f9ada36f0..24185526d6c 100644 --- a/spring-context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import java.io.FileNotFoundException; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; diff --git a/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java b/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java index bfb2adc69af..078b1169790 100644 --- a/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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,7 +36,7 @@ import org.springframework.core.io.Resource; import org.springframework.mock.env.MockEnvironment; import org.springframework.mock.env.MockPropertySource; -import test.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Unit tests for {@link PropertySourcesPlaceholderConfigurer}. diff --git a/spring-context/src/test/java/org/springframework/context/support/ResourceConverter.java b/spring-context/src/test/java/org/springframework/context/support/ResourceConverter.java index f5834e8e6f6..3e30e569cc5 100644 --- a/spring-context/src/test/java/org/springframework/context/support/ResourceConverter.java +++ b/spring-context/src/test/java/org/springframework/context/support/ResourceConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ import org.springframework.core.io.Resource; */ public class ResourceConverter implements Converter { + @Override public Resource convert(String source) { return new FileSystemResource(source + ".xml"); } diff --git a/spring-context/src/test/java/org/springframework/context/support/Service.java b/spring-context/src/test/java/org/springframework/context/support/Service.java index 8778978bd80..ee9d5095d74 100644 --- a/spring-context/src/test/java/org/springframework/context/support/Service.java +++ b/spring-context/src/test/java/org/springframework/context/support/Service.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -40,10 +40,12 @@ public class Service implements ApplicationContextAware, MessageSourceAware, Dis private boolean properlyDestroyed = false; + @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; } + @Override public void setMessageSource(MessageSource messageSource) { if (this.messageSource != null) { throw new IllegalArgumentException("MessageSource should not be set twice"); @@ -64,9 +66,11 @@ public class Service implements ApplicationContextAware, MessageSourceAware, Dis } + @Override public void destroy() { this.properlyDestroyed = true; Thread thread = new Thread() { + @Override public void run() { Assert.isTrue(applicationContext.getBean("messageSource") instanceof StaticMessageSource); try { diff --git a/spring-context/src/test/java/org/springframework/context/support/SimpleThreadScopeTest.java b/spring-context/src/test/java/org/springframework/context/support/SimpleThreadScopeTest.java index 01d95795fa5..887c6fc1cc1 100644 --- a/spring-context/src/test/java/org/springframework/context/support/SimpleThreadScopeTest.java +++ b/spring-context/src/test/java/org/springframework/context/support/SimpleThreadScopeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; /** @@ -49,11 +49,13 @@ public class SimpleThreadScopeTest { public void getMultipleInstances() throws Exception { final TestBean[] beans = new TestBean[2]; Thread thread1 = new Thread(new Runnable() { + @Override public void run() { beans[0] = applicationContext.getBean("threadScopedObject", TestBean.class); } }); Thread thread2 = new Thread(new Runnable() { + @Override public void run() { beans[1] = applicationContext.getBean("threadScopedObject", TestBean.class); } diff --git a/spring-context/src/test/java/org/springframework/context/support/Spr7283Tests.java b/spring-context/src/test/java/org/springframework/context/support/Spr7283Tests.java index 73c189e36e5..6d82d77d88b 100644 --- a/spring-context/src/test/java/org/springframework/context/support/Spr7283Tests.java +++ b/spring-context/src/test/java/org/springframework/context/support/Spr7283Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/Spr7816Tests.java b/spring-context/src/test/java/org/springframework/context/support/Spr7816Tests.java index 9c7e9a2319b..6fb17f353b3 100644 --- a/spring-context/src/test/java/org/springframework/context/support/Spr7816Tests.java +++ b/spring-context/src/test/java/org/springframework/context/support/Spr7816Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java b/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java index 9ac74335896..b1f9d24ecd6 100644 --- a/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import java.util.Locale; import java.util.Map; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader; import org.springframework.context.ACATester; import org.springframework.context.AbstractApplicationContextTests; @@ -43,6 +43,7 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio protected StaticApplicationContext sac; /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext(); Map m = new HashMap(); @@ -53,7 +54,7 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio parent.registerSingleton(StaticApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, TestApplicationEventMulticaster.class, null); parent.refresh(); - parent.addListener(parentListener) ; + parent.addApplicationListener(parentListener) ; parent.getStaticMessageSource().addMessage("code1", Locale.getDefault(), "message1"); @@ -65,7 +66,7 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio Resource resource = new ClassPathResource("testBeans.properties", getClass()); reader.loadBeanDefinitions(new EncodedResource(resource, "ISO-8859-1")); sac.refresh(); - sac.addListener(listener); + sac.addApplicationListener(listener); sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2"); @@ -73,10 +74,12 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio } /** Overridden */ + @Override public void testCount() { assertCount(15); } + @Override public void testEvents() throws Exception { TestApplicationEventMulticaster.counter = 0; super.testEvents(); @@ -88,6 +91,7 @@ public class StaticApplicationContextMulticasterTests extends AbstractApplicatio private static int counter = 0; + @Override public void multicastEvent(ApplicationEvent event) { super.multicastEvent(event); counter++; diff --git a/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java index 2dba7fc9eac..bba7f776685 100644 --- a/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import java.util.Locale; import java.util.Map; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader; import org.springframework.context.ACATester; import org.springframework.context.AbstractApplicationContextTests; @@ -39,6 +39,7 @@ public class StaticApplicationContextTests extends AbstractApplicationContextTes protected StaticApplicationContext sac; /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext(); Map m = new HashMap(); @@ -47,7 +48,7 @@ public class StaticApplicationContextTests extends AbstractApplicationContextTes m.put("name", "Albert"); parent.registerPrototype("father", TestBean.class, new MutablePropertyValues(m)); parent.refresh(); - parent.addListener(parentListener) ; + parent.addApplicationListener(parentListener) ; parent.getStaticMessageSource().addMessage("code1", Locale.getDefault(), "message1"); @@ -58,7 +59,7 @@ public class StaticApplicationContextTests extends AbstractApplicationContextTes PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory()); reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass())); sac.refresh(); - sac.addListener(listener); + sac.addApplicationListener(listener); sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2"); @@ -66,6 +67,7 @@ public class StaticApplicationContextTests extends AbstractApplicationContextTes } /** Overridden */ + @Override public void testCount() { assertCount(15); } diff --git a/spring-context/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java b/spring-context/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java index 73d0cab6517..908f5652c12 100644 --- a/spring-context/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -49,11 +49,13 @@ public class StaticMessageSourceTests extends AbstractApplicationContextTests { protected StaticApplicationContext sac; /** Overridden */ + @Override public void testCount() { // These are only checked for current Ctx (not parent ctx) assertCount(15); } + @Override public void testMessageSource() throws NoSuchMessageException { // Do nothing here since super is looking for errorCodes we // do NOT have in the Context @@ -195,17 +197,18 @@ public class StaticMessageSourceTests extends AbstractApplicationContextTests { } /** Run for each test */ + @Override protected ConfigurableApplicationContext createContext() throws Exception { StaticApplicationContext parent = new StaticApplicationContext(); Map m = new HashMap(); m.put("name", "Roderick"); - parent.registerPrototype("rod", org.springframework.beans.TestBean.class, new MutablePropertyValues(m)); + parent.registerPrototype("rod", org.springframework.tests.sample.beans.TestBean.class, new MutablePropertyValues(m)); m.put("name", "Albert"); - parent.registerPrototype("father", org.springframework.beans.TestBean.class, new MutablePropertyValues(m)); + parent.registerPrototype("father", org.springframework.tests.sample.beans.TestBean.class, new MutablePropertyValues(m)); parent.refresh(); - parent.addListener(parentListener); + parent.addApplicationListener(parentListener); this.sac = new StaticApplicationContext(parent); @@ -218,7 +221,7 @@ public class StaticMessageSourceTests extends AbstractApplicationContextTests { PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory()); reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass())); sac.refresh(); - sac.addListener(listener); + sac.addApplicationListener(listener); StaticMessageSource messageSource = sac.getStaticMessageSource(); Map usMessages = new HashMap(3); diff --git a/spring-context/src/test/java/org/springframework/context/support/TestIF.java b/spring-context/src/test/java/org/springframework/context/support/TestIF.java index 7ee7a9c0069..5ce3da22d0d 100644 --- a/spring-context/src/test/java/org/springframework/context/support/TestIF.java +++ b/spring-context/src/test/java/org/springframework/context/support/TestIF.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java b/spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java index 0fa4b0e392e..f51d024715b 100644 --- a/spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java +++ b/spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java @@ -28,6 +28,7 @@ public class TestProxyFactoryBean extends AbstractSingletonProxyFactoryBean impl return new NoOpAdvice(); } + @Override public void setBeanFactory(BeanFactory beanFactory) { } diff --git a/spring-context/src/test/java/org/springframework/context/support/conversionService.xml b/spring-context/src/test/java/org/springframework/context/support/conversionService.xml index 57c2b5c8af0..bcfae1cdb55 100644 --- a/spring-context/src/test/java/org/springframework/context/support/conversionService.xml +++ b/spring-context/src/test/java/org/springframework/context/support/conversionService.xml @@ -5,7 +5,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml b/spring-context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml index 5e407ee0be0..5ddcbab67d4 100644 --- a/spring-context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml +++ b/spring-context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml @@ -9,7 +9,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/context/support/testBeans.properties b/spring-context/src/test/java/org/springframework/context/support/testBeans.properties index 1eab846bc5e..6b9c028005b 100644 --- a/spring-context/src/test/java/org/springframework/context/support/testBeans.properties +++ b/spring-context/src/test/java/org/springframework/context/support/testBeans.properties @@ -1,42 +1,42 @@ # this must only be used for ApplicationContexts, some classes are only appropriate for application contexts -rod.(class)=org.springframework.beans.TestBean +rod.(class)=org.springframework.tests.sample.beans.TestBean rod.name=Rod rod.age=31 roderick.(parent)=rod roderick.name=Roderick -kerry.(class)=org.springframework.beans.TestBean +kerry.(class)=org.springframework.tests.sample.beans.TestBean kerry.name=Kerry kerry.age=34 kerry.spouse(ref)=rod -kathy.(class)=org.springframework.beans.TestBean +kathy.(class)=org.springframework.tests.sample.beans.TestBean kathy.(singleton)=false -typeMismatch.(class)=org.springframework.beans.TestBean +typeMismatch.(class)=org.springframework.tests.sample.beans.TestBean typeMismatch.name=typeMismatch typeMismatch.age=34x typeMismatch.spouse(ref)=rod typeMismatch.(singleton)=false -validEmpty.(class)=org.springframework.beans.TestBean +validEmpty.(class)=org.springframework.tests.sample.beans.TestBean -listenerVeto.(class)=org.springframework.beans.TestBean +listenerVeto.(class)=org.springframework.tests.sample.beans.TestBean typeMismatch.name=typeMismatch typeMismatch.age=34x typeMismatch.spouse(ref)=rod -singletonFactory.(class)=org.springframework.beans.factory.DummyFactory +singletonFactory.(class)=org.springframework.tests.sample.beans.factory.DummyFactory singletonFactory.singleton=true -prototypeFactory.(class)=org.springframework.beans.factory.DummyFactory +prototypeFactory.(class)=org.springframework.tests.sample.beans.factory.DummyFactory prototypeFactory.singleton=false -mustBeInitialized.(class)=org.springframework.beans.factory.MustBeInitialized +mustBeInitialized.(class)=org.springframework.tests.sample.beans.MustBeInitialized lifecycle.(class)=org.springframework.context.LifecycleContextBean -lifecyclePostProcessor.(class)=org.springframework.beans.factory.LifecycleBean$PostProcessor +lifecyclePostProcessor.(class)=org.springframework.tests.sample.beans.LifecycleBean$PostProcessor diff --git a/spring-context/src/test/java/org/springframework/core/task/NoOpRunnable.java b/spring-context/src/test/java/org/springframework/core/task/NoOpRunnable.java index acec31ff7c1..0dd6ce2cf21 100644 --- a/spring-context/src/test/java/org/springframework/core/task/NoOpRunnable.java +++ b/spring-context/src/test/java/org/springframework/core/task/NoOpRunnable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ package org.springframework.core.task; */ public class NoOpRunnable implements Runnable { + @Override public void run() { // explicit no-op System.out.println("Running"); diff --git a/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java b/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java index bcfc34c71b9..b8206b21a28 100644 --- a/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,10 @@ package org.springframework.ejb.access; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import javax.ejb.CreateException; import javax.ejb.EJBLocalHome; @@ -41,15 +43,14 @@ public class LocalSlsbInvokerInterceptorTests { */ @Test public void testPerformsLookup() throws Exception { - LocalInterfaceWithBusinessMethods ejb = createMock(LocalInterfaceWithBusinessMethods.class); - replay(ejb); + LocalInterfaceWithBusinessMethods ejb = mock(LocalInterfaceWithBusinessMethods.class); String jndiName= "foobar"; Context mockContext = mockContext(jndiName, ejb); configuredInterceptor(mockContext, jndiName); - verify(mockContext); + verify(mockContext).close(); } @Test @@ -57,6 +58,7 @@ public class LocalSlsbInvokerInterceptorTests { final NamingException nex = new NamingException(); final String jndiName= "foobar"; JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { assertTrue(jndiName.equals(name)); throw nex; @@ -80,10 +82,8 @@ public class LocalSlsbInvokerInterceptorTests { @Test public void testInvokesMethodOnEjbInstance() throws Exception { Object retVal = new Object(); - LocalInterfaceWithBusinessMethods ejb = createMock(LocalInterfaceWithBusinessMethods.class); - expect(ejb.targetMethod()).andReturn(retVal); - ejb.remove(); - replay(ejb); + LocalInterfaceWithBusinessMethods ejb = mock(LocalInterfaceWithBusinessMethods.class); + given(ejb.targetMethod()).willReturn(retVal); String jndiName= "foobar"; Context mockContext = mockContext(jndiName, ejb); @@ -96,17 +96,15 @@ public class LocalSlsbInvokerInterceptorTests { assertTrue(target.targetMethod() == retVal); - verify(mockContext); - verify(ejb); + verify(mockContext).close(); + verify(ejb).remove(); } @Test public void testInvokesMethodOnEjbInstanceWithSeparateBusinessMethods() throws Exception { Object retVal = new Object(); - LocalInterface ejb = createMock(LocalInterface.class); - expect(ejb.targetMethod()).andReturn(retVal); - ejb.remove(); - replay(ejb); + LocalInterface ejb = mock(LocalInterface.class); + given(ejb.targetMethod()).willReturn(retVal); String jndiName= "foobar"; Context mockContext = mockContext(jndiName, ejb); @@ -119,14 +117,13 @@ public class LocalSlsbInvokerInterceptorTests { assertTrue(target.targetMethod() == retVal); - verify(mockContext); - verify(ejb); + verify(mockContext).close(); + verify(ejb).remove(); } private void testException(Exception expected) throws Exception { - LocalInterfaceWithBusinessMethods ejb = createMock(LocalInterfaceWithBusinessMethods.class); - expect(ejb.targetMethod()).andThrow(expected); - replay(ejb); + LocalInterfaceWithBusinessMethods ejb = mock(LocalInterfaceWithBusinessMethods.class); + given(ejb.targetMethod()).willThrow(expected); String jndiName= "foobar"; Context mockContext = mockContext(jndiName, ejb); @@ -145,8 +142,7 @@ public class LocalSlsbInvokerInterceptorTests { assertTrue(thrown == expected); } - verify(mockContext); - verify(ejb); + verify(mockContext).close(); } @Test @@ -156,16 +152,10 @@ public class LocalSlsbInvokerInterceptorTests { protected Context mockContext(final String jndiName, final Object ejbInstance) throws Exception { - - final SlsbHome mockHome = createMock(SlsbHome.class); - expect(mockHome.create()).andReturn((LocalInterface)ejbInstance); - replay(mockHome); - - final Context mockCtx = createMock(Context.class); - - expect(mockCtx.lookup("java:comp/env/" + jndiName)).andReturn(mockHome); - mockCtx.close(); - replay(mockCtx); + SlsbHome mockHome = mock(SlsbHome.class); + given(mockHome.create()).willReturn((LocalInterface)ejbInstance); + Context mockCtx = mock(Context.class); + given(mockCtx.lookup("java:comp/env/" + jndiName)).willReturn(mockHome); return mockCtx; } @@ -174,6 +164,7 @@ public class LocalSlsbInvokerInterceptorTests { LocalSlsbInvokerInterceptor si = new LocalSlsbInvokerInterceptor(); si.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() throws NamingException { return mockCtx; } diff --git a/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java index c2c9e07aaaf..c0a78215bd6 100644 --- a/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,11 @@ package org.springframework.ejb.access; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; import java.lang.reflect.Proxy; @@ -42,16 +45,14 @@ public class LocalStatelessSessionProxyFactoryBeanTests { final int value = 11; final String jndiName = "foo"; - MyEjb myEjb = createMock(MyEjb.class); - expect(myEjb.getValue()).andReturn(value); - myEjb.remove(); - replay(myEjb); + MyEjb myEjb = mock(MyEjb.class); + given(myEjb.getValue()).willReturn(value); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andReturn(myEjb); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willReturn(myEjb); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -71,8 +72,7 @@ public class LocalStatelessSessionProxyFactoryBeanTests { MyBusinessMethods mbm = (MyBusinessMethods) fb.getObject(); assertTrue(Proxy.isProxyClass(mbm.getClass())); assertTrue(mbm.getValue() == value); - verify(myEjb); - verify(home); + verify(myEjb).remove(); } @Test @@ -80,11 +80,11 @@ public class LocalStatelessSessionProxyFactoryBeanTests { final int value = 11; final String jndiName = "foo"; - final MyEjb myEjb = createMock(MyEjb.class); - expect(myEjb.getValue()).andReturn(value); - replay(myEjb); + final MyEjb myEjb = mock(MyEjb.class); + given(myEjb.getValue()).willReturn(value); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -104,7 +104,6 @@ public class LocalStatelessSessionProxyFactoryBeanTests { MyBusinessMethods mbm = (MyBusinessMethods) fb.getObject(); assertTrue(Proxy.isProxyClass(mbm.getClass())); assertTrue(mbm.getValue() == value); - verify(myEjb); } @Test @@ -112,11 +111,11 @@ public class LocalStatelessSessionProxyFactoryBeanTests { final String jndiName = "foo"; final CreateException cex = new CreateException(); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andThrow(cex); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willThrow(cex); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals(jndiName)); @@ -144,8 +143,6 @@ public class LocalStatelessSessionProxyFactoryBeanTests { catch (EjbAccessException ex) { assertSame(cex, ex.getCause()); } - - verify(home); } @Test @@ -154,10 +151,10 @@ public class LocalStatelessSessionProxyFactoryBeanTests { // Could actually try to figure out interface from create? final String jndiName = "foo"; - final MyHome home = createMock(MyHome.class); - replay(home); + final MyHome home = mock(MyHome.class); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -184,7 +181,7 @@ public class LocalStatelessSessionProxyFactoryBeanTests { } // Expect no methods on home - verify(home); + verifyZeroInteractions(home); } diff --git a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java index a48935c47c2..c0fa18c2c33 100644 --- a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,12 @@ package org.springframework.ejb.access; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import java.rmi.ConnectException; import java.rmi.RemoteException; @@ -41,20 +45,12 @@ import org.springframework.remoting.RemoteAccessException; public class SimpleRemoteSlsbInvokerInterceptorTests { private Context mockContext( - String jndiName, RemoteInterface ejbInstance, int createCount, int lookupCount, int closeCount) + String jndiName, RemoteInterface ejbInstance) throws Exception { - - final SlsbHome mockHome = createMock(SlsbHome.class); - expect(mockHome.create()).andReturn(ejbInstance).times(createCount); - replay(mockHome); - - final Context mockCtx = createMock(Context.class); - - expect(mockCtx.lookup("java:comp/env/" + jndiName)).andReturn(mockHome).times(lookupCount); - mockCtx.close(); - expectLastCall().times(closeCount); - replay(mockCtx); - + SlsbHome mockHome = mock(SlsbHome.class); + given(mockHome.create()).willReturn(ejbInstance); + Context mockCtx = mock(Context.class); + given(mockCtx.lookup("java:comp/env/" + jndiName)).willReturn(mockHome); return mockCtx; } @@ -63,6 +59,7 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { SimpleRemoteSlsbInvokerInterceptor si = createInterceptor(); si.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() { return mockCtx; } @@ -87,33 +84,32 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { @Test public void testPerformsLookup() throws Exception { - RemoteInterface ejb = createMock(RemoteInterface.class); - replay(ejb); + RemoteInterface ejb = mock(RemoteInterface.class); String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); configuredProxy(si, RemoteInterface.class); - verify(mockContext); + verify(mockContext).close(); } @Test public void testPerformsLookupWithAccessContext() throws Exception { - RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andReturn(null); - replay(ejb); + RemoteInterface ejb = mock(RemoteInterface.class); String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 2); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); si.setExposeAccessContext(true); RemoteInterface target = (RemoteInterface) configuredProxy(si, RemoteInterface.class); assertNull(target.targetMethod()); - verify(mockContext); + verify(mockContext, times(2)).close(); + verify(ejb).targetMethod(); + } @Test @@ -121,6 +117,7 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { final NamingException nex = new NamingException(); final String jndiName = "foobar"; JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { assertTrue(jndiName.equals(name)); throw nex; @@ -163,10 +160,8 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { private void doTestInvokesMethodOnEjbInstance(boolean lookupHomeOnStartup, boolean cacheHome) throws Exception { Object retVal = new Object(); - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andReturn(retVal).times(2); - ejb.remove(); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willReturn(retVal); int lookupCount = 1; if (!cacheHome) { @@ -177,7 +172,7 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { } final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 2, lookupCount, lookupCount); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); si.setLookupHomeOnStartup(lookupHomeOnStartup); @@ -187,19 +182,18 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { assertTrue(target.targetMethod() == retVal); assertTrue(target.targetMethod() == retVal); - verify(mockContext, ejb); + verify(mockContext, times(lookupCount)).close(); + verify(ejb, times(2)).remove(); } @Test public void testInvokesMethodOnEjbInstanceWithHomeInterface() throws Exception { Object retVal = new Object(); - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andReturn(retVal); - ejb.remove(); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willReturn(retVal); final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); si.setHomeInterface(SlsbHome.class); @@ -207,18 +201,18 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { RemoteInterface target = (RemoteInterface) configuredProxy(si, RemoteInterface.class); assertTrue(target.targetMethod() == retVal); - verify(mockContext, ejb); + verify(mockContext).close(); + verify(ejb).remove(); } @Test public void testInvokesMethodOnEjbInstanceWithRemoteException() throws Exception { - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andThrow(new RemoteException()); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willThrow(new RemoteException()); ejb.remove(); - replay(ejb); final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); @@ -231,7 +225,8 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { // expected } - verify(mockContext, ejb); + verify(mockContext).close(); + verify(ejb, times(2)).remove(); } @Test @@ -257,11 +252,8 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { private void doTestInvokesMethodOnEjbInstanceWithConnectExceptionWithRefresh( boolean lookupHomeOnStartup, boolean cacheHome) throws Exception { - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andThrow(new ConnectException("")).times(2); - ejb.remove(); - expectLastCall().times(2); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willThrow(new ConnectException("")); int lookupCount = 2; if (!cacheHome) { @@ -272,7 +264,7 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { } final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 2, lookupCount, lookupCount); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); si.setRefreshHomeOnConnectFailure(true); @@ -288,37 +280,35 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { // expected } - verify(mockContext, ejb); + verify(mockContext, times(lookupCount)).close(); + verify(ejb, times(2)).remove(); } @Test public void testInvokesMethodOnEjbInstanceWithBusinessInterface() throws Exception { Object retVal = new Object(); - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andReturn(retVal); - ejb.remove(); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willReturn(retVal); final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); BusinessInterface target = (BusinessInterface) configuredProxy(si, BusinessInterface.class); assertTrue(target.targetMethod() == retVal); - verify(mockContext, ejb); + verify(mockContext).close(); + verify(ejb).remove(); } @Test public void testInvokesMethodOnEjbInstanceWithBusinessInterfaceWithRemoteException() throws Exception { - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andThrow(new RemoteException()); - ejb.remove(); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willThrow(new RemoteException()); final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); @@ -331,7 +321,8 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { // expected } - verify(mockContext, ejb); + verify(mockContext).close(); + verify(ejb).remove(); } @Test @@ -345,13 +336,11 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { } private void doTestException(Exception expected) throws Exception { - final RemoteInterface ejb = createMock(RemoteInterface.class); - expect(ejb.targetMethod()).andThrow(expected); - ejb.remove(); - replay(ejb); + final RemoteInterface ejb = mock(RemoteInterface.class); + given(ejb.targetMethod()).willThrow(expected); final String jndiName= "foobar"; - Context mockContext = mockContext(jndiName, ejb, 1, 1, 1); + Context mockContext = mockContext(jndiName, ejb); SimpleRemoteSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); @@ -364,7 +353,8 @@ public class SimpleRemoteSlsbInvokerInterceptorTests { assertTrue(thrown == expected); } - verify(mockContext, ejb); + verify(mockContext).close(); + verify(ejb).remove(); } diff --git a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java index 396d347b178..8e03115c1f3 100644 --- a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,11 @@ package org.springframework.ejb.access; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; import java.lang.reflect.Proxy; import java.rmi.RemoteException; @@ -38,10 +41,12 @@ import org.springframework.remoting.RemoteAccessException; */ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRemoteSlsbInvokerInterceptorTests { + @Override protected SimpleRemoteSlsbInvokerInterceptor createInterceptor() { return new SimpleRemoteStatelessSessionProxyFactoryBean(); } + @Override protected Object configuredProxy(SimpleRemoteSlsbInvokerInterceptor si, Class ifc) throws NamingException { SimpleRemoteStatelessSessionProxyFactoryBean fb = (SimpleRemoteStatelessSessionProxyFactoryBean) si; fb.setBusinessInterface(ifc); @@ -54,16 +59,14 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem final int value = 11; final String jndiName = "foo"; - MyEjb myEjb = createMock(MyEjb.class); - expect(myEjb.getValue()).andReturn(value); - myEjb.remove(); - replay(myEjb); + MyEjb myEjb = mock(MyEjb.class); + given(myEjb.getValue()).willReturn(value); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andReturn(myEjb); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willReturn(myEjb); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -83,8 +86,7 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem MyBusinessMethods mbm = (MyBusinessMethods) fb.getObject(); assertTrue(Proxy.isProxyClass(mbm.getClass())); assertEquals("Returns expected value", value, mbm.getValue()); - verify(myEjb); - verify(home); + verify(myEjb).remove(); } @Test @@ -92,11 +94,11 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem final int value = 11; final String jndiName = "foo"; - final MyEjb myEjb = createMock(MyEjb.class); - expect(myEjb.getValue()).andReturn(value); - replay(myEjb); + final MyEjb myEjb = mock(MyEjb.class); + given(myEjb.getValue()).willReturn(value); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -116,26 +118,24 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem MyBusinessMethods mbm = (MyBusinessMethods) fb.getObject(); assertTrue(Proxy.isProxyClass(mbm.getClass())); assertEquals("Returns expected value", value, mbm.getValue()); - verify(myEjb); } + @Override @Test public void testRemoteException() throws Exception { final RemoteException rex = new RemoteException(); final String jndiName = "foo"; - MyEjb myEjb = createMock(MyEjb.class); - expect(myEjb.getValue()).andThrow(rex); + MyEjb myEjb = mock(MyEjb.class); + given(myEjb.getValue()).willThrow(rex); // TODO might want to control this behaviour... // Do we really want to call remove after a remote exception? - myEjb.remove(); - replay(myEjb); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andReturn(myEjb); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willReturn(myEjb); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals("java:comp/env/" + jndiName)); @@ -161,8 +161,7 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem catch (RemoteException ex) { assertSame("Threw expected RemoteException", rex, ex); } - verify(myEjb); - verify(home); + verify(myEjb).remove(); } @Test @@ -170,11 +169,11 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem final String jndiName = "foo"; final CreateException cex = new CreateException(); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andThrow(cex); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willThrow(cex); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals(jndiName)); @@ -202,8 +201,6 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem catch (RemoteException ex) { // expected } - - verify(home); } @Test @@ -211,11 +208,11 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem final String jndiName = "foo"; final CreateException cex = new CreateException(); - final MyHome home = createMock(MyHome.class); - expect(home.create()).andThrow(cex); - replay(home); + final MyHome home = mock(MyHome.class); + given(home.create()).willThrow(cex); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) { // parameterize assertTrue(name.equals(jndiName)); @@ -243,8 +240,6 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem catch (RemoteAccessException ex) { assertTrue(ex.getCause() == cex); } - - verify(home); } @Test @@ -253,10 +248,10 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem // Could actually try to figure out interface from create? final String jndiName = "foo"; - final MyHome home = createMock(MyHome.class); - replay(home); + final MyHome home = mock(MyHome.class); JndiTemplate jt = new JndiTemplate() { + @Override public Object lookup(String name) throws NamingException { // parameterize assertTrue(name.equals(jndiName)); @@ -283,7 +278,7 @@ public class SimpleRemoteStatelessSessionProxyFactoryBeanTests extends SimpleRem } // Expect no methods on home - verify(home); + verifyZeroInteractions(home); } diff --git a/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerEventTests.java b/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerEventTests.java index d8c1aa13902..4eea7e81555 100644 --- a/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerEventTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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,11 +21,11 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.parsing.BeanComponentDefinition; -import org.springframework.beans.factory.parsing.CollectingReaderEventListener; import org.springframework.beans.factory.parsing.ComponentDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.beans.CollectingReaderEventListener; /** * @author Torsten Juergeleit diff --git a/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerTests.java b/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerTests.java index 1afb7000f3c..c2430271b43 100644 --- a/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/config/JeeNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.RuntimeBeanReference; @@ -125,7 +125,7 @@ public class JeeNamespaceHandlerTests { assertPropertyValue(beanDefinition, "lookupHomeOnStartup", "true"); assertPropertyValue(beanDefinition, "resourceRef", "true"); assertPropertyValue(beanDefinition, "jndiEnvironment", "foo=bar"); - assertPropertyValue(beanDefinition, "homeInterface", "org.springframework.beans.ITestBean"); + assertPropertyValue(beanDefinition, "homeInterface", "org.springframework.tests.sample.beans.ITestBean"); assertPropertyValue(beanDefinition, "refreshHomeOnConnectFailure", "true"); assertPropertyValue(beanDefinition, "cacheSessionBean", "true"); } diff --git a/spring-context/src/test/java/org/springframework/ejb/config/jeeNamespaceHandlerTests.xml b/spring-context/src/test/java/org/springframework/ejb/config/jeeNamespaceHandlerTests.xml index 6d1a3ddf833..e8767251a95 100644 --- a/spring-context/src/test/java/org/springframework/ejb/config/jeeNamespaceHandlerTests.xml +++ b/spring-context/src/test/java/org/springframework/ejb/config/jeeNamespaceHandlerTests.xml @@ -41,11 +41,11 @@ + business-interface="org.springframework.tests.sample.beans.ITestBean"/> @@ -54,15 +54,15 @@ + business-interface="org.springframework.tests.sample.beans.ITestBean"/> foo=bar @@ -71,8 +71,8 @@ + business-interface="org.springframework.tests.sample.beans.ITestBean" lazy-init="true" /> + business-interface="org.springframework.tests.sample.beans.ITestBean" lazy-init="true" /> diff --git a/spring-context/src/test/java/org/springframework/format/number/CurrencyFormatterTests.java b/spring-context/src/test/java/org/springframework/format/number/CurrencyFormatterTests.java index 4cb1bfdd589..68c5b598f98 100644 --- a/spring-context/src/test/java/org/springframework/format/number/CurrencyFormatterTests.java +++ b/spring-context/src/test/java/org/springframework/format/number/CurrencyFormatterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/format/number/NumberFormattingTests.java b/spring-context/src/test/java/org/springframework/format/number/NumberFormattingTests.java index 9d60580e5d4..9503e82067a 100644 --- a/spring-context/src/test/java/org/springframework/format/number/NumberFormattingTests.java +++ b/spring-context/src/test/java/org/springframework/format/number/NumberFormattingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -48,6 +48,7 @@ public class NumberFormattingTests { public void setUp() { DefaultConversionService.addDefaultConverters(conversionService); conversionService.setEmbeddedValueResolver(new StringValueResolver() { + @Override public String resolveStringValue(String strVal) { if ("${pattern}".equals(strVal)) { return "#,##.00"; diff --git a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java index a5c07dbe80c..ae9aa8be0e8 100644 --- a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -149,10 +149,12 @@ public class FormattingConversionServiceFactoryBeanTests { private static class TestBeanFormatter implements Formatter { + @Override public String print(TestBean object, Locale locale) { return String.valueOf(object.getSpecialInt()); } + @Override public TestBean parse(String text, Locale locale) throws ParseException { TestBean object = new TestBean(); object.setSpecialInt(Integer.parseInt(text)); @@ -169,20 +171,25 @@ public class FormattingConversionServiceFactoryBeanTests { fieldTypes.add(Integer.class); } + @Override public Set> getFieldTypes() { return fieldTypes; } + @Override public Printer getPrinter(SpecialInt annotation, Class fieldType) { return new Printer() { + @Override public String print(Integer object, Locale locale) { return ":" + object.toString(); } }; } + @Override public Parser getParser(SpecialInt annotation, Class fieldType) { return new Parser() { + @Override public Integer parse(String text, Locale locale) throws ParseException { return Integer.parseInt(text.substring(1)); } @@ -192,6 +199,7 @@ public class FormattingConversionServiceFactoryBeanTests { private static class TestFormatterRegistrar implements FormatterRegistrar { + @Override public void registerFormatters(FormatterRegistry registry) { registry.addFormatter(new TestBeanFormatter()); } diff --git a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java index c620be5b741..6b0fb87da7e 100644 --- a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java +++ b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java @@ -36,6 +36,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.ConfigurablePropertyAccessor; import org.springframework.beans.PropertyAccessorFactory; import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -86,6 +87,7 @@ public class FormattingConversionServiceTests { @Test public void testFormatFieldForTypeWithPrinterParserWithCoercion() throws ParseException { formattingService.addConverter(new Converter() { + @Override public LocalDate convert(DateTime source) { return source.toLocalDate(); } @@ -111,7 +113,9 @@ public class FormattingConversionServiceTests { @Test public void testFormatFieldForValueInjectionUsingMetaAnnotations() { AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(); - ac.registerBeanDefinition("valueBean", new RootBeanDefinition(MetaValueBean.class, false)); + RootBeanDefinition bd = new RootBeanDefinition(MetaValueBean.class); + bd.setScope(BeanDefinition.SCOPE_PROTOTYPE); + ac.registerBeanDefinition("valueBean", bd); ac.registerBeanDefinition("conversionService", new RootBeanDefinition(FormattingConversionServiceFactoryBean.class)); ac.registerBeanDefinition("ppc", new RootBeanDefinition(PropertyPlaceholderConfigurer.class)); ac.refresh(); @@ -170,11 +174,13 @@ public class FormattingConversionServiceTests { @SuppressWarnings("unchecked") private void doTestFormatFieldForAnnotation(Class modelClass, boolean directFieldAccess) throws Exception { formattingService.addConverter(new Converter() { + @Override public Long convert(Date source) { return source.getTime(); } }); formattingService.addConverter(new Converter() { + @Override public Date convert(DateTime source) { return source.toDate(); } @@ -277,17 +283,20 @@ public class FormattingConversionServiceTests { @Test public void testFormatFieldForAnnotationWithSubclassAsFieldType() throws Exception { formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory() { + @Override public Printer getPrinter(org.springframework.format.annotation.DateTimeFormat annotation, Class fieldType) { assertEquals(MyDate.class, fieldType); return super.getPrinter(annotation, fieldType); } }); formattingService.addConverter(new Converter() { + @Override public Long convert(MyDate source) { return source.getTime(); } }); formattingService.addConverter(new Converter() { + @Override public Date convert(MyDate source) { return source; } @@ -364,10 +373,12 @@ public class FormattingConversionServiceTests { public static class NullReturningFormatter implements Formatter { + @Override public String print(Integer object, Locale locale) { return null; } + @Override public Integer parse(String text, Locale locale) throws ParseException { return null; } diff --git a/spring-context/src/test/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaverTests.java b/spring-context/src/test/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaverTests.java index 09644b02c0e..f39f28b40cf 100644 --- a/spring-context/src/test/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaverTests.java +++ b/spring-context/src/test/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -46,6 +46,7 @@ public final class ReflectiveLoadTimeWeaverTests { JustAddTransformerClassLoader classLoader = new JustAddTransformerClassLoader(); ReflectiveLoadTimeWeaver weaver = new ReflectiveLoadTimeWeaver(classLoader); weaver.addTransformer(new ClassFileTransformer() { + @Override public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { return "CAFEDEAD".getBytes(); } @@ -97,6 +98,7 @@ public final class ReflectiveLoadTimeWeaverTests { private int numTimesGetThrowawayClassLoaderCalled = 0; + @Override public int getNumTimesGetThrowawayClassLoaderCalled() { return this.numTimesGetThrowawayClassLoaderCalled; } diff --git a/spring-context/src/test/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoaderTests.java b/spring-context/src/test/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoaderTests.java index 506a883136b..3cafa8950e0 100644 --- a/spring-context/src/test/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoaderTests.java +++ b/spring-context/src/test/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java b/spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java index db49e67a1be..b2efa269c1e 100644 --- a/spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java +++ b/spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -16,154 +16,136 @@ package org.springframework.instrument.classloading.glassfish; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; - -import java.lang.instrument.ClassFileTransformer; -import java.net.URL; -import java.net.URLClassLoader; -import java.security.SecureClassLoader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.persistence.spi.ClassTransformer; - -import org.easymock.ArgumentsMatcher; -import org.easymock.MockControl; -import org.junit.After; -import org.junit.Before; import org.junit.Ignore; -import org.junit.Test; -import org.springframework.instrument.classloading.LoadTimeWeaver; // converting away from old-style EasyMock APIs was problematic with this class +// glassfish dependencies no longer on classpath @SuppressWarnings("deprecation") @Ignore public class GlassFishLoadTimeWeaverTests { - private MockControl loaderCtrl; - private GlassFishClassLoaderAdapter loader; - private LoadTimeWeaver ltw; - - private class DummyInstrumentableClassLoader extends SecureClassLoader { - - String INSTR_CL_NAME = GlassFishClassLoaderAdapter.INSTRUMENTABLE_CLASSLOADER_GLASSFISH_V2; - - public DummyInstrumentableClassLoader() { - super(); - } - - public DummyInstrumentableClassLoader(ClassLoader parent) { - super(parent); - } - - private List v2Transformers = new ArrayList(); - private List v3Transformers = new ArrayList(); - - public void addTransformer(ClassTransformer transformer) { - v2Transformers.add(transformer); - } - - public void addTransformer(ClassFileTransformer transformer) { - v3Transformers.add(transformer); - } - - public ClassLoader copy() { - return new DummyInstrumentableClassLoader(); - } - - @Override - public Class loadClass(String name) throws ClassNotFoundException { - if (INSTR_CL_NAME.equals(name)) { - return this.getClass(); - } - - return getClass().getClassLoader().loadClass(name); - } - } - - @Before - public void setUp() throws Exception { - ltw = new GlassFishLoadTimeWeaver(new DummyInstrumentableClassLoader()); - } - - @After - public void tearDown() throws Exception { - loaderCtrl.verify(); - ltw = null; - } - - @Test - public void testGlassFishLoadTimeWeaver() { - try { - ltw = new GlassFishLoadTimeWeaver(); - fail("expected exception"); - } catch (IllegalArgumentException ex) { - // expected - } - - } - - @Test - public void testGlassFishLoadTimeWeaverClassLoader() { - try { - ltw = new GlassFishLoadTimeWeaver(null); - fail("expected exception"); - } catch (RuntimeException e) { - // expected - } - - ClassLoader cl1 = new URLClassLoader(new URL[0]); - ClassLoader cl2 = new URLClassLoader(new URL[0], cl1); - ClassLoader cl3 = new DummyInstrumentableClassLoader(cl2); - ClassLoader cl4 = new URLClassLoader(new URL[0], cl3); - - ltw = new GlassFishLoadTimeWeaver(cl4); - assertSame(cl3, ltw.getInstrumentableClassLoader()); - - cl1 = new URLClassLoader(new URL[0]); - cl2 = new URLClassLoader(new URL[0], cl1); - cl3 = new DummyInstrumentableClassLoader(cl2); - cl4 = new DummyInstrumentableClassLoader(cl3); - - ltw = new GlassFishLoadTimeWeaver(cl4); - assertSame(cl4, ltw.getInstrumentableClassLoader()); - } - - @Test - public void testAddTransformer() { - ClassFileTransformer transformer = MockControl.createNiceControl(ClassFileTransformer.class).getMock(); - loaderCtrl.reset(); - loader.addTransformer(transformer); - loaderCtrl.setMatcher(new ArgumentsMatcher() { - - public boolean matches(Object[] arg0, Object[] arg1) { - for (int i = 0; i < arg0.length; i++) { - if (arg0 != null && arg0.getClass() != arg1.getClass()) - return false; - } - return true; - } - - public String toString(Object[] arg0) { - return Arrays.toString(arg0); - } - - }); - - loaderCtrl.replay(); - - ltw.addTransformer(transformer); - } - - @Test - public void testGetThrowawayClassLoader() { - loaderCtrl.reset(); - ClassLoader cl = new URLClassLoader(new URL[0]); - loaderCtrl.expectAndReturn(loader.getClassLoader(), cl); - loaderCtrl.replay(); - - assertSame(ltw.getThrowawayClassLoader(), cl); - } -} \ No newline at end of file +// private MockControl loaderCtrl; +// private GlassFishClassLoaderAdapter loader; +// private LoadTimeWeaver ltw; +// +// private class DummyInstrumentableClassLoader extends SecureClassLoader { +// +// String INSTR_CL_NAME = GlassFishClassLoaderAdapter.INSTRUMENTABLE_CLASSLOADER_GLASSFISH_V2; +// +// public DummyInstrumentableClassLoader() { +// super(); +// } +// +// public DummyInstrumentableClassLoader(ClassLoader parent) { +// super(parent); +// } +// +// private List v2Transformers = new ArrayList(); +// private List v3Transformers = new ArrayList(); +// +// public void addTransformer(ClassTransformer transformer) { +// v2Transformers.add(transformer); +// } +// +// public void addTransformer(ClassFileTransformer transformer) { +// v3Transformers.add(transformer); +// } +// +// public ClassLoader copy() { +// return new DummyInstrumentableClassLoader(); +// } +// +// @Override +// public Class loadClass(String name) throws ClassNotFoundException { +// if (INSTR_CL_NAME.equals(name)) { +// return this.getClass(); +// } +// +// return getClass().getClassLoader().loadClass(name); +// } +// } +// +// @Before +// public void setUp() throws Exception { +// ltw = new GlassFishLoadTimeWeaver(new DummyInstrumentableClassLoader()); +// } +// +// @After +// public void tearDown() throws Exception { +// loaderCtrl.verify(); +// ltw = null; +// } +// +// @Test +// public void testGlassFishLoadTimeWeaver() { +// try { +// ltw = new GlassFishLoadTimeWeaver(); +// fail("expected exception"); +// } catch (IllegalArgumentException ex) { +// // expected +// } +// +// } +// +// @Test +// public void testGlassFishLoadTimeWeaverClassLoader() { +// try { +// ltw = new GlassFishLoadTimeWeaver(null); +// fail("expected exception"); +// } catch (RuntimeException e) { +// // expected +// } +// +// ClassLoader cl1 = new URLClassLoader(new URL[0]); +// ClassLoader cl2 = new URLClassLoader(new URL[0], cl1); +// ClassLoader cl3 = new DummyInstrumentableClassLoader(cl2); +// ClassLoader cl4 = new URLClassLoader(new URL[0], cl3); +// +// ltw = new GlassFishLoadTimeWeaver(cl4); +// assertSame(cl3, ltw.getInstrumentableClassLoader()); +// +// cl1 = new URLClassLoader(new URL[0]); +// cl2 = new URLClassLoader(new URL[0], cl1); +// cl3 = new DummyInstrumentableClassLoader(cl2); +// cl4 = new DummyInstrumentableClassLoader(cl3); +// +// ltw = new GlassFishLoadTimeWeaver(cl4); +// assertSame(cl4, ltw.getInstrumentableClassLoader()); +// } +// +// @Test +// public void testAddTransformer() { +// ClassFileTransformer transformer = MockControl.createNiceControl(ClassFileTransformer.class).getMock(); +// loaderCtrl.reset(); +// loader.addTransformer(transformer); +// loaderCtrl.setMatcher(new ArgumentsMatcher() { +// +// public boolean matches(Object[] arg0, Object[] arg1) { +// for (int i = 0; i < arg0.length; i++) { +// if (arg0 != null && arg0.getClass() != arg1.getClass()) +// return false; +// } +// return true; +// } +// +// public String toString(Object[] arg0) { +// return Arrays.toString(arg0); +// } +// +// }); +// +// loaderCtrl.replay(); +// +// ltw.addTransformer(transformer); +// } +// +// @Test +// public void testGetThrowawayClassLoader() { +// loaderCtrl.reset(); +// ClassLoader cl = new URLClassLoader(new URL[0]); +// loaderCtrl.expectAndReturn(loader.getClassLoader(), cl); +// loaderCtrl.replay(); +// +// assertSame(ltw.getThrowawayClassLoader(), cl); +// } +} diff --git a/spring-context/src/test/java/org/springframework/jmx/AbstractJmxTests.java b/spring-context/src/test/java/org/springframework/jmx/AbstractJmxTests.java index bb94cbe364a..a213fdd4ac5 100644 --- a/spring-context/src/test/java/org/springframework/jmx/AbstractJmxTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/AbstractJmxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -31,10 +31,12 @@ public abstract class AbstractJmxTests extends AbstractMBeanServerTests { private ConfigurableApplicationContext ctx; + @Override protected final void onSetUp() throws Exception { ctx = loadContext(getApplicationContextPath()); } + @Override protected final void onTearDown() throws Exception { if (ctx != null) { ctx.close(); diff --git a/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java b/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java index c40b734119d..12dbf05a50c 100644 --- a/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -45,6 +45,7 @@ public abstract class AbstractMBeanServerTests extends TestCase { protected MBeanServer server; + @Override public final void setUp() throws Exception { this.server = MBeanServerFactory.createMBeanServer(); try { @@ -63,6 +64,7 @@ public abstract class AbstractMBeanServerTests extends TestCase { return ctx; } + @Override protected void tearDown() throws Exception { releaseServer(); onTearDown(); diff --git a/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java b/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java index 0a6ba490356..be001e23c4c 100644 --- a/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/IJmxTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java b/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java index e73f6106c76..d42fbf201b3 100644 --- a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 @@ -43,10 +43,12 @@ public class JmxTestBean implements IJmxTestBean { * @@org.springframework.jmx.export.metadata.ManagedAttribute * (description="The Age Attribute", currencyTimeLimit=15) */ + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -54,6 +56,7 @@ public class JmxTestBean implements IJmxTestBean { /** * @@org.springframework.jmx.export.metadata.ManagedOperation(currencyTimeLimit=30) */ + @Override public long myOperation() { return 1L; } @@ -63,6 +66,7 @@ public class JmxTestBean implements IJmxTestBean { * (description="The Name Attribute", currencyTimeLimit=20, * defaultValue="bar", persistPolicy="OnUpdate") */ + @Override public void setName(String name) throws Exception { if ("Juergen".equals(name)) { throw new IllegalArgumentException("Juergen"); @@ -80,6 +84,7 @@ public class JmxTestBean implements IJmxTestBean { * @@org.springframework.jmx.export.metadata.ManagedAttribute * (defaultValue="foo", persistPeriod=300) */ + @Override public String getName() { return name; } @@ -117,6 +122,7 @@ public class JmxTestBean implements IJmxTestBean { * @@org.springframework.jmx.export.metadata.ManagedOperationParameter(index=0, name="x", description="Left operand") * @@org.springframework.jmx.export.metadata.ManagedOperationParameter(index=1, name="y", description="Right operand") */ + @Override public int add(int x, int y) { return x + y; } @@ -124,6 +130,7 @@ public class JmxTestBean implements IJmxTestBean { /** * Test method that is not exposed by the MetadataAssembler. */ + @Override public void dontExposeMe() { throw new RuntimeException(); } diff --git a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java b/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java index a6af50e1325..7842ee328cb 100644 --- a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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 @@ -50,6 +50,7 @@ public class MBeanClientInterceptorTests extends AbstractMBeanServerTests { protected boolean runTests = true; + @Override public void onSetUp() throws Exception { target = new JmxTestBean(); target.setAge(100); @@ -277,10 +278,12 @@ public class MBeanClientInterceptorTests extends AbstractMBeanServerTests { private static class ProxyTestAssembler extends AbstractReflectiveMBeanInfoAssembler { + @Override protected boolean includeReadAttribute(Method method, String beanKey) { return true; } + @Override protected boolean includeWriteAttribute(Method method, String beanKey) { if ("setAge".equals(method.getName())) { return false; @@ -288,6 +291,7 @@ public class MBeanClientInterceptorTests extends AbstractMBeanServerTests { return true; } + @Override protected boolean includeOperation(Method method, String beanKey) { if ("dontExposeMe".equals(method.getName())) { return false; diff --git a/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java b/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java index 77aefe6167c..7082efec132 100644 --- a/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java +++ b/spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTestsIgnore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 @@ -46,6 +46,7 @@ public class RemoteMBeanClientInterceptorTestsIgnore extends MBeanClientIntercep private JMXConnector connector; + @Override public void onSetUp() throws Exception { super.onSetUp(); this.connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(getServiceUrl(), null, getServer()); @@ -61,11 +62,13 @@ public class RemoteMBeanClientInterceptorTestsIgnore extends MBeanClientIntercep return new JMXServiceURL(SERVICE_URL); } + @Override protected MBeanServerConnection getServerConnection() throws Exception { this.connector = JMXConnectorFactory.connect(getServiceUrl()); return this.connector.getMBeanServerConnection(); } + @Override public void tearDown() throws Exception { if (this.connector != null) { this.connector.close(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java index d9aba5b4c07..2c71236d78a 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -31,6 +31,7 @@ public class CustomEditorConfigurerTests extends AbstractJmxTests { private final SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd"); + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/customConfigurer.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java b/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java index 5603c43abd1..64f3f03b897 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/DateRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java b/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java index c61cd388aa2..a59d950a8d7 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterOperationsTests.java b/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterOperationsTests.java index d95c6b4f28b..59740fa0db4 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterOperationsTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterOperationsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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,6 +67,7 @@ public class MBeanExporterOperationsTests extends AbstractMBeanServerTests { MBeanExporter exporter = new MBeanExporter(); exporter.setServer(getServer()); exporter.setNamingStrategy(new ObjectNamingStrategy() { + @Override public ObjectName getObjectName(Object managedBean, String beanKey) { return objectNameTemplate; } @@ -92,6 +93,7 @@ public class MBeanExporterOperationsTests extends AbstractMBeanServerTests { exporter.setServer(getServer()); exporter.setEnsureUniqueRuntimeObjectNames(false); exporter.setNamingStrategy(new ObjectNamingStrategy() { + @Override public ObjectName getObjectName(Object managedBean, String beanKey) { return objectNameTemplate; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java b/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java index 85865af76fc..2d7d9e26398 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -34,10 +34,9 @@ import javax.management.ObjectName; import javax.management.modelmbean.ModelMBeanInfo; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.beans.TestBean; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.ClassPathResource; import org.springframework.jmx.AbstractMBeanServerTests; import org.springframework.jmx.IJmxTestBean; @@ -48,8 +47,8 @@ import org.springframework.jmx.export.assembler.SimpleReflectiveMBeanInfoAssembl import org.springframework.jmx.export.naming.SelfNaming; import org.springframework.jmx.support.ObjectNameManager; import org.springframework.jmx.support.RegistrationPolicy; - -import test.interceptor.NopInterceptor; +import org.springframework.tests.aop.interceptor.NopInterceptor; +import org.springframework.tests.sample.beans.TestBean; /** * Integration tests for the {@link MBeanExporter} class. @@ -98,6 +97,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { public void testRegisterNotificationListenerForNonExistentMBean() throws Exception { Map listeners = new HashMap(); NotificationListener dummyListener = new NotificationListener() { + @Override public void handleNotification(Notification notification, Object handback) { throw new UnsupportedOperationException(); } @@ -154,7 +154,8 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { } public void testAutodetectMBeans() throws Exception { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectMBeans.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("autodetectMBeans.xml", getClass())); try { bf.getBean("exporter"); MBeanServer server = (MBeanServer) bf.getBean("server"); @@ -170,7 +171,8 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { } public void testAutodetectWithExclude() throws Exception { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectMBeans.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("autodetectMBeans.xml", getClass())); try { bf.getBean("exporter"); MBeanServer server = (MBeanServer) bf.getBean("server"); @@ -188,7 +190,8 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { } public void testAutodetectLazyMBeans() throws Exception { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectLazyMBeans.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("autodetectLazyMBeans.xml", getClass())); try { bf.getBean("exporter"); MBeanServer server = (MBeanServer) bf.getBean("server"); @@ -208,7 +211,8 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { } public void testAutodetectNoMBeans() throws Exception { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("autodetectNoMBeans.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("autodetectNoMBeans.xml", getClass())); try { bf.getBean("exporter"); } finally { @@ -666,6 +670,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { private boolean invoked = false; + @Override public ModelMBeanInfo getMBeanInfo(Object managedResource, String beanKey) throws JMException { invoked = true; return null; @@ -678,10 +683,12 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { private List unregistered = new ArrayList(); + @Override public void mbeanRegistered(ObjectName objectName) { registered.add(objectName); } + @Override public void mbeanUnregistered(ObjectName objectName) { unregistered.add(objectName); } @@ -703,6 +710,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { this.objectName = objectName; } + @Override public ObjectName getObjectName() throws MalformedObjectNameException { return this.objectName; } @@ -717,6 +725,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { private String name; + @Override public String getName() { return name; } @@ -730,6 +739,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { private List notifications = new ArrayList(); + @Override public void handleNotification(Notification notification, Object handback) { this.notifications.add(notification); } @@ -756,6 +766,7 @@ public final class MBeanExporterTests extends AbstractMBeanServerTests { this.namedBean = namedBean; } + @Override public boolean includeBean(Class beanClass, String beanName) { return this.namedBean.equals(beanName); } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java index 3ab938d95d9..45244123079 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -158,6 +158,7 @@ public class NotificationListenerTests extends AbstractMBeanServerTests { NotificationListenerBean listenerBean = new NotificationListenerBean(); listenerBean.setNotificationListener(listener); listenerBean.setNotificationFilter(new NotificationFilter() { + @Override public boolean isNotificationEnabled(Notification notification) { if (notification instanceof AttributeChangeNotification) { AttributeChangeNotification changeNotification = (AttributeChangeNotification) notification; @@ -434,6 +435,7 @@ public class NotificationListenerTests extends AbstractMBeanServerTests { private Map attributeHandbacks = new HashMap(); + @Override public void handleNotification(Notification notification, Object handback) { if (notification instanceof AttributeChangeNotification) { AttributeChangeNotification attNotification = (AttributeChangeNotification) notification; @@ -473,6 +475,7 @@ public class NotificationListenerTests extends AbstractMBeanServerTests { this.objectName = objectName; } + @Override public ObjectName getObjectName() throws MalformedObjectNameException { return this.objectName; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/NotificationPublisherTests.java b/spring-context/src/test/java/org/springframework/jmx/export/NotificationPublisherTests.java index 24d7f4b57d0..a6abda7ed2e 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/NotificationPublisherTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/NotificationPublisherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -119,6 +119,7 @@ public class NotificationPublisherTests extends AbstractMBeanServerTests { private Notification lastNotification; + @Override public void handleNotification(Notification notification, Object handback) { this.lastNotification = notification; this.count++; @@ -139,6 +140,7 @@ public class NotificationPublisherTests extends AbstractMBeanServerTests { private NotificationPublisher notificationPublisher; + @Override public void setNotificationPublisher(NotificationPublisher notificationPublisher) { this.notificationPublisher = notificationPublisher; } @@ -158,28 +160,34 @@ public class NotificationPublisherTests extends AbstractMBeanServerTests { public static class MyNotificationPublisherMBean extends NotificationBroadcasterSupport implements DynamicMBean { + @Override public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { return null; } + @Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { } + @Override public AttributeList getAttributes(String[] attributes) { return null; } + @Override public AttributeList setAttributes(AttributeList attributes) { return null; } + @Override public Object invoke(String actionName, Object params[], String signature[]) throws MBeanException, ReflectionException { return null; } + @Override public MBeanInfo getMBeanInfo() { return new MBeanInfo(MyNotificationPublisherMBean.class.getName(), "", new MBeanAttributeInfo[0], new MBeanConstructorInfo[0], new MBeanOperationInfo[0], new MBeanNotificationInfo[0]); @@ -192,6 +200,7 @@ public class NotificationPublisherTests extends AbstractMBeanServerTests { public static class MyNotificationPublisherStandardMBean extends NotificationBroadcasterSupport implements MyMBean { + @Override public void sendNotification() { sendNotification(new Notification("test", this, 1)); } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java index 96167d24ec7..c95000c59da 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -26,6 +26,7 @@ import org.springframework.jmx.IJmxTestBean; */ public class PropertyPlaceholderConfigurerTests extends AbstractJmxTests { + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/propertyPlaceholderConfigurer.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/TestDynamicMBean.java b/spring-context/src/test/java/org/springframework/jmx/export/TestDynamicMBean.java index a52d6a7e78c..53da8a65824 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/TestDynamicMBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/TestDynamicMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 @@ public class TestDynamicMBean implements DynamicMBean { } } + @Override public Object getAttribute(String attribute) { if ("Name".equals(attribute)) { return "Rob Harrop"; @@ -44,21 +45,26 @@ public class TestDynamicMBean implements DynamicMBean { return null; } + @Override public void setAttribute(Attribute attribute) { } + @Override public AttributeList getAttributes(String[] attributes) { return null; } + @Override public AttributeList setAttributes(AttributeList attributes) { return null; } + @Override public Object invoke(String actionName, Object[] params, String[] signature) { return null; } + @Override public MBeanInfo getMBeanInfo() { MBeanAttributeInfo attr = new MBeanAttributeInfo("name", "java.lang.String", "", true, false, false); return new MBeanInfo( diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java index 5f65e056f61..d74787b7f81 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -48,18 +48,22 @@ public class AnnotationMetadataAssemblerTests extends AbstractMetadataAssemblerT assertNotNull(op); } + @Override protected JmxAttributeSource getAttributeSource() { return new AnnotationJmxAttributeSource(); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected IJmxTestBean createJmxTestBean() { return new AnnotationTestSubBean(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/annotation/annotations.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java index 97a3581954e..191b2f9ae36 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 @@ -40,20 +40,24 @@ public class AnnotationTestBean implements IJmxTestBean { private boolean isSuperman; + @Override @ManagedAttribute(description = "The Age Attribute", currencyTimeLimit = 15) public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } + @Override @ManagedOperation(currencyTimeLimit = 30) public long myOperation() { return 1L; } + @Override @ManagedAttribute(description = "The Name Attribute", currencyTimeLimit = 20, defaultValue = "bar", @@ -62,6 +66,7 @@ public class AnnotationTestBean implements IJmxTestBean { this.name = name; } + @Override @ManagedAttribute(defaultValue = "foo", persistPeriod = 300) public String getName() { return name; @@ -85,6 +90,7 @@ public class AnnotationTestBean implements IJmxTestBean { return isSuperman; } + @Override @org.springframework.jmx.export.annotation.ManagedOperation(description = "Add Two Numbers Together") @ManagedOperationParameters({@ManagedOperationParameter(name="x", description="Left operand"), @ManagedOperationParameter(name="y", description="Right operand")}) @@ -95,6 +101,7 @@ public class AnnotationTestBean implements IJmxTestBean { /** * Test method that is not exposed by the MetadataAssembler. */ + @Override public void dontExposeMe() { throw new RuntimeException(); } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBeanFactory.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBeanFactory.java index 3e47e82bfd3..2dc4fa087b6 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBeanFactory.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBeanFactory.java @@ -30,14 +30,17 @@ public class AnnotationTestBeanFactory implements FactoryBean getObjectType() { return FactoryCreatedAnnotationTestBean.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestSubBean.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestSubBean.java index 8bfbc77ac08..9b0982d801d 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestSubBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestSubBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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,17 +38,21 @@ public class AnnotationTestSubBean extends AnnotationTestBean implements IAnnota return super.getAge(); } + @Override public String getColour() { return this.colour; } + @Override public void setColour(String colour) { this.colour = colour; } + @Override public void fromInterface() { } + @Override public int getExpensiveToCalculate() { return Integer.MAX_VALUE; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java index d409d1e8e2c..97b24e29ec4 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/JmxUtilsAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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 @@ -54,6 +54,7 @@ public class JmxUtilsAnnotationTests extends TestCase { public static class FooNotX implements FooNotMXBean { + @Override public String getName() { return "Rob Harrop"; } @@ -69,6 +70,7 @@ public class JmxUtilsAnnotationTests extends TestCase { public static class FooX implements FooIfc { + @Override public String getName() { return "Rob Harrop"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java index 79da547c136..59b71a58b27 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java index 6aa94facb25..68811d712a8 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -23,6 +23,7 @@ import org.springframework.jmx.export.metadata.JmxAttributeSource; */ public abstract class AbstractMetadataAssemblerAutodetectTests extends AbstractAutodetectTests { + @Override protected AutodetectCapableMBeanInfoAssembler getAssembler() { MetadataMBeanInfoAssembler assembler = new MetadataMBeanInfoAssembler(); assembler.setAttributeSource(getAttributeSource()); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java index 93735097c67..99cefe71583 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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 @@ -32,8 +32,7 @@ import org.springframework.jmx.JmxTestBean; import org.springframework.jmx.export.MBeanExporter; import org.springframework.jmx.export.metadata.JmxAttributeSource; import org.springframework.jmx.support.ObjectNameManager; - -import test.interceptor.NopInterceptor; +import org.springframework.tests.aop.interceptor.NopInterceptor; /** * @author Rob Harrop @@ -204,12 +203,15 @@ public abstract class AbstractMetadataAssemblerTests extends AbstractJmxAssemble assertNull("Metric Category should not be populated", desc.getFieldValue("metricCategory")); } + @Override protected abstract String getObjectName(); + @Override protected int getExpectedAttributeCount() { return 6; } + @Override protected int getExpectedOperationCount() { return 9; } @@ -218,6 +220,7 @@ public abstract class AbstractMetadataAssemblerTests extends AbstractJmxAssemble return new JmxTestBean(); } + @Override protected MBeanInfoAssembler getAssembler() { MetadataMBeanInfoAssembler assembler = new MetadataMBeanInfoAssembler(); assembler.setAttributeSource(getAttributeSource()); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java index 1d74177d3b4..311b7c67a51 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java index 4be8a6cc92f..d4034ed4494 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerCustomTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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 @@ -26,18 +26,22 @@ public class InterfaceBasedMBeanInfoAssemblerCustomTests extends AbstractJmxAsse protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 5; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { InterfaceBasedMBeanInfoAssembler assembler = new InterfaceBasedMBeanInfoAssembler(); assembler.setManagedInterfaces(new Class[] {ICustomJmxBean.class}); @@ -52,6 +56,7 @@ public class InterfaceBasedMBeanInfoAssemblerCustomTests extends AbstractJmxAsse assertFalse(attr.isWritable()); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssemblerCustom.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java index a0681cc398a..dc9db0fc5e2 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -75,24 +75,29 @@ public class InterfaceBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAsse assertNickName(attr); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { return getWithMapping( "org.springframework.jmx.export.assembler.IAdditionalTestMethods, " + "org.springframework.jmx.export.assembler.ICustomJmxBean"); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssemblerMapped.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java index 6d8266b4aca..76b8ad5639e 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 @@ -21,22 +21,27 @@ package org.springframework.jmx.export.assembler; */ public class InterfaceBasedMBeanInfoAssemblerTests extends AbstractJmxAssemblerTests { + @Override protected String getObjectName() { return "bean:name=testBean4"; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { return new InterfaceBasedMBeanInfoAssembler(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/interfaceAssembler.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerComboTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerComboTests.java index 73d4fb56f51..2c2a8618eb1 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerComboTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerComboTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -45,22 +45,27 @@ public class MethodExclusionMBeanInfoAssemblerComboTests extends AbstractJmxAsse assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerCombo.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerMappedTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerMappedTests.java index a3f11f9fef6..35fe1082703 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerMappedTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerMappedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -44,22 +44,27 @@ public class MethodExclusionMBeanInfoAssemblerMappedTests extends AbstractJmxAss assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerMapped.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerNotMappedTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerNotMappedTests.java index c19ef5969da..f037d87bcb7 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerNotMappedTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerNotMappedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -45,22 +45,27 @@ public class MethodExclusionMBeanInfoAssemblerNotMappedTests extends AbstractJmx assertTrue("Nick Name should be readable", attr.isReadable()); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 11; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssemblerNotMapped.xml"; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); Properties props = new Properties(); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java index 2370488f80c..8a492930066 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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,22 +33,27 @@ public class MethodExclusionMBeanInfoAssemblerTests extends AbstractJmxAssembler private static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 9; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodExclusionAssembler.xml"; } + @Override protected MBeanInfoAssembler getAssembler() { MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler(); assembler.setIgnoredMethods(new String[] {"dontExposeMe", "setSuperman"}); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java index 496c3d7c9fc..062a45febd7 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -54,22 +54,27 @@ public class MethodNameBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAss assertNickName(attr); } + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 7; } + @Override protected int getExpectedAttributeCount() { return 3; } + @Override protected MBeanInfoAssembler getAssembler() throws Exception { return getWithMapping("getNickName,setNickName,add,myOperation,getName,setName,getAge"); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodNameAssemblerMapped.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java index 28cc9f5b535..2b0bbaeefcf 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -26,18 +26,22 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler protected static final String OBJECT_NAME = "bean:name=testBean5"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 5; } + @Override protected int getExpectedAttributeCount() { return 2; } + @Override protected MBeanInfoAssembler getAssembler() { MethodNameBasedMBeanInfoAssembler assembler = new MethodNameBasedMBeanInfoAssembler(); assembler.setManagedMethods(new String[] {"add", "myOperation", "getName", "setName", "getAge"}); @@ -52,6 +56,7 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler assertFalse(attr.isWritable()); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/methodNameAssembler.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java index 91f97e0a1dd..729e784464b 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -26,22 +26,27 @@ public class ReflectiveAssemblerTests extends AbstractJmxAssemblerTests { protected static final String OBJECT_NAME = "bean:name=testBean1"; + @Override protected String getObjectName() { return OBJECT_NAME; } + @Override protected int getExpectedOperationCount() { return 11; } + @Override protected int getExpectedAttributeCount() { return 4; } + @Override protected MBeanInfoAssembler getAssembler() { return new SimpleReflectiveMBeanInfoAssembler(); } + @Override protected String getApplicationContextPath() { return "org/springframework/jmx/export/assembler/reflectiveAssembler.xml"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java index c98f88489f8..df11e8b4bba 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -23,18 +23,22 @@ public class KeyNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "spring:name=test"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { return new KeyNamingStrategy(); } + @Override protected Object getManagedResource() { return new Object(); } + @Override protected String getKey() { return OBJECT_NAME; } + @Override protected String getCorrectObjectName() { return OBJECT_NAME; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java index 9772ff4ae46..3050b6f8e87 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -23,6 +23,7 @@ import org.springframework.core.io.ClassPathResource; */ public class PropertiesFileNamingStrategyTests extends PropertiesNamingStrategyTests { + @Override protected ObjectNamingStrategy getStrategy() throws Exception { KeyNamingStrategy strat = new KeyNamingStrategy(); strat.setMappingLocation(new ClassPathResource("jmx-names.properties", getClass())); diff --git a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java index fefc10ffc88..3521619c224 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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 @@ -26,6 +26,7 @@ public class PropertiesNamingStrategyTests extends AbstractNamingStrategyTests { private static final String OBJECT_NAME = "bean:name=namingTest"; + @Override protected ObjectNamingStrategy getStrategy() throws Exception { KeyNamingStrategy strat = new KeyNamingStrategy(); Properties mappings = new Properties(); @@ -35,14 +36,17 @@ public class PropertiesNamingStrategyTests extends AbstractNamingStrategyTests { return strat; } + @Override protected Object getManagedResource() { return new Object(); } + @Override protected String getKey() { return "namingTest"; } + @Override protected String getCorrectObjectName() { return OBJECT_NAME; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisherTests.java b/spring-context/src/test/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisherTests.java index 6f9ab8e724a..14986a19596 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisherTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -113,10 +113,12 @@ public final class ModelMBeanNotificationPublisherTests { return this.actualNotification; } + @Override public void sendNotification(Notification notification) throws RuntimeOperationsException { this.actualNotification = notification; } + @Override public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws RuntimeOperationsException { this.actualNotification = notification; } diff --git a/spring-context/src/test/java/org/springframework/jmx/export/propertyPlaceholderConfigurer.xml b/spring-context/src/test/java/org/springframework/jmx/export/propertyPlaceholderConfigurer.xml index b108c30e01d..79790d3963b 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/propertyPlaceholderConfigurer.xml +++ b/spring-context/src/test/java/org/springframework/jmx/export/propertyPlaceholderConfigurer.xml @@ -17,7 +17,7 @@ - + diff --git a/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java b/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java index b72082cef14..c006f6fab7e 100644 --- a/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/support/JmxUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 @@ -151,28 +151,35 @@ public class JmxUtilsTests extends TestCase { super(IJmxTestBean.class); } + @Override public int add(int x, int y) { return 0; } + @Override public long myOperation() { return 0; } + @Override public int getAge() { return 0; } + @Override public void setAge(int age) { } + @Override public void setName(String name) { } + @Override public String getName() { return null; } + @Override public void dontExposeMe() { } } @@ -186,6 +193,7 @@ public class JmxUtilsTests extends TestCase { public static class Foo implements FooMBean { + @Override public String getName() { return "Rob Harrop"; } @@ -200,6 +208,7 @@ public class JmxUtilsTests extends TestCase { public static class FooX implements FooMXBean { + @Override public String getName() { return "Rob Harrop"; } diff --git a/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java index d53d8366fe8..598bc73e8c9 100644 --- a/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java index 5acfff76088..4ad2255d2c4 100644 --- a/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,17 +16,20 @@ package org.springframework.jndi; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import javax.naming.Context; import javax.naming.NamingException; import org.junit.Test; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; -import org.springframework.mock.jndi.ExpectedLookupTemplate; +import org.springframework.tests.mock.jndi.ExpectedLookupTemplate; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rod Johnson @@ -233,6 +236,7 @@ public class JndiObjectFactoryBeanTests { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -259,6 +263,7 @@ public class JndiObjectFactoryBeanTests { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -287,6 +292,7 @@ public class JndiObjectFactoryBeanTests { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); final TestBean tb = new TestBean(); jof.setJndiTemplate(new JndiTemplate() { + @Override public Object lookup(String name) { if ("foo".equals(name)) { tb.setName("tb"); @@ -372,7 +378,7 @@ public class JndiObjectFactoryBeanTests { fail("Should have thrown NamingException"); } catch (NamingException ex) { - assertTrue(ex.getMessage().indexOf("org.springframework.beans.DerivedTestBean") != -1); + assertTrue(ex.getMessage().indexOf("org.springframework.tests.sample.beans.DerivedTestBean") != -1); } } @@ -380,12 +386,10 @@ public class JndiObjectFactoryBeanTests { public void testLookupWithExposeAccessContext() throws Exception { JndiObjectFactoryBean jof = new JndiObjectFactoryBean(); TestBean tb = new TestBean(); - final Context mockCtx = createMock(Context.class); - expect(mockCtx.lookup("foo")).andReturn(tb); - mockCtx.close(); - expectLastCall().times(2); - replay(mockCtx); + final Context mockCtx = mock(Context.class); + given(mockCtx.lookup("foo")).willReturn(tb); jof.setJndiTemplate(new JndiTemplate() { + @Override protected Context createInitialContext() { return mockCtx; } @@ -402,7 +406,7 @@ public class JndiObjectFactoryBeanTests { proxy.equals(proxy); proxy.hashCode(); proxy.toString(); - verify(mockCtx); + verify(mockCtx, times(2)).close(); } } diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java index 5148742ca42..ad6ac8871ab 100644 --- a/spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java +++ b/spring-context/src/test/java/org/springframework/jndi/JndiPropertySourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import javax.naming.Context; import javax.naming.NamingException; import org.junit.Test; -import org.springframework.mock.jndi.SimpleNamingContext; +import org.springframework.tests.mock.jndi.SimpleNamingContext; /** * Unit tests for {@link JndiPropertySource}. diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateEditorTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateEditorTests.java index cf2c73b5068..b191a7ada5b 100644 --- a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateEditorTests.java +++ b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateEditorTests.java @@ -1,6 +1,6 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java index 4d658bc2cf7..40188024759 100644 --- a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java +++ b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,10 @@ package org.springframework.jndi; -import static org.easymock.EasyMock.*; import static org.junit.Assert.*; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import javax.naming.Context; import javax.naming.NameNotFoundException; @@ -36,12 +38,11 @@ public class JndiTemplateTests { public void testLookupSucceeds() throws Exception { Object o = new Object(); String name = "foo"; - final Context context = createMock(Context.class); - expect(context.lookup(name)).andReturn(o); - context.close(); - replay(context); + final Context context = mock(Context.class); + given(context.lookup(name)).willReturn(o); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -49,19 +50,18 @@ public class JndiTemplateTests { Object o2 = jt.lookup(name); assertEquals(o, o2); - verify(context); + verify(context).close(); } @Test public void testLookupFails() throws Exception { NameNotFoundException ne = new NameNotFoundException(); String name = "foo"; - final Context context = createMock(Context.class); - expect(context.lookup(name)).andThrow(ne); - context.close(); - replay(context); + final Context context = mock(Context.class); + given(context.lookup(name)).willThrow(ne); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -74,18 +74,17 @@ public class JndiTemplateTests { catch (NameNotFoundException ex) { // Ok } - verify(context); + verify(context).close(); } @Test public void testLookupReturnsNull() throws Exception { String name = "foo"; - final Context context = createMock(Context.class); - expect(context.lookup(name)).andReturn(null); - context.close(); - replay(context); + final Context context = mock(Context.class); + given(context.lookup(name)).willReturn(null); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -98,19 +97,18 @@ public class JndiTemplateTests { catch (NameNotFoundException ex) { // Ok } - verify(context); + verify(context).close(); } @Test public void testLookupFailsWithTypeMismatch() throws Exception { Object o = new Object(); String name = "foo"; - final Context context = createMock(Context.class); - expect(context.lookup(name)).andReturn(o); - context.close(); - replay(context); + final Context context = mock(Context.class); + given(context.lookup(name)).willReturn(o); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } @@ -123,63 +121,61 @@ public class JndiTemplateTests { catch (TypeMismatchNamingException ex) { // Ok } - verify(context); + verify(context).close(); } @Test public void testBind() throws Exception { Object o = new Object(); String name = "foo"; - final Context context = createMock(Context.class); - context.bind(name, o); - context.close(); - replay(context); + final Context context = mock(Context.class); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } }; jt.bind(name, o); - verify(context); + verify(context).bind(name, o); + verify(context).close(); } @Test public void testRebind() throws Exception { Object o = new Object(); String name = "foo"; - final Context context = createMock(Context.class); - context.rebind(name, o); - context.close(); - replay(context); + final Context context = mock(Context.class); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } }; jt.rebind(name, o); - verify(context); + verify(context).rebind(name, o); + verify(context).close(); +; } @Test public void testUnbind() throws Exception { String name = "something"; - final Context context = createMock(Context.class); - context.unbind(name); - context.close(); - replay(context); + final Context context = mock(Context.class); JndiTemplate jt = new JndiTemplate() { + @Override protected Context createInitialContext() { return context; } }; jt.unbind(name); - verify(context); + verify(context).unbind(name); + verify(context).close(); } } diff --git a/spring-context/src/test/java/org/springframework/jndi/SimpleNamingContextTests.java b/spring-context/src/test/java/org/springframework/jndi/SimpleNamingContextTests.java index bc635f183da..917e8dc918f 100644 --- a/spring-context/src/test/java/org/springframework/jndi/SimpleNamingContextTests.java +++ b/spring-context/src/test/java/org/springframework/jndi/SimpleNamingContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -35,8 +35,8 @@ import javax.sql.DataSource; import org.junit.Test; -import org.springframework.mock.jndi.SimpleNamingContext; -import org.springframework.mock.jndi.SimpleNamingContextBuilder; +import org.springframework.tests.mock.jndi.SimpleNamingContext; +import org.springframework.tests.mock.jndi.SimpleNamingContextBuilder; import static org.junit.Assert.*; @@ -219,38 +219,47 @@ public class SimpleNamingContextTests { class StubDataSource implements DataSource { + @Override public Connection getConnection() throws SQLException { return null; } + @Override public Connection getConnection(String username, String password) throws SQLException { return null; } + @Override public PrintWriter getLogWriter() throws SQLException { return null; } + @Override public int getLoginTimeout() throws SQLException { return 0; } + @Override public void setLogWriter(PrintWriter arg0) throws SQLException { } + @Override public void setLoginTimeout(int arg0) throws SQLException { } + @Override public boolean isWrapperFor(Class arg0) throws SQLException { return false; } + @Override public T unwrap(Class arg0) throws SQLException { return null; } + @Override public Logger getParentLogger() { return null; } diff --git a/spring-context/src/test/java/org/springframework/mock/env/MockPropertySource.java b/spring-context/src/test/java/org/springframework/mock/env/MockPropertySource.java deleted file mode 100644 index 2783f244b18..00000000000 --- a/spring-context/src/test/java/org/springframework/mock/env/MockPropertySource.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.mock.env; - -import java.util.Properties; - -import org.springframework.core.env.PropertiesPropertySource; -import org.springframework.core.env.PropertySource; - -/** - * Simple {@link PropertySource} implementation for use in testing. Accepts - * a user-provided {@link Properties} object, or if omitted during construction, - * the implementation will initialize its own. - * - * The {@link #setProperty} and {@link #withProperty} methods are exposed for - * convenience, for example: - *
- * {@code
- *   PropertySource source = new MockPropertySource().withProperty("foo", "bar");
- * }
- * 
- * - * @author Chris Beams - * @since 3.1 - * @see org.springframework.mock.env.MockEnvironment - */ -public class MockPropertySource extends PropertiesPropertySource { - - /** - * {@value} is the default name for {@link MockPropertySource} instances not - * otherwise given an explicit name. - * @see #MockPropertySource() - * @see #MockPropertySource(String) - */ - public static final String MOCK_PROPERTIES_PROPERTY_SOURCE_NAME = "mockProperties"; - - /** - * Create a new {@code MockPropertySource} named {@value #MOCK_PROPERTIES_PROPERTY_SOURCE_NAME} - * that will maintain its own internal {@link Properties} instance. - */ - public MockPropertySource() { - this(new Properties()); - } - - /** - * Create a new {@code MockPropertySource} with the given name that will - * maintain its own internal {@link Properties} instance. - * @param name the {@linkplain #getName() name} of the property source - */ - public MockPropertySource(String name) { - this(name, new Properties()); - } - - /** - * Create a new {@code MockPropertySource} named {@value #MOCK_PROPERTIES_PROPERTY_SOURCE_NAME} - * and backed by the given {@link Properties} object. - * @param properties the properties to use - */ - public MockPropertySource(Properties properties) { - this(MOCK_PROPERTIES_PROPERTY_SOURCE_NAME, properties); - } - - /** - * Create a new {@code MockPropertySource} with the given name and backed by the given - * {@link Properties} object - * @param name the {@linkplain #getName() name} of the property source - * @param properties the properties to use - */ - public MockPropertySource(String name, Properties properties) { - super(name, properties); - } - - /** - * Set the given property on the underlying {@link Properties} object. - */ - public void setProperty(String name, Object value) { - this.source.put(name, value); - } - - /** - * Convenient synonym for {@link #setProperty} that returns the current instance. - * Useful for method chaining and fluent-style use. - * @return this {@link MockPropertySource} instance - */ - public MockPropertySource withProperty(String name, Object value) { - this.setProperty(name, value); - return this; - } - -} diff --git a/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java b/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java deleted file mode 100644 index c71d6e86810..00000000000 --- a/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.mock.jndi; - -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import javax.naming.Binding; -import javax.naming.Context; -import javax.naming.Name; -import javax.naming.NameClassPair; -import javax.naming.NameNotFoundException; -import javax.naming.NameParser; -import javax.naming.NamingEnumeration; -import javax.naming.NamingException; -import javax.naming.OperationNotSupportedException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.util.StringUtils; - -/** - * Simple implementation of a JNDI naming context. - * Only supports binding plain Objects to String names. - * Mainly for test environments, but also usable for standalone applications. - * - *

This class is not intended for direct usage by applications, although it - * can be used for example to override JndiTemplate's {@code createInitialContext} - * method in unit tests. Typically, SimpleNamingContextBuilder will be used to - * set up a JVM-level JNDI environment. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @see SimpleNamingContextBuilder - * @see org.springframework.jndi.JndiTemplate#createInitialContext - */ -public class SimpleNamingContext implements Context { - - private final Log logger = LogFactory.getLog(getClass()); - - private final String root; - - private final Hashtable boundObjects; - - private final Hashtable environment = new Hashtable(); - - - /** - * Create a new naming context. - */ - public SimpleNamingContext() { - this(""); - } - - /** - * Create a new naming context with the given naming root. - */ - public SimpleNamingContext(String root) { - this.root = root; - this.boundObjects = new Hashtable(); - } - - /** - * Create a new naming context with the given naming root, - * the given name/object map, and the JNDI environment entries. - */ - public SimpleNamingContext(String root, Hashtable boundObjects, Hashtable env) { - this.root = root; - this.boundObjects = boundObjects; - if (env != null) { - this.environment.putAll(env); - } - } - - - // Actual implementations of Context methods follow - - public NamingEnumeration list(String root) throws NamingException { - if (logger.isDebugEnabled()) { - logger.debug("Listing name/class pairs under [" + root + "]"); - } - return new NameClassPairEnumeration(this, root); - } - - public NamingEnumeration listBindings(String root) throws NamingException { - if (logger.isDebugEnabled()) { - logger.debug("Listing bindings under [" + root + "]"); - } - return new BindingEnumeration(this, root); - } - - /** - * Look up the object with the given name. - *

Note: Not intended for direct use by applications. - * Will be used by any standard InitialContext JNDI lookups. - * @throws javax.naming.NameNotFoundException if the object could not be found - */ - public Object lookup(String lookupName) throws NameNotFoundException { - String name = this.root + lookupName; - if (logger.isDebugEnabled()) { - logger.debug("Static JNDI lookup: [" + name + "]"); - } - if ("".equals(name)) { - return new SimpleNamingContext(this.root, this.boundObjects, this.environment); - } - Object found = this.boundObjects.get(name); - if (found == null) { - if (!name.endsWith("/")) { - name = name + "/"; - } - for (String boundName : this.boundObjects.keySet()) { - if (boundName.startsWith(name)) { - return new SimpleNamingContext(name, this.boundObjects, this.environment); - } - } - throw new NameNotFoundException( - "Name [" + this.root + lookupName + "] not bound; " + this.boundObjects.size() + " bindings: [" + - StringUtils.collectionToDelimitedString(this.boundObjects.keySet(), ",") + "]"); - } - return found; - } - - public Object lookupLink(String name) throws NameNotFoundException { - return lookup(name); - } - - /** - * Bind the given object to the given name. - * Note: Not intended for direct use by applications - * if setting up a JVM-level JNDI environment. - * Use SimpleNamingContextBuilder to set up JNDI bindings then. - * @see org.springframework.mock.jndi.SimpleNamingContextBuilder#bind - */ - public void bind(String name, Object obj) { - if (logger.isInfoEnabled()) { - logger.info("Static JNDI binding: [" + this.root + name + "] = [" + obj + "]"); - } - this.boundObjects.put(this.root + name, obj); - } - - public void unbind(String name) { - if (logger.isInfoEnabled()) { - logger.info("Static JNDI remove: [" + this.root + name + "]"); - } - this.boundObjects.remove(this.root + name); - } - - public void rebind(String name, Object obj) { - bind(name, obj); - } - - public void rename(String oldName, String newName) throws NameNotFoundException { - Object obj = lookup(oldName); - unbind(oldName); - bind(newName, obj); - } - - public Context createSubcontext(String name) { - String subcontextName = this.root + name; - if (!subcontextName.endsWith("/")) { - subcontextName += "/"; - } - Context subcontext = new SimpleNamingContext(subcontextName, this.boundObjects, this.environment); - bind(name, subcontext); - return subcontext; - } - - public void destroySubcontext(String name) { - unbind(name); - } - - public String composeName(String name, String prefix) { - return prefix + name; - } - - public Hashtable getEnvironment() { - return this.environment; - } - - public Object addToEnvironment(String propName, Object propVal) { - return this.environment.put(propName, propVal); - } - - public Object removeFromEnvironment(String propName) { - return this.environment.remove(propName); - } - - public void close() { - } - - - // Unsupported methods follow: no support for javax.naming.Name - - public NamingEnumeration list(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public NamingEnumeration listBindings(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public Object lookup(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public Object lookupLink(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public void bind(Name name, Object obj) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public void unbind(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public void rebind(Name name, Object obj) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public void rename(Name oldName, Name newName) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public Context createSubcontext(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public void destroySubcontext(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public String getNameInNamespace() throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public NameParser getNameParser(Name name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public NameParser getNameParser(String name) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - public Name composeName(Name name, Name prefix) throws NamingException { - throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); - } - - - private static abstract class AbstractNamingEnumeration implements NamingEnumeration { - - private Iterator iterator; - - private AbstractNamingEnumeration(SimpleNamingContext context, String proot) throws NamingException { - if (!"".equals(proot) && !proot.endsWith("/")) { - proot = proot + "/"; - } - String root = context.root + proot; - Map contents = new HashMap(); - for (String boundName : context.boundObjects.keySet()) { - if (boundName.startsWith(root)) { - int startIndex = root.length(); - int endIndex = boundName.indexOf('/', startIndex); - String strippedName = - (endIndex != -1 ? boundName.substring(startIndex, endIndex) : boundName.substring(startIndex)); - if (!contents.containsKey(strippedName)) { - try { - contents.put(strippedName, createObject(strippedName, context.lookup(proot + strippedName))); - } - catch (NameNotFoundException ex) { - // cannot happen - } - } - } - } - if (contents.size() == 0) { - throw new NamingException("Invalid root: [" + context.root + proot + "]"); - } - this.iterator = contents.values().iterator(); - } - - protected abstract T createObject(String strippedName, Object obj); - - public boolean hasMore() { - return this.iterator.hasNext(); - } - - public T next() { - return this.iterator.next(); - } - - public boolean hasMoreElements() { - return this.iterator.hasNext(); - } - - public T nextElement() { - return this.iterator.next(); - } - - public void close() { - } - } - - - private static class NameClassPairEnumeration extends AbstractNamingEnumeration { - - private NameClassPairEnumeration(SimpleNamingContext context, String root) throws NamingException { - super(context, root); - } - - protected NameClassPair createObject(String strippedName, Object obj) { - return new NameClassPair(strippedName, obj.getClass().getName()); - } - } - - - private static class BindingEnumeration extends AbstractNamingEnumeration { - - private BindingEnumeration(SimpleNamingContext context, String root) throws NamingException { - super(context, root); - } - - protected Binding createObject(String strippedName, Object obj) { - return new Binding(strippedName, obj); - } - } - -} diff --git a/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java deleted file mode 100644 index f21936897b3..00000000000 --- a/spring-context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.mock.jndi; - -import java.util.Hashtable; - -import javax.naming.Context; -import javax.naming.NamingException; -import javax.naming.spi.InitialContextFactory; -import javax.naming.spi.InitialContextFactoryBuilder; -import javax.naming.spi.NamingManager; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.util.ClassUtils; - -/** - * Simple implementation of a JNDI naming context builder. - * - *

Mainly targeted at test environments, where each test case can - * configure JNDI appropriately, so that {@code new InitialContext()} - * will expose the required objects. Also usable for standalone applications, - * e.g. for binding a JDBC DataSource to a well-known JNDI location, to be - * able to use traditional J2EE data access code outside of a J2EE container. - * - *

There are various choices for DataSource implementations: - *

    - *
  • SingleConnectionDataSource (using the same Connection for all getConnection calls); - *
  • DriverManagerDataSource (creating a new Connection on each getConnection call); - *
  • Apache's Jakarta Commons DBCP offers BasicDataSource (a real pool). - *
- * - *

Typical usage in bootstrap code: - * - *

- * SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
- * DataSource ds = new DriverManagerDataSource(...);
- * builder.bind("java:comp/env/jdbc/myds", ds);
- * builder.activate();
- * - * Note that it's impossible to activate multiple builders within the same JVM, - * due to JNDI restrictions. Thus to configure a fresh builder repeatedly, use - * the following code to get a reference to either an already activated builder - * or a newly activated one: - * - *
- * SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
- * DataSource ds = new DriverManagerDataSource(...);
- * builder.bind("java:comp/env/jdbc/myds", ds);
- * - * Note that you should not call {@code activate()} on a builder from - * this factory method, as there will already be an activated one in any case. - * - *

An instance of this class is only necessary at setup time. - * An application does not need to keep a reference to it after activation. - * - * @author Juergen Hoeller - * @author Rod Johnson - * @see #emptyActivatedContextBuilder() - * @see #bind(String, Object) - * @see #activate() - * @see SimpleNamingContext - * @see org.springframework.jdbc.datasource.SingleConnectionDataSource - * @see org.springframework.jdbc.datasource.DriverManagerDataSource - * @see org.apache.commons.dbcp.BasicDataSource - */ -public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder { - - /** An instance of this class bound to JNDI */ - private static volatile SimpleNamingContextBuilder activated; - - private static boolean initialized = false; - - private static final Object initializationLock = new Object(); - - - /** - * Checks if a SimpleNamingContextBuilder is active. - * @return the current SimpleNamingContextBuilder instance, - * or {@code null} if none - */ - public static SimpleNamingContextBuilder getCurrentContextBuilder() { - return activated; - } - - /** - * If no SimpleNamingContextBuilder is already configuring JNDI, - * create and activate one. Otherwise take the existing activate - * SimpleNamingContextBuilder, clear it and return it. - *

This is mainly intended for test suites that want to - * reinitialize JNDI bindings from scratch repeatedly. - * @return an empty SimpleNamingContextBuilder that can be used - * to control JNDI bindings - */ - public static SimpleNamingContextBuilder emptyActivatedContextBuilder() throws NamingException { - if (activated != null) { - // Clear already activated context builder. - activated.clear(); - } - else { - // Create and activate new context builder. - SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); - // The activate() call will cause an assignment to the activated variable. - builder.activate(); - } - return activated; - } - - - private final Log logger = LogFactory.getLog(getClass()); - - private final Hashtable boundObjects = new Hashtable(); - - - /** - * Register the context builder by registering it with the JNDI NamingManager. - * Note that once this has been done, {@code new InitialContext()} will always - * return a context from this factory. Use the {@code emptyActivatedContextBuilder()} - * static method to get an empty context (for example, in test methods). - * @throws IllegalStateException if there's already a naming context builder - * registered with the JNDI NamingManager - */ - public void activate() throws IllegalStateException, NamingException { - logger.info("Activating simple JNDI environment"); - synchronized (initializationLock) { - if (!initialized) { - if (NamingManager.hasInitialContextFactoryBuilder()) { - throw new IllegalStateException( - "Cannot activate SimpleNamingContextBuilder: there is already a JNDI provider registered. " + - "Note that JNDI is a JVM-wide service, shared at the JVM system class loader level, " + - "with no reset option. As a consequence, a JNDI provider must only be registered once per JVM."); - } - NamingManager.setInitialContextFactoryBuilder(this); - initialized = true; - } - } - activated = this; - } - - /** - * Temporarily deactivate this context builder. It will remain registered with - * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory - * (if configured) instead of exposing its own bound objects. - *

Call {@code activate()} again in order to expose this context builder's own - * bound objects again. Such activate/deactivate sequences can be applied any number - * of times (e.g. within a larger integration test suite running in the same VM). - * @see #activate() - */ - public void deactivate() { - logger.info("Deactivating simple JNDI environment"); - activated = null; - } - - /** - * Clear all bindings in this context builder, while keeping it active. - */ - public void clear() { - this.boundObjects.clear(); - } - - /** - * Bind the given object under the given name, for all naming contexts - * that this context builder will generate. - * @param name the JNDI name of the object (e.g. "java:comp/env/jdbc/myds") - * @param obj the object to bind (e.g. a DataSource implementation) - */ - public void bind(String name, Object obj) { - if (logger.isInfoEnabled()) { - logger.info("Static JNDI binding: [" + name + "] = [" + obj + "]"); - } - this.boundObjects.put(name, obj); - } - - - /** - * Simple InitialContextFactoryBuilder implementation, - * creating a new SimpleNamingContext instance. - * @see SimpleNamingContext - */ - public InitialContextFactory createInitialContextFactory(Hashtable environment) { - if (activated == null && environment != null) { - Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); - if (icf != null) { - Class icfClass = null; - if (icf instanceof Class) { - icfClass = (Class) icf; - } - else if (icf instanceof String) { - icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); - } - else { - throw new IllegalArgumentException("Invalid value type for environment key [" + - Context.INITIAL_CONTEXT_FACTORY + "]: " + icf.getClass().getName()); - } - if (!InitialContextFactory.class.isAssignableFrom(icfClass)) { - throw new IllegalArgumentException( - "Specified class does not implement [" + InitialContextFactory.class.getName() + "]: " + icf); - } - try { - return (InitialContextFactory) icfClass.newInstance(); - } - catch (Throwable ex) { - IllegalStateException ise = - new IllegalStateException("Cannot instantiate specified InitialContextFactory: " + icf); - ise.initCause(ex); - throw ise; - } - } - } - - // Default case... - return new InitialContextFactory() { - @SuppressWarnings("unchecked") - public Context getInitialContext(Hashtable environment) { - return new SimpleNamingContext("", boundObjects, (Hashtable) environment); - } - }; - } - -} diff --git a/spring-context/src/test/java/org/springframework/mock/jndi/package-info.java b/spring-context/src/test/java/org/springframework/mock/jndi/package-info.java deleted file mode 100644 index 9c268b0f676..00000000000 --- a/spring-context/src/test/java/org/springframework/mock/jndi/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * The simplest implementation of the JNDI SPI that could possibly work. - * - *

Useful for setting up a simple JNDI environment for test suites - * or standalone applications. If e.g. JDBC DataSources get bound to the - * same JNDI names as within a J2EE container, both application code and - * configuration can me reused without changes. - */ - -package org.springframework.mock.jndi; diff --git a/spring-context/src/test/java/org/springframework/remoting/rmi/RmiSupportTests.java b/spring-context/src/test/java/org/springframework/remoting/rmi/RmiSupportTests.java index dbb46d53859..1c492f3759a 100644 --- a/spring-context/src/test/java/org/springframework/remoting/rmi/RmiSupportTests.java +++ b/spring-context/src/test/java/org/springframework/remoting/rmi/RmiSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -322,18 +322,23 @@ public class RmiSupportTests extends TestCase { final Method setNameMethod = rb.getClass().getDeclaredMethod("setName", new Class[] {String.class}); MethodInvocation mi = new MethodInvocation() { + @Override public Method getMethod() { return setNameMethod; } + @Override public Object[] getArguments() { return new Object[] {"bla"}; } + @Override public Object proceed() throws Throwable { throw new UnsupportedOperationException(); } + @Override public Object getThis() { return rb; } + @Override public AccessibleObject getStaticPart() { return setNameMethod; } @@ -363,11 +368,14 @@ public class RmiSupportTests extends TestCase { public void testRmiInvokerWithSpecialLocalMethods() throws Exception { String serviceUrl = "rmi://localhost:1090/test"; RmiProxyFactoryBean factory = new RmiProxyFactoryBean() { + @Override protected Remote lookupStub() { return new RmiInvocationHandler() { + @Override public String getTargetInterfaceName() { return null; } + @Override public Object invoke(RemoteInvocation invocation) throws RemoteException { throw new RemoteException(); } @@ -400,6 +408,7 @@ public class RmiSupportTests extends TestCase { private int counter = 0; + @Override protected Remote lookupStub() { counter++; return new RemoteBean(); @@ -432,6 +441,7 @@ public class RmiSupportTests extends TestCase { private static String name; + @Override public void setName(String nam) throws RemoteException { if (nam != null && nam.endsWith("Exception")) { RemoteException rex = null; diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java index be6ef187d25..86116151934 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -116,16 +116,19 @@ public class AsyncAnnotationBeanPostProcessorTests { private final CountDownLatch latch = new CountDownLatch(1); + @Override public Thread getThread() { return this.thread; } + @Override @Async public void test() { this.thread = Thread.currentThread(); this.latch.countDown(); } + @Override public void await(long timeout) { try { this.latch.await(timeout, TimeUnit.MILLISECONDS); diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java index f5f0aca4357..f679713eb96 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -20,6 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.concurrent.Future; +import org.junit.Before; import org.junit.Test; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; @@ -28,6 +29,8 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.support.GenericApplicationContext; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import static org.junit.Assert.*; @@ -43,6 +46,10 @@ public class AsyncExecutionTests { private static int listenerConstructed = 0; + @Before + public void setUp() { + Assume.group(TestGroup.PERFORMANCE); + } @Test public void asyncMethods() throws Exception { @@ -248,10 +255,12 @@ public class AsyncExecutionTests { public static class AsyncInterfaceBean implements AsyncInterface { + @Override public void doSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); } + @Override public Future returnSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); return new AsyncResult(Integer.toString(i)); @@ -273,14 +282,17 @@ public class AsyncExecutionTests { public static class AsyncMethodsInterfaceBean implements AsyncMethodsInterface { + @Override public void doNothing(int i) { assertTrue(Thread.currentThread().getName().equals(originalThreadName)); } + @Override public void doSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); } + @Override public Future returnSomething(int i) { assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); return new AsyncResult(Integer.toString(i)); @@ -290,6 +302,7 @@ public class AsyncExecutionTests { public static class AsyncMethodListener implements ApplicationListener { + @Override @Async public void onApplicationEvent(ApplicationEvent event) { listenerCalled++; @@ -305,6 +318,7 @@ public class AsyncExecutionTests { listenerConstructed++; } + @Override public void onApplicationEvent(ApplicationEvent event) { listenerCalled++; assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java index e96c31f7395..3b3329e0d95 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java @@ -247,6 +247,7 @@ public class EnableAsyncTests { return new AsyncBean(); } + @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("Custom-"); diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java index 9cab4804834..60f96bdb175 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java @@ -19,8 +19,11 @@ package org.springframework.scheduling.annotation; import java.util.Date; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Before; import org.junit.Test; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -43,6 +46,11 @@ import static org.junit.Assert.*; */ public class EnableSchedulingTests { + @Before + public void setUp() { + Assume.group(TestGroup.PERFORMANCE); + } + @Test public void withFixedRateTask() throws InterruptedException { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); @@ -216,6 +224,7 @@ public class EnableSchedulingTests { return null; } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler1()); } @@ -318,6 +327,7 @@ public class EnableSchedulingTests { return new ThreadAwareWorker(); } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler2()); } @@ -378,6 +388,7 @@ public class EnableSchedulingTests { return scheduler; } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler2()); } @@ -410,10 +421,12 @@ public class EnableSchedulingTests { return new ThreadPoolTaskScheduler(); } + @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler()); taskRegistrar.addFixedRateTask(new IntervalTask( new Runnable() { + @Override public void run() { worker().executedByThread = Thread.currentThread().getName(); } @@ -449,11 +462,13 @@ public class EnableSchedulingTests { scheduler.initialize(); scheduler.schedule( new Runnable() { + @Override public void run() { counter().incrementAndGet(); } }, new Trigger() { + @Override public Date nextExecutionTime(TriggerContext triggerContext) { return new Date(new Date().getTime()+10); } diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessorTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessorTests.java index 4bde3261190..e100da3d47d 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,6 @@ import java.util.List; import java.util.Properties; import org.junit.Test; - import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.BeanDefinition; @@ -37,6 +36,8 @@ import org.springframework.scheduling.config.CronTask; import org.springframework.scheduling.config.IntervalTask; import org.springframework.scheduling.config.ScheduledTaskRegistrar; import org.springframework.scheduling.support.ScheduledMethodRunnable; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import static org.junit.Assert.*; @@ -130,6 +131,8 @@ public class ScheduledAnnotationBeanPostProcessorTests { @Test public void cronTask() throws InterruptedException { + Assume.group(TestGroup.LONG_RUNNING); + StaticApplicationContext context = new StaticApplicationContext(); BeanDefinition processorDefinition = new RootBeanDefinition(ScheduledAnnotationBeanPostProcessor.class); BeanDefinition targetDefinition = new RootBeanDefinition( diff --git a/spring-context/src/test/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutorTests.java b/spring-context/src/test/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutorTests.java index 0d8729dfdf3..eee6c1029a1 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutorTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/backportconcurrent/ConcurrentTaskExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -24,6 +24,7 @@ import org.springframework.core.task.NoOpRunnable; * @author Rick Evans * @author Juergen Hoeller */ +@Deprecated public class ConcurrentTaskExecutorTests extends TestCase { public void testZeroArgCtorResultsInDefaultTaskExecutorBeingUsed() throws Exception { diff --git a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java index 0b0f791cc54..4f5b69735ec 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,24 +16,20 @@ package org.springframework.scheduling.concurrent; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; -import junit.framework.AssertionFailedError; - -import org.easymock.MockControl; import org.junit.Ignore; import org.junit.Test; import org.springframework.core.task.NoOpRunnable; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; +import static org.junit.Assert.*; +import static org.mockito.BDDMockito.*; import static org.mockito.Mockito.*; - /** * @author Rick Evans * @author Juergen Hoeller @@ -58,13 +54,10 @@ public class ScheduledExecutorFactoryBeanTests { @Test @SuppressWarnings("serial") public void testShutdownNowIsPropagatedToTheExecutorOnDestroy() throws Exception { - MockControl mockScheduledExecutorService = MockControl.createNiceControl(ScheduledExecutorService.class); - final ScheduledExecutorService executor = (ScheduledExecutorService) mockScheduledExecutorService.getMock(); - executor.shutdownNow(); - mockScheduledExecutorService.setReturnValue(null); - mockScheduledExecutorService.replay(); + final ScheduledExecutorService executor = mock(ScheduledExecutorService.class); ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { return executor; } @@ -75,19 +68,16 @@ public class ScheduledExecutorFactoryBeanTests { factory.afterPropertiesSet(); factory.destroy(); - mockScheduledExecutorService.verify(); + verify(executor).shutdownNow(); } @Test @SuppressWarnings("serial") public void testShutdownIsPropagatedToTheExecutorOnDestroy() throws Exception { - MockControl mockScheduledExecutorService = MockControl.createNiceControl(ScheduledExecutorService.class); - final ScheduledExecutorService executor = (ScheduledExecutorService) mockScheduledExecutorService.getMock(); - executor.shutdown(); - mockScheduledExecutorService.setVoidCallable(); - mockScheduledExecutorService.replay(); + final ScheduledExecutorService executor = mock(ScheduledExecutorService.class); ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { return executor; } @@ -99,16 +89,14 @@ public class ScheduledExecutorFactoryBeanTests { factory.afterPropertiesSet(); factory.destroy(); - mockScheduledExecutorService.verify(); + verify(executor).shutdown(); } @Test public void testOneTimeExecutionIsSetUpAndFiresCorrectly() throws Exception { - MockControl mockRunnable = MockControl.createControl(Runnable.class); - Runnable runnable = (Runnable) mockRunnable.getMock(); - runnable.run(); - mockRunnable.setVoidCallable(); - mockRunnable.replay(); + Assume.group(TestGroup.PERFORMANCE); + + Runnable runnable = mock(Runnable.class); ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean(); factory.setScheduledExecutorTasks(new ScheduledExecutorTask[]{ @@ -118,18 +106,14 @@ public class ScheduledExecutorFactoryBeanTests { pauseToLetTaskStart(1); factory.destroy(); - mockRunnable.verify(); + verify(runnable).run(); } @Test public void testFixedRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exception { - MockControl mockRunnable = MockControl.createControl(Runnable.class); - Runnable runnable = (Runnable) mockRunnable.getMock(); - runnable.run(); - mockRunnable.setVoidCallable(); - runnable.run(); - mockRunnable.setVoidCallable(); - mockRunnable.replay(); + Assume.group(TestGroup.PERFORMANCE); + + Runnable runnable = mock(Runnable.class); ScheduledExecutorTask task = new ScheduledExecutorTask(runnable); task.setPeriod(500); @@ -141,18 +125,15 @@ public class ScheduledExecutorFactoryBeanTests { pauseToLetTaskStart(2); factory.destroy(); - mockRunnable.verify(); + verify(runnable, atLeast(2)).run(); } @Test public void testFixedRepeatedExecutionIsSetUpAndFiresCorrectlyAfterException() throws Exception { - MockControl mockRunnable = MockControl.createControl(Runnable.class); - Runnable runnable = (Runnable) mockRunnable.getMock(); - runnable.run(); - mockRunnable.setThrowable(new IllegalStateException()); - runnable.run(); - mockRunnable.setThrowable(new IllegalStateException()); - mockRunnable.replay(); + Assume.group(TestGroup.PERFORMANCE); + + Runnable runnable = mock(Runnable.class); + willThrow(new IllegalStateException()).given(runnable).run(); ScheduledExecutorTask task = new ScheduledExecutorTask(runnable); task.setPeriod(500); @@ -165,19 +146,13 @@ public class ScheduledExecutorFactoryBeanTests { pauseToLetTaskStart(2); factory.destroy(); - mockRunnable.verify(); + verify(runnable, atLeast(2)).run(); } @Ignore @Test public void testWithInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exception { - MockControl mockRunnable = MockControl.createControl(Runnable.class); - Runnable runnable = (Runnable) mockRunnable.getMock(); - runnable.run(); - mockRunnable.setVoidCallable(); - runnable.run(); - mockRunnable.setVoidCallable(); - mockRunnable.replay(); + Runnable runnable = mock(Runnable.class); ScheduledExecutorTask task = new ScheduledExecutorTask(runnable); task.setPeriod(500); @@ -190,24 +165,15 @@ public class ScheduledExecutorFactoryBeanTests { // invoke destroy before tasks have even been scheduled... factory.destroy(); - try { - mockRunnable.verify(); - fail("Mock must never have been called"); - } - catch (AssertionFailedError expected) { - } + // Mock must never have been called + verify(runnable, never()).run(); } @Ignore @Test public void testWithInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectlyAfterException() throws Exception { - MockControl mockRunnable = MockControl.createControl(Runnable.class); - Runnable runnable = (Runnable) mockRunnable.getMock(); - runnable.run(); - mockRunnable.setThrowable(new IllegalStateException()); - runnable.run(); - mockRunnable.setThrowable(new IllegalStateException()); - mockRunnable.replay(); + Runnable runnable = mock(Runnable.class); + willThrow(new IllegalStateException()).given(runnable).run(); ScheduledExecutorTask task = new ScheduledExecutorTask(runnable); task.setPeriod(500); @@ -221,18 +187,15 @@ public class ScheduledExecutorFactoryBeanTests { // invoke destroy before tasks have even been scheduled... factory.destroy(); - try { - mockRunnable.verify(); - fail("Mock must never have been called"); - } - catch (AssertionFailedError expected) { - } + // Mock must never have been called + verify(runnable, never()).run(); } @Test @SuppressWarnings("serial") public void testSettingThreadFactoryToNullForcesUseOfDefaultButIsOtherwiseCool() throws Exception { ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { assertNotNull("Bah; the setThreadFactory(..) method must use a default ThreadFactory if a null arg is passed in."); return super.createExecutor(poolSize, threadFactory, rejectedExecutionHandler); @@ -250,6 +213,7 @@ public class ScheduledExecutorFactoryBeanTests { @SuppressWarnings("serial") public void testSettingRejectedExecutionHandlerToNullForcesUseOfDefaultButIsOtherwiseCool() throws Exception { ScheduledExecutorFactoryBean factory = new ScheduledExecutorFactoryBean() { + @Override protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { assertNotNull("Bah; the setRejectedExecutionHandler(..) method must use a default RejectedExecutionHandler if a null arg is passed in."); return super.createExecutor(poolSize, threadFactory, rejectedExecutionHandler); diff --git a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java index 7d3b05f6319..7320cea1d19 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -239,6 +239,7 @@ public class ThreadPoolTaskSchedulerTests { this.latch = new CountDownLatch(expectedRunCount); } + @Override public void run() { lastThread = Thread.currentThread(); if (actualRunCount.incrementAndGet() > expectedRunCount) { @@ -259,6 +260,7 @@ public class ThreadPoolTaskSchedulerTests { this.expectedRunCount = expectedRunCount; } + @Override public String call() throws Exception { if (actualRunCount.incrementAndGet() > expectedRunCount) { throw new RuntimeException("intentional test failure"); @@ -278,6 +280,7 @@ public class ThreadPoolTaskSchedulerTests { this.latch = new CountDownLatch(expectedErrorCount); } + @Override public void handleError(Throwable t) { this.lastError = t; this.latch.countDown(); @@ -295,6 +298,7 @@ public class ThreadPoolTaskSchedulerTests { this.maxRunCount = maxRunCount; } + @Override public Date nextExecutionTime(TriggerContext triggerContext) { if (this.actualRunCount.incrementAndGet() > this.maxRunCount) { return null; diff --git a/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java b/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java index 3425f60db59..74e3d76639c 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -56,6 +56,7 @@ public class ExecutorBeanDefinitionParserTests { assertEquals(60, getKeepAliveSeconds(executor)); assertEquals(false, getAllowCoreThreadTimeOut(executor)); FutureTask task = new FutureTask(new Callable() { + @Override public String call() throws Exception { return "foo"; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java b/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java index 921a5c4e117..697c747d337 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java @@ -123,6 +123,7 @@ public class ScheduledTasksBeanDefinitionParserTests { static class TestTrigger implements Trigger { + @Override public Date nextExecutionTime(TriggerContext triggerContext) { return null; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/support/PeriodicTriggerTests.java b/spring-context/src/test/java/org/springframework/scheduling/support/PeriodicTriggerTests.java index c0faca5e685..5d6aec6f41f 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/support/PeriodicTriggerTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/support/PeriodicTriggerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -254,14 +254,17 @@ public class PeriodicTriggerTests { this.completion = completion; } + @Override public Date lastActualExecutionTime() { return this.actual; } + @Override public Date lastCompletionTime() { return this.completion; } + @Override public Date lastScheduledExecutionTime() { return this.scheduled; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java b/spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java index 2659b23576b..3beaf36b84a 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -23,12 +23,13 @@ import java.util.TimerTask; import junit.framework.TestCase; -import org.springframework.scheduling.TestMethodInvokingTask; +import org.springframework.tests.context.TestMethodInvokingTask; /** * @author Juergen Hoeller * @since 20.02.2004 */ +@Deprecated public class TimerSupportTests extends TestCase { public void testTimerFactoryBean() throws Exception { @@ -50,27 +51,32 @@ public class TimerSupportTests extends TestCase { final List success = new ArrayList(3); final Timer timer = new Timer(true) { + @Override public void schedule(TimerTask task, long delay, long period) { if (task == timerTask0 && delay == 0 && period == 10) { success.add(Boolean.TRUE); } } + @Override public void scheduleAtFixedRate(TimerTask task, long delay, long period) { if (task == timerTask1 && delay == 10 && period == 20) { success.add(Boolean.TRUE); } } + @Override public void schedule(TimerTask task, long delay) { if (task instanceof DelegatingTimerTask && delay == 20) { success.add(Boolean.TRUE); } } + @Override public void cancel() { success.add(Boolean.TRUE); } }; TimerFactoryBean timerFactoryBean = new TimerFactoryBean() { + @Override protected Timer createTimer(String name, boolean daemon) { return timer; } @@ -104,6 +110,7 @@ public class TimerSupportTests extends TestCase { private int counter = 0; + @Override public void run() { counter++; } @@ -114,6 +121,7 @@ public class TimerSupportTests extends TestCase { private int counter = 0; + @Override public void run() { counter++; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/timer/TimerTaskExecutorTests.java b/spring-context/src/test/java/org/springframework/scheduling/timer/TimerTaskExecutorTests.java index 0655210a429..c9397abba4b 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/timer/TimerTaskExecutorTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/timer/TimerTaskExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -28,6 +28,7 @@ import org.junit.Test; * @author Rick Evans * @author Chris Beams */ +@Deprecated public final class TimerTaskExecutorTests { @Test(expected=IllegalArgumentException.class) @@ -96,6 +97,7 @@ public final class TimerTaskExecutorTests { TimerTaskExecutor executor = new TimerTaskExecutor() { + @Override protected Timer createTimer() { return timer; } @@ -129,6 +131,7 @@ public final class TimerTaskExecutorTests { return this.createTimerWasCalled; } + @Override protected Timer createTimer() { this.createTimerWasCalled = true; return super.createTimer(); @@ -146,6 +149,7 @@ public final class TimerTaskExecutorTests { } + @Override public void cancel() { this.cancelWasCalled = true; super.cancel(); @@ -166,6 +170,7 @@ public final class TimerTaskExecutorTests { } + @Override public void run() { this.runWasCalled = true; synchronized (monitor) { @@ -176,6 +181,7 @@ public final class TimerTaskExecutorTests { private static final class NoOpRunnable implements Runnable { + @Override public void run() { // explicit no-op } diff --git a/spring-context/src/test/java/org/springframework/scripting/ContextScriptBean.java b/spring-context/src/test/java/org/springframework/scripting/ContextScriptBean.java index 052209d92f8..8c9a0ae2b87 100644 --- a/spring-context/src/test/java/org/springframework/scripting/ContextScriptBean.java +++ b/spring-context/src/test/java/org/springframework/scripting/ContextScriptBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.scripting; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; /** diff --git a/spring-context/src/test/java/org/springframework/scripting/ScriptBean.java b/spring-context/src/test/java/org/springframework/scripting/ScriptBean.java index 95e40c10980..2bc727e4b4b 100644 --- a/spring-context/src/test/java/org/springframework/scripting/ScriptBean.java +++ b/spring-context/src/test/java/org/springframework/scripting/ScriptBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/scripting/TestBeanAwareMessenger.java b/spring-context/src/test/java/org/springframework/scripting/TestBeanAwareMessenger.java index ddc139475cc..7ea2ee25901 100644 --- a/spring-context/src/test/java/org/springframework/scripting/TestBeanAwareMessenger.java +++ b/spring-context/src/test/java/org/springframework/scripting/TestBeanAwareMessenger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.scripting; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Juergen Hoeller diff --git a/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java index 90582292d41..05601840108 100644 --- a/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -16,15 +16,17 @@ package org.springframework.scripting.bsh; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; + import java.util.Arrays; import java.util.Collection; import junit.framework.TestCase; -import org.easymock.MockControl; import org.springframework.aop.support.AopUtils; import org.springframework.aop.target.dynamic.Refreshable; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationEvent; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -189,14 +191,10 @@ public class BshScriptFactoryTests extends TestCase { } public void testScriptThatCompilesButIsJustPlainBad() throws Exception { - MockControl mock = MockControl.createControl(ScriptSource.class); - ScriptSource script = (ScriptSource) mock.getMock(); - script.getScriptAsString(); + ScriptSource script = mock(ScriptSource.class); final String badScript = "String getMessage() { throw new IllegalArgumentException(); }"; - mock.setReturnValue(badScript); - script.isModified(); - mock.setReturnValue(true); - mock.replay(); + given(script.getScriptAsString()).willReturn(badScript); + given(script.isModified()).willReturn(true); BshScriptFactory factory = new BshScriptFactory( ScriptFactoryPostProcessor.INLINE_SCRIPT_PREFIX + badScript, new Class[] {Messenger.class}); @@ -207,7 +205,6 @@ public class BshScriptFactoryTests extends TestCase { } catch (BshScriptUtils.BshExecutionException expected) { } - mock.verify(); } public void testCtorWithNullScriptSourceLocator() throws Exception { diff --git a/spring-context/src/test/java/org/springframework/scripting/bsh/MessengerImpl.bsh b/spring-context/src/test/java/org/springframework/scripting/bsh/MessengerImpl.bsh index 62bfe8b7bf3..72a1e6a39c4 100644 --- a/spring-context/src/test/java/org/springframework/scripting/bsh/MessengerImpl.bsh +++ b/spring-context/src/test/java/org/springframework/scripting/bsh/MessengerImpl.bsh @@ -1,4 +1,4 @@ -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.scripting.TestBeanAwareMessenger; public class MyMessenger implements TestBeanAwareMessenger { diff --git a/spring-context/src/test/java/org/springframework/scripting/bsh/bsh-with-xsd.xml b/spring-context/src/test/java/org/springframework/scripting/bsh/bsh-with-xsd.xml index 5908749d75c..116a7d6ab44 100644 --- a/spring-context/src/test/java/org/springframework/scripting/bsh/bsh-with-xsd.xml +++ b/spring-context/src/test/java/org/springframework/scripting/bsh/bsh-with-xsd.xml @@ -36,7 +36,7 @@ autowire="byName" init-method="init" destroy-method="destroy"> - + diff --git a/spring-context/src/test/java/org/springframework/scripting/config/OtherTestBean.java b/spring-context/src/test/java/org/springframework/scripting/config/OtherTestBean.java index 4a542c0c6e4..c2648628ea4 100644 --- a/spring-context/src/test/java/org/springframework/scripting/config/OtherTestBean.java +++ b/spring-context/src/test/java/org/springframework/scripting/config/OtherTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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,14 +21,17 @@ package org.springframework.scripting.config; */ public class OtherTestBean implements ITestBean { + @Override public ITestBean getOtherBean() { return null; } + @Override public boolean isInitialized() { return false; } + @Override public boolean isDestroyed() { return false; } diff --git a/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java b/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java index fc19107ced6..5e85cc6424f 100644 --- a/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/ConcreteMessenger.java b/spring-context/src/test/java/org/springframework/scripting/groovy/ConcreteMessenger.java index 6aab4f5df39..030ac6b0463 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/ConcreteMessenger.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/ConcreteMessenger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -26,10 +26,12 @@ public class ConcreteMessenger implements ConfigurableMessenger { private String message; + @Override public String getMessage() { return message; } + @Override public void setMessage(String message) { this.message = message; } diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyClassLoadingTests.java b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyClassLoadingTests.java index 132d9211c05..78e61a0607f 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyClassLoadingTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyClassLoadingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java index 763827a05a0..96d3db7fdf2 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -23,6 +23,8 @@ import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; import groovy.lang.DelegatingMetaClass; import groovy.lang.GroovyObject; @@ -30,12 +32,12 @@ import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Map; -import org.easymock.EasyMock; +import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.aop.target.dynamic.Refreshable; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.UnsatisfiedDependencyException; @@ -52,6 +54,8 @@ import org.springframework.scripting.ScriptCompilationException; import org.springframework.scripting.ScriptSource; import org.springframework.scripting.support.ScriptFactoryPostProcessor; import org.springframework.stereotype.Component; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; /** * @author Rob Harrop @@ -63,6 +67,11 @@ import org.springframework.stereotype.Component; */ public class GroovyScriptFactoryTests { + @Before + public void setUp() { + Assume.group(TestGroup.LONG_RUNNING); + } + @Test public void testStaticScript() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("groovyContext.xml", getClass()); @@ -193,11 +202,10 @@ public class GroovyScriptFactoryTests { @Test public void testScriptedClassThatDoesNotHaveANoArgCtor() throws Exception { - ScriptSource script = EasyMock.createMock(ScriptSource.class); + ScriptSource script = mock(ScriptSource.class); final String badScript = "class Foo { public Foo(String foo) {}}"; - EasyMock.expect(script.getScriptAsString()).andReturn(badScript); - EasyMock.expect(script.suggestedClassName()).andReturn("someName"); - EasyMock.replay(script); + given(script.getScriptAsString()).willReturn(badScript); + given(script.suggestedClassName()).willReturn("someName"); GroovyScriptFactory factory = new GroovyScriptFactory(ScriptFactoryPostProcessor.INLINE_SCRIPT_PREFIX + badScript); try { @@ -206,16 +214,14 @@ public class GroovyScriptFactoryTests { } catch (ScriptCompilationException expected) { assertTrue(expected.contains(InstantiationException.class)); } - EasyMock.verify(script); } @Test public void testScriptedClassThatHasNoPublicNoArgCtor() throws Exception { - ScriptSource script = EasyMock.createMock(ScriptSource.class); + ScriptSource script = mock(ScriptSource.class); final String badScript = "class Foo { protected Foo() {}}"; - EasyMock.expect(script.getScriptAsString()).andReturn(badScript); - EasyMock.expect(script.suggestedClassName()).andReturn("someName"); - EasyMock.replay(script); + given(script.getScriptAsString()).willReturn(badScript); + given(script.suggestedClassName()).willReturn("someName"); GroovyScriptFactory factory = new GroovyScriptFactory(ScriptFactoryPostProcessor.INLINE_SCRIPT_PREFIX + badScript); try { @@ -224,7 +230,6 @@ public class GroovyScriptFactoryTests { } catch (ScriptCompilationException expected) { assertTrue(expected.contains(IllegalAccessException.class)); } - EasyMock.verify(script); } @Test @@ -290,15 +295,13 @@ public class GroovyScriptFactoryTests { @Test public void testGetScriptedObjectDoesNotChokeOnNullInterfacesBeingPassedIn() throws Exception { - ScriptSource script = EasyMock.createMock(ScriptSource.class); - EasyMock.expect(script.getScriptAsString()).andReturn("class Bar {}"); - EasyMock.expect(script.suggestedClassName()).andReturn("someName"); - EasyMock.replay(script); + ScriptSource script = mock(ScriptSource.class); + given(script.getScriptAsString()).willReturn("class Bar {}"); + given(script.suggestedClassName()).willReturn("someName"); GroovyScriptFactory factory = new GroovyScriptFactory("a script source locator (doesn't matter here)"); Object scriptedObject = factory.getScriptedObject(script, null); assertNotNull(scriptedObject); - EasyMock.verify(script); } @Test @@ -401,6 +404,8 @@ public class GroovyScriptFactoryTests { @Test public void testAnonymousScriptDetected() throws Exception { + Assume.group(TestGroup.LONG_RUNNING); + ApplicationContext ctx = new ClassPathXmlApplicationContext("groovy-with-xsd.xml", getClass()); Map beans = ctx.getBeansOfType(Messenger.class); assertEquals(4, beans.size()); @@ -478,8 +483,10 @@ public class GroovyScriptFactoryTests { public static class TestCustomizer implements GroovyObjectCustomizer { + @Override public void customize(GroovyObject goo) { DelegatingMetaClass dmc = new DelegatingMetaClass(goo.getMetaClass()) { + @Override public Object invokeMethod(Object arg0, String mName, Object[] arg2) { if (mName.indexOf("Missing") != -1) { throw new IllegalStateException("Gotcha"); diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/LogUserAdvice.java b/spring-context/src/test/java/org/springframework/scripting/groovy/LogUserAdvice.java index a7066c828c0..28330777f3f 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/LogUserAdvice.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/LogUserAdvice.java @@ -11,6 +11,7 @@ public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice { private int countThrows = 0; + @Override public void before(Method method, Object[] objects, Object o) throws Throwable { countBefore++; System.out.println("Method:"+method.getName()); diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/ScriptBean.groovy b/spring-context/src/test/java/org/springframework/scripting/groovy/ScriptBean.groovy index d1b82bfece9..0b0116d2e10 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/ScriptBean.groovy +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/ScriptBean.groovy @@ -1,4 +1,4 @@ -import org.springframework.beans.TestBean +import org.springframework.tests.sample.beans.TestBean import org.springframework.context.ApplicationContext import org.springframework.context.ApplicationContextAware import org.springframework.scripting.ContextScriptBean diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/TestException.java b/spring-context/src/test/java/org/springframework/scripting/groovy/TestException.java index 95b21bcda2a..389b38d3b6f 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/TestException.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/TestException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/TestServiceImpl.java b/spring-context/src/test/java/org/springframework/scripting/groovy/TestServiceImpl.java index 749fc42fdef..ed90507212d 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/TestServiceImpl.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/TestServiceImpl.java @@ -2,6 +2,7 @@ package org.springframework.scripting.groovy; @Log public class TestServiceImpl implements TestService{ + @Override public String sayHello() { throw new TestException("TestServiceImpl"); } diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/groovy-multiple-properties.xml b/spring-context/src/test/java/org/springframework/scripting/groovy/groovy-multiple-properties.xml index 58ce5e022aa..eaad85d1f8c 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/groovy-multiple-properties.xml +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/groovy-multiple-properties.xml @@ -19,6 +19,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-beanNameAutoProxyCreator.xml b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-beanNameAutoProxyCreator.xml index a8afa2447f8..1516ac2dbc4 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-beanNameAutoProxyCreator.xml +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-beanNameAutoProxyCreator.xml @@ -16,6 +16,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-factoryBean.xml b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-factoryBean.xml index 3744ad4ea62..2cd55ee7df6 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-factoryBean.xml +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests-factoryBean.xml @@ -16,6 +16,6 @@ - + diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests.java index a3791761801..0e29267700c 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/AdvisedJRubyScriptFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -25,10 +25,9 @@ import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.scripting.Messenger; +import org.springframework.tests.aop.advice.CountingBeforeAdvice; import org.springframework.util.MBeanTestUtils; -import test.advice.CountingBeforeAdvice; - /** * @author Rob Harrop * @author Chris Beams diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/JRubyScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/jruby/JRubyScriptFactoryTests.java index cc7e1ce392f..55f3016d81b 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/JRubyScriptFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/JRubyScriptFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -18,12 +18,11 @@ package org.springframework.scripting.jruby; import java.util.Map; -import junit.framework.TestCase; -import junit.framework.Assert; - +import org.junit.Before; +import org.junit.Test; import org.springframework.aop.support.AopUtils; import org.springframework.aop.target.dynamic.Refreshable; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -32,13 +31,18 @@ import org.springframework.scripting.ConfigurableMessenger; import org.springframework.scripting.Messenger; import org.springframework.scripting.ScriptCompilationException; import org.springframework.scripting.TestBeanAwareMessenger; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; + +import static org.junit.Assert.*; /** * @author Rob Harrop * @author Rick Evans * @author Juergen Hoeller + * @author Chris Beams */ -public class JRubyScriptFactoryTests extends TestCase { +public class JRubyScriptFactoryTests { private static final String RUBY_SCRIPT_SOURCE_LOCATOR = "inline:require 'java'\n" + @@ -46,7 +50,12 @@ public class JRubyScriptFactoryTests extends TestCase { "end\n" + "RubyBar.new"; + @Before + public void setUp() { + Assume.group(TestGroup.LONG_RUNNING); + } + @Test public void testStaticScript() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jrubyContext.xml", getClass()); Calculator calc = (Calculator) ctx.getBean("calculator"); @@ -55,16 +64,17 @@ public class JRubyScriptFactoryTests extends TestCase { assertFalse("Scripted object should not be instance of Refreshable", calc instanceof Refreshable); assertFalse("Scripted object should not be instance of Refreshable", messenger instanceof Refreshable); - Assert.assertEquals(calc, calc); - Assert.assertEquals(messenger, messenger); + assertEquals(calc, calc); + assertEquals(messenger, messenger); assertTrue(!messenger.equals(calc)); assertNotSame(messenger.hashCode(), calc.hashCode()); assertTrue(!messenger.toString().equals(calc.toString())); String desiredMessage = "Hello World!"; - Assert.assertEquals("Message is incorrect", desiredMessage, messenger.getMessage()); + assertEquals("Message is incorrect", desiredMessage, messenger.getMessage()); } + @Test public void testNonStaticScript() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jrubyRefreshableContext.xml", getClass()); Messenger messenger = (Messenger) ctx.getBean("messenger"); @@ -73,15 +83,16 @@ public class JRubyScriptFactoryTests extends TestCase { assertTrue("Should be an instance of Refreshable", messenger instanceof Refreshable); String desiredMessage = "Hello World!"; - Assert.assertEquals("Message is incorrect.", desiredMessage, messenger.getMessage()); + assertEquals("Message is incorrect.", desiredMessage, messenger.getMessage()); Refreshable refreshable = (Refreshable) messenger; refreshable.refresh(); - Assert.assertEquals("Message is incorrect after refresh.", desiredMessage, messenger.getMessage()); + assertEquals("Message is incorrect after refresh.", desiredMessage, messenger.getMessage()); assertEquals("Incorrect refresh count", 2, refreshable.getRefreshCount()); } + @Test public void testScriptCompilationException() throws Exception { try { new ClassPathXmlApplicationContext("jrubyBrokenContext.xml", getClass()); @@ -92,6 +103,7 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testCtorWithNullScriptSourceLocator() throws Exception { try { new JRubyScriptFactory(null, new Class[]{Messenger.class}); @@ -101,6 +113,7 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testCtorWithEmptyScriptSourceLocator() throws Exception { try { new JRubyScriptFactory("", new Class[]{Messenger.class}); @@ -110,6 +123,7 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testCtorWithWhitespacedScriptSourceLocator() throws Exception { try { new JRubyScriptFactory("\n ", new Class[]{Messenger.class}); @@ -119,6 +133,7 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testCtorWithNullScriptInterfacesArray() throws Exception { try { new JRubyScriptFactory(RUBY_SCRIPT_SOURCE_LOCATOR, null); @@ -128,6 +143,7 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testCtorWithEmptyScriptInterfacesArray() throws Exception { try { new JRubyScriptFactory(RUBY_SCRIPT_SOURCE_LOCATOR, new Class[]{}); @@ -137,21 +153,23 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testResourceScriptFromTag() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-with-xsd.xml", getClass()); TestBean testBean = (TestBean) ctx.getBean("testBean"); Messenger messenger = (Messenger) ctx.getBean("messenger"); - Assert.assertEquals("Hello World!", messenger.getMessage()); + assertEquals("Hello World!", messenger.getMessage()); assertFalse(messenger instanceof Refreshable); TestBeanAwareMessenger messengerByType = (TestBeanAwareMessenger) ctx.getBean("messengerByType"); - Assert.assertEquals(testBean, messengerByType.getTestBean()); + assertEquals(testBean, messengerByType.getTestBean()); TestBeanAwareMessenger messengerByName = (TestBeanAwareMessenger) ctx.getBean("messengerByName"); - Assert.assertEquals(testBean, messengerByName.getTestBean()); + assertEquals(testBean, messengerByName.getTestBean()); } + @Test public void testPrototypeScriptFromTag() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-with-xsd.xml", getClass()); ConfigurableMessenger messenger = (ConfigurableMessenger) ctx.getBean("messengerPrototype"); @@ -159,14 +177,15 @@ public class JRubyScriptFactoryTests extends TestCase { assertNotSame(messenger, messenger2); assertSame(messenger.getClass(), messenger2.getClass()); - Assert.assertEquals("Hello World!", messenger.getMessage()); - Assert.assertEquals("Hello World!", messenger2.getMessage()); + assertEquals("Hello World!", messenger.getMessage()); + assertEquals("Hello World!", messenger2.getMessage()); messenger.setMessage("Bye World!"); messenger2.setMessage("Byebye World!"); - Assert.assertEquals("Bye World!", messenger.getMessage()); - Assert.assertEquals("Byebye World!", messenger2.getMessage()); + assertEquals("Bye World!", messenger.getMessage()); + assertEquals("Byebye World!", messenger2.getMessage()); } + @Test public void testInlineScriptFromTag() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-with-xsd.xml", getClass()); Calculator calculator = (Calculator) ctx.getBean("calculator"); @@ -174,23 +193,25 @@ public class JRubyScriptFactoryTests extends TestCase { assertFalse(calculator instanceof Refreshable); } + @Test public void testRefreshableFromTag() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-with-xsd.xml", getClass()); Messenger messenger = (Messenger) ctx.getBean("refreshableMessenger"); - Assert.assertEquals("Hello World!", messenger.getMessage()); + assertEquals("Hello World!", messenger.getMessage()); assertTrue("Messenger should be Refreshable", messenger instanceof Refreshable); } public void testThatMultipleScriptInterfacesAreSupported() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-with-xsd.xml", getClass()); Messenger messenger = (Messenger) ctx.getBean("calculatingMessenger"); - Assert.assertEquals("Hello World!", messenger.getMessage()); + assertEquals("Hello World!", messenger.getMessage()); // cool, now check that the Calculator interface is also exposed Calculator calc = (Calculator) messenger; - Assert.assertEquals(0, calc.add(2, -2)); + assertEquals(0, calc.add(2, -2)); } + @Test public void testWithComplexArg() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jrubyContext.xml", getClass()); Printer printer = (Printer) ctx.getBean("printer"); @@ -199,6 +220,7 @@ public class JRubyScriptFactoryTests extends TestCase { assertEquals(1, printable.count); } + @Test public void testWithPrimitiveArgsInReturnTypeAndParameters() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jrubyContextForPrimitives.xml", getClass()); PrimitiveAdder adder = (PrimitiveAdder) ctx.getBean("adder"); @@ -212,6 +234,7 @@ public class JRubyScriptFactoryTests extends TestCase { assertEquals('c', adder.echo('c')); } + @Test public void testWithWrapperArgsInReturnTypeAndParameters() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jrubyContextForWrappers.xml", getClass()); WrapperAdder adder = (WrapperAdder) ctx.getBean("adder"); @@ -267,10 +290,11 @@ public class JRubyScriptFactoryTests extends TestCase { } } + @Test public void testAOP() throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext("jruby-aop.xml", getClass()); Messenger messenger = (Messenger) ctx.getBean("messenger"); - Assert.assertEquals(new StringBuffer("Hello World!").reverse().toString(), messenger.getMessage()); + assertEquals(new StringBuffer("Hello World!").reverse().toString(), messenger.getMessage()); } @@ -278,6 +302,7 @@ public class JRubyScriptFactoryTests extends TestCase { public int count; + @Override public String getContent() { this.count++; return "Hello World!"; diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/WrapperAdder.java b/spring-context/src/test/java/org/springframework/scripting/jruby/WrapperAdder.java index 3e0589c7b32..41a3749ca15 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/WrapperAdder.java +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/WrapperAdder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/org/springframework/scripting/jruby/jruby-with-xsd.xml b/spring-context/src/test/java/org/springframework/scripting/jruby/jruby-with-xsd.xml index 13f5d3c9aa0..5df3894c087 100644 --- a/spring-context/src/test/java/org/springframework/scripting/jruby/jruby-with-xsd.xml +++ b/spring-context/src/test/java/org/springframework/scripting/jruby/jruby-with-xsd.xml @@ -28,7 +28,7 @@ autowire="byName"> - + diff --git a/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java b/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java index dd39e655765..5a5b72715c5 100644 --- a/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,8 +16,8 @@ package org.springframework.scripting.support; +import static org.mockito.Mockito.mock; import junit.framework.TestCase; -import org.easymock.MockControl; import org.springframework.beans.factory.BeanFactory; @@ -27,15 +27,12 @@ import org.springframework.beans.factory.BeanFactory; public class RefreshableScriptTargetSourceTests extends TestCase { public void testCreateWithNullScriptSource() throws Exception { - MockControl mockFactory = MockControl.createNiceControl(BeanFactory.class); - mockFactory.replay(); try { - new RefreshableScriptTargetSource((BeanFactory) mockFactory.getMock(), "a.bean", null, null, false); + new RefreshableScriptTargetSource(mock(BeanFactory.class), "a.bean", null, null, false); fail("Must have failed when passed a null ScriptSource."); } catch (IllegalArgumentException expected) { } - mockFactory.verify(); } } diff --git a/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java b/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java index d77ff160840..e1fe7c848e0 100644 --- a/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -16,12 +16,14 @@ package org.springframework.scripting.support; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; + import java.io.ByteArrayInputStream; import java.io.IOException; import junit.framework.TestCase; -import org.easymock.MockControl; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; @@ -41,43 +43,29 @@ public class ResourceScriptSourceTests extends TestCase { } public void testDoesNotPropagateFatalExceptionOnResourceThatCannotBeResolvedToAFile() throws Exception { - MockControl mock = MockControl.createControl(Resource.class); - Resource resource = (Resource) mock.getMock(); - resource.lastModified(); - mock.setThrowable(new IOException()); - mock.replay(); + Resource resource = mock(Resource.class); + given(resource.lastModified()).willThrow(new IOException()); ResourceScriptSource scriptSource = new ResourceScriptSource(resource); long lastModified = scriptSource.retrieveLastModifiedTime(); assertEquals(0, lastModified); - mock.verify(); } public void testBeginsInModifiedState() throws Exception { - MockControl mock = MockControl.createControl(Resource.class); - Resource resource = (Resource) mock.getMock(); - mock.replay(); - + Resource resource = mock(Resource.class); ResourceScriptSource scriptSource = new ResourceScriptSource(resource); assertTrue(scriptSource.isModified()); - mock.verify(); } public void testLastModifiedWorksWithResourceThatDoesNotSupportFileBasedReading() throws Exception { - MockControl mock = MockControl.createControl(Resource.class); - Resource resource = (Resource) mock.getMock(); + Resource resource = mock(Resource.class); // underlying File is asked for so that the last modified time can be checked... - resource.lastModified(); - mock.setReturnValue(100, 2); + // And then mock the file changing; i.e. the File says it has been modified + given(resource.lastModified()).willReturn(100L, 100L, 200L); // does not support File-based reading; delegates to InputStream-style reading... //resource.getFile(); //mock.setThrowable(new FileNotFoundException()); - resource.getInputStream(); - mock.setReturnValue(new ByteArrayInputStream(new byte[0])); - // And then mock the file changing; i.e. the File says it has been modified - resource.lastModified(); - mock.setReturnValue(200); - mock.replay(); + given(resource.getInputStream()).willReturn(new ByteArrayInputStream(new byte[0])); ResourceScriptSource scriptSource = new ResourceScriptSource(resource); assertTrue("ResourceScriptSource must start off in the 'isModified' state (it obviously isn't).", scriptSource.isModified()); @@ -85,7 +73,6 @@ public class ResourceScriptSourceTests extends TestCase { assertFalse("ResourceScriptSource must not report back as being modified if the underlying File resource is not reporting a changed lastModified time.", scriptSource.isModified()); // Must now report back as having been modified assertTrue("ResourceScriptSource must report back as being modified if the underlying File resource is reporting a changed lastModified time.", scriptSource.isModified()); - mock.verify(); } public void testLastModifiedWorksWithResourceThatDoesNotSupportFileBasedAccessAtAll() throws Exception { diff --git a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java index db4323a318d..d561ac7e7eb 100644 --- a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,10 @@ package org.springframework.scripting.support; -import junit.framework.TestCase; -import org.easymock.MockControl; +import static org.mockito.Mockito.mock; + +import org.junit.Before; +import org.junit.Test; import org.springframework.beans.FatalBeanException; import org.springframework.beans.factory.BeanFactory; @@ -28,12 +30,17 @@ import org.springframework.context.support.GenericApplicationContext; import org.springframework.scripting.Messenger; import org.springframework.scripting.ScriptCompilationException; import org.springframework.scripting.groovy.GroovyScriptFactory; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; + +import static org.junit.Assert.*; /** * @author Rick Evans * @author Juergen Hoeller + * @author Chris Beams */ -public class ScriptFactoryPostProcessorTests extends TestCase { +public class ScriptFactoryPostProcessorTests { private static final String MESSAGE_TEXT = "Bingo"; @@ -69,23 +76,27 @@ public class ScriptFactoryPostProcessorTests extends TestCase { " }\n" + "}"; + @Before + public void setUp() { + Assume.group(TestGroup.PERFORMANCE); + } + @Test public void testDoesNothingWhenPostProcessingNonScriptFactoryTypeBeforeInstantiation() throws Exception { assertNull(new ScriptFactoryPostProcessor().postProcessBeforeInstantiation(getClass(), "a.bean")); } + @Test public void testThrowsExceptionIfGivenNonAbstractBeanFactoryImplementation() throws Exception { - MockControl mock = MockControl.createControl(BeanFactory.class); - mock.replay(); try { - new ScriptFactoryPostProcessor().setBeanFactory((BeanFactory) mock.getMock()); + new ScriptFactoryPostProcessor().setBeanFactory(mock(BeanFactory.class)); fail("Must have thrown exception by this point."); } catch (IllegalStateException expected) { } - mock.verify(); } + @Test public void testChangeScriptWithRefreshableBeanFunctionality() throws Exception { BeanDefinition processorBeanDefinition = createScriptFactoryPostProcessor(true); BeanDefinition scriptedBeanDefinition = createScriptedGroovyBean(); @@ -106,6 +117,7 @@ public class ScriptFactoryPostProcessorTests extends TestCase { assertEquals(EXPECTED_CHANGED_MESSAGE_TEXT, refreshedMessenger.getMessage()); } + @Test public void testChangeScriptWithNoRefreshableBeanFunctionality() throws Exception { BeanDefinition processorBeanDefinition = createScriptFactoryPostProcessor(false); BeanDefinition scriptedBeanDefinition = createScriptedGroovyBean(); @@ -126,6 +138,7 @@ public class ScriptFactoryPostProcessorTests extends TestCase { MESSAGE_TEXT, refreshedMessenger.getMessage()); } + @Test public void testRefreshedScriptReferencePropagatesToCollaborators() throws Exception { BeanDefinition processorBeanDefinition = createScriptFactoryPostProcessor(true); BeanDefinition scriptedBeanDefinition = createScriptedGroovyBean(); @@ -153,6 +166,7 @@ public class ScriptFactoryPostProcessorTests extends TestCase { assertEquals(EXPECTED_CHANGED_MESSAGE_TEXT, collaborator.getMessage()); } + @Test public void testReferencesAcrossAContainerHierarchy() throws Exception { GenericApplicationContext businessContext = new GenericApplicationContext(); businessContext.registerBeanDefinition("messenger", BeanDefinitionBuilder.rootBeanDefinition(StubMessenger.class).getBeanDefinition()); @@ -168,11 +182,13 @@ public class ScriptFactoryPostProcessorTests extends TestCase { presentationCtx.refresh(); } + @Test public void testScriptHavingAReferenceToAnotherBean() throws Exception { // just tests that the (singleton) script-backed bean is able to be instantiated with references to its collaborators new ClassPathXmlApplicationContext("org/springframework/scripting/support/groovyReferences.xml"); } + @Test public void testForRefreshedScriptHavingErrorPickedUpOnFirstCall() throws Exception { BeanDefinition processorBeanDefinition = createScriptFactoryPostProcessor(true); BeanDefinition scriptedBeanDefinition = createScriptedGroovyBean(); @@ -203,12 +219,13 @@ public class ScriptFactoryPostProcessorTests extends TestCase { } } + @Test public void testPrototypeScriptedBean() throws Exception { GenericApplicationContext ctx = new GenericApplicationContext(); ctx.registerBeanDefinition("messenger", BeanDefinitionBuilder.rootBeanDefinition(StubMessenger.class).getBeanDefinition()); BeanDefinitionBuilder scriptedBeanBuilder = BeanDefinitionBuilder.rootBeanDefinition(GroovyScriptFactory.class); - scriptedBeanBuilder.setSingleton(false); + scriptedBeanBuilder.setScope(BeanDefinition.SCOPE_PROTOTYPE); scriptedBeanBuilder.addConstructorArgValue(DELEGATING_SCRIPT); scriptedBeanBuilder.addPropertyReference("messenger", "messenger"); diff --git a/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java b/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java index 3a4ffb70436..7363033668d 100644 --- a/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java +++ b/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -25,10 +25,12 @@ public final class StubMessenger implements ConfigurableMessenger { private String message = "I used to be smart... now I'm just stupid."; + @Override public void setMessage(String message) { this.message = message; } + @Override public String getMessage() { return message; } diff --git a/spring-context/src/test/java/org/springframework/beans/factory/config/SimpleMapScope.java b/spring-context/src/test/java/org/springframework/tests/context/SimpleMapScope.java similarity index 90% rename from spring-context/src/test/java/org/springframework/beans/factory/config/SimpleMapScope.java rename to spring-context/src/test/java/org/springframework/tests/context/SimpleMapScope.java index 604d2595b01..9b63bfc3332 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/config/SimpleMapScope.java +++ b/spring-context/src/test/java/org/springframework/tests/context/SimpleMapScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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.beans.factory.config; +package org.springframework.tests.context; import java.io.Serializable; import java.util.HashMap; @@ -24,6 +24,7 @@ import java.util.List; import java.util.Map; import org.springframework.beans.factory.ObjectFactory; +import org.springframework.beans.factory.config.Scope; /** * @author Juergen Hoeller @@ -44,6 +45,7 @@ public class SimpleMapScope implements Scope, Serializable { } + @Override public Object get(String name, ObjectFactory objectFactory) { synchronized (this.map) { Object scopedObject = this.map.get(name); @@ -55,16 +57,19 @@ public class SimpleMapScope implements Scope, Serializable { } } + @Override public Object remove(String name) { synchronized (this.map) { return this.map.remove(name); } } + @Override public void registerDestructionCallback(String name, Runnable callback) { this.callbacks.add(callback); } + @Override public Object resolveContextualObject(String key) { return null; } @@ -76,6 +81,7 @@ public class SimpleMapScope implements Scope, Serializable { } } + @Override public String getConversationId() { return null; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java b/spring-context/src/test/java/org/springframework/tests/context/TestMethodInvokingTask.java similarity index 96% rename from spring-context/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java rename to spring-context/src/test/java/org/springframework/tests/context/TestMethodInvokingTask.java index a95a2408b54..118feabbc33 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/TestMethodInvokingTask.java +++ b/spring-context/src/test/java/org/springframework/tests/context/TestMethodInvokingTask.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.scheduling; +package org.springframework.tests.context; /** * @author Juergen Hoeller diff --git a/spring-context/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java b/spring-context/src/test/java/org/springframework/tests/mock/jndi/ExpectedLookupTemplate.java similarity index 95% rename from spring-context/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java rename to spring-context/src/test/java/org/springframework/tests/mock/jndi/ExpectedLookupTemplate.java index 10ae6d42837..a4e8932e26d 100644 --- a/spring-context/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java +++ b/spring-context/src/test/java/org/springframework/tests/mock/jndi/ExpectedLookupTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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.mock.jndi; +package org.springframework.tests.mock.jndi; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -70,6 +70,7 @@ public class ExpectedLookupTemplate extends JndiTemplate { * return the object provided in the constructor. If the name is * unexpected, a respective NamingException gets thrown. */ + @Override public Object lookup(String name) throws NamingException { Object object = this.jndiObjects.get(name); if (object == null) { diff --git a/spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java b/spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContext.java similarity index 94% rename from spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java rename to spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContext.java index c71d6e86810..bdad96e32d0 100644 --- a/spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContext.java +++ b/spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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.mock.jndi; +package org.springframework.tests.mock.jndi; import java.util.HashMap; import java.util.Hashtable; @@ -91,6 +91,7 @@ public class SimpleNamingContext implements Context { // Actual implementations of Context methods follow + @Override public NamingEnumeration list(String root) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Listing name/class pairs under [" + root + "]"); @@ -98,6 +99,7 @@ public class SimpleNamingContext implements Context { return new NameClassPairEnumeration(this, root); } + @Override public NamingEnumeration listBindings(String root) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Listing bindings under [" + root + "]"); @@ -111,6 +113,7 @@ public class SimpleNamingContext implements Context { * Will be used by any standard InitialContext JNDI lookups. * @throws javax.naming.NameNotFoundException if the object could not be found */ + @Override public Object lookup(String lookupName) throws NameNotFoundException { String name = this.root + lookupName; if (logger.isDebugEnabled()) { @@ -136,6 +139,7 @@ public class SimpleNamingContext implements Context { return found; } + @Override public Object lookupLink(String name) throws NameNotFoundException { return lookup(name); } @@ -145,8 +149,9 @@ public class SimpleNamingContext implements Context { * Note: Not intended for direct use by applications * if setting up a JVM-level JNDI environment. * Use SimpleNamingContextBuilder to set up JNDI bindings then. - * @see org.springframework.mock.jndi.SimpleNamingContextBuilder#bind + * @see org.springframework.tests.mock.jndi.SimpleNamingContextBuilder#bind */ + @Override public void bind(String name, Object obj) { if (logger.isInfoEnabled()) { logger.info("Static JNDI binding: [" + this.root + name + "] = [" + obj + "]"); @@ -154,6 +159,7 @@ public class SimpleNamingContext implements Context { this.boundObjects.put(this.root + name, obj); } + @Override public void unbind(String name) { if (logger.isInfoEnabled()) { logger.info("Static JNDI remove: [" + this.root + name + "]"); @@ -161,16 +167,19 @@ public class SimpleNamingContext implements Context { this.boundObjects.remove(this.root + name); } + @Override public void rebind(String name, Object obj) { bind(name, obj); } + @Override public void rename(String oldName, String newName) throws NameNotFoundException { Object obj = lookup(oldName); unbind(oldName); bind(newName, obj); } + @Override public Context createSubcontext(String name) { String subcontextName = this.root + name; if (!subcontextName.endsWith("/")) { @@ -181,84 +190,104 @@ public class SimpleNamingContext implements Context { return subcontext; } + @Override public void destroySubcontext(String name) { unbind(name); } + @Override public String composeName(String name, String prefix) { return prefix + name; } + @Override public Hashtable getEnvironment() { return this.environment; } + @Override public Object addToEnvironment(String propName, Object propVal) { return this.environment.put(propName, propVal); } + @Override public Object removeFromEnvironment(String propName) { return this.environment.remove(propName); } + @Override public void close() { } // Unsupported methods follow: no support for javax.naming.Name + @Override public NamingEnumeration list(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NamingEnumeration listBindings(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Object lookup(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Object lookupLink(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void bind(Name name, Object obj) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void unbind(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void rebind(Name name, Object obj) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void rename(Name oldName, Name newName) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Context createSubcontext(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public void destroySubcontext(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public String getNameInNamespace() throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NameParser getNameParser(Name name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public NameParser getNameParser(String name) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } + @Override public Name composeName(Name name, Name prefix) throws NamingException { throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]"); } @@ -298,22 +327,27 @@ public class SimpleNamingContext implements Context { protected abstract T createObject(String strippedName, Object obj); + @Override public boolean hasMore() { return this.iterator.hasNext(); } + @Override public T next() { return this.iterator.next(); } + @Override public boolean hasMoreElements() { return this.iterator.hasNext(); } + @Override public T nextElement() { return this.iterator.next(); } + @Override public void close() { } } @@ -325,6 +359,7 @@ public class SimpleNamingContext implements Context { super(context, root); } + @Override protected NameClassPair createObject(String strippedName, Object obj) { return new NameClassPair(strippedName, obj.getClass().getName()); } @@ -337,6 +372,7 @@ public class SimpleNamingContext implements Context { super(context, root); } + @Override protected Binding createObject(String strippedName, Object obj) { return new Binding(strippedName, obj); } diff --git a/spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContextBuilder.java similarity index 98% rename from spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java rename to spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContextBuilder.java index f21936897b3..3d1452ac29f 100644 --- a/spring-tx/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/spring-context/src/test/java/org/springframework/tests/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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.mock.jndi; +package org.springframework.tests.mock.jndi; import java.util.Hashtable; @@ -192,6 +192,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ + @Override public InitialContextFactory createInitialContextFactory(Hashtable environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); @@ -225,6 +226,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder // Default case... return new InitialContextFactory() { + @Override @SuppressWarnings("unchecked") public Context getInitialContext(Hashtable environment) { return new SimpleNamingContext("", boundObjects, (Hashtable) environment); diff --git a/spring-aop/src/test/java/test/util/TimeStamped.java b/spring-context/src/test/java/org/springframework/tests/mock/jndi/package-info.java similarity index 56% rename from spring-aop/src/test/java/test/util/TimeStamped.java rename to spring-context/src/test/java/org/springframework/tests/mock/jndi/package-info.java index 484d5dda44b..8847baab541 100644 --- a/spring-aop/src/test/java/test/util/TimeStamped.java +++ b/spring-context/src/test/java/org/springframework/tests/mock/jndi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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,21 +14,12 @@ * limitations under the License. */ -package test.util; - /** - * This interface can be implemented by cacheable objects or cache entries, - * to enable the freshness of objects to be checked. + * The simplest implementation of the JNDI SPI that could possibly work. * - * @author Rod Johnson + *

Useful for setting up a simple JNDI environment for test suites + * or standalone applications. If e.g. JDBC DataSources get bound to the + * same JNDI names as within a J2EE container, both application code and + * configuration can me reused without changes. */ -public interface TimeStamped { - - /** - * Return the timestamp for this object. - * @return long the timestamp for this object, - * as returned by System.currentTimeMillis() - */ - long getTimeStamp(); - -} +package org.springframework.tests.mock.jndi; diff --git a/spring-context/src/test/java/org/springframework/beans/BeanWithObjectProperty.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/BeanWithObjectProperty.java similarity index 94% rename from spring-context/src/test/java/org/springframework/beans/BeanWithObjectProperty.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/BeanWithObjectProperty.java index bb5e71f5cd0..4448962d49c 100644 --- a/spring-context/src/test/java/org/springframework/beans/BeanWithObjectProperty.java +++ b/spring-context/src/test/java/org/springframework/tests/sample/beans/BeanWithObjectProperty.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; /** * @author Juergen Hoeller diff --git a/spring-context/src/test/java/test/beans/Employee.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/Employee.java similarity index 83% rename from spring-context/src/test/java/test/beans/Employee.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/Employee.java index d93ca6ed60a..7bed71f394b 100644 --- a/spring-context/src/test/java/test/beans/Employee.java +++ b/spring-context/src/test/java/org/springframework/tests/sample/beans/Employee.java @@ -1,6 +1,6 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -15,9 +15,9 @@ * limitations under the License. */ -package test.beans; +package org.springframework.tests.sample.beans; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; public class Employee extends TestBean { diff --git a/spring-context/src/test/java/test/beans/FactoryMethods.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/FactoryMethods.java similarity index 89% rename from spring-context/src/test/java/test/beans/FactoryMethods.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/FactoryMethods.java index ee25e7042b1..a98548867aa 100644 --- a/spring-context/src/test/java/test/beans/FactoryMethods.java +++ b/spring-context/src/test/java/org/springframework/tests/sample/beans/FactoryMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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 test.beans; +package org.springframework.tests.sample.beans; /** * Test class for Spring's ability to create objects using static diff --git a/spring-context/src/test/java/org/springframework/beans/FieldAccessBean.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/FieldAccessBean.java similarity index 94% rename from spring-context/src/test/java/org/springframework/beans/FieldAccessBean.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/FieldAccessBean.java index 61f911902c7..a250f329cbd 100644 --- a/spring-context/src/test/java/org/springframework/beans/FieldAccessBean.java +++ b/spring-context/src/test/java/org/springframework/tests/sample/beans/FieldAccessBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; /** * @author Juergen Hoeller diff --git a/spring-context/src/test/java/org/springframework/beans/ResourceTestBean.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/ResourceTestBean.java similarity index 97% rename from spring-context/src/test/java/org/springframework/beans/ResourceTestBean.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/ResourceTestBean.java index 0831e05c584..a5b1eef734e 100644 --- a/spring-context/src/test/java/org/springframework/beans/ResourceTestBean.java +++ b/spring-context/src/test/java/org/springframework/tests/sample/beans/ResourceTestBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package org.springframework.tests.sample.beans; import java.io.InputStream; import java.util.Map; diff --git a/spring-context/src/test/java/org/springframework/ui/ModelMapTests.java b/spring-context/src/test/java/org/springframework/ui/ModelMapTests.java index 336fe78e678..7b159f3b3a0 100644 --- a/spring-context/src/test/java/org/springframework/ui/ModelMapTests.java +++ b/spring-context/src/test/java/org/springframework/ui/ModelMapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -32,7 +32,7 @@ import java.util.Map; import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; @@ -278,6 +278,7 @@ public final class ModelMapTests { getClass().getClassLoader(), new Class[] {Map.class}, new InvocationHandler() { + @Override public Object invoke(Object proxy, Method method, Object[] args) { return "proxy"; } diff --git a/spring-context/src/test/java/org/springframework/util/SerializationTestUtils.java b/spring-context/src/test/java/org/springframework/util/SerializationTestUtils.java deleted file mode 100644 index 9ae4f54ec24..00000000000 --- a/spring-context/src/test/java/org/springframework/util/SerializationTestUtils.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * - * @author Rod Johnson - */ -public class SerializationTestUtils { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - return o2; - } - -} diff --git a/spring-context/src/test/java/org/springframework/validation/DataBinderFieldAccessTests.java b/spring-context/src/test/java/org/springframework/validation/DataBinderFieldAccessTests.java index b1ba9804d28..bf2031ba53a 100644 --- a/spring-context/src/test/java/org/springframework/validation/DataBinderFieldAccessTests.java +++ b/spring-context/src/test/java/org/springframework/validation/DataBinderFieldAccessTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -20,13 +20,12 @@ import java.beans.PropertyEditorSupport; import java.util.Map; import junit.framework.TestCase; -import junit.framework.Assert; -import org.springframework.beans.FieldAccessBean; +import org.springframework.tests.sample.beans.FieldAccessBean; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.NotWritablePropertyException; import org.springframework.beans.PropertyValue; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Juergen Hoeller @@ -106,7 +105,7 @@ public class DataBinderFieldAccessTests extends TestCase { assertTrue("Correct number of age errors", br.getFieldErrorCount("age") == 1); assertEquals("32x", binder.getBindingResult().getFieldValue("age")); assertEquals("32x", binder.getBindingResult().getFieldError("age").getRejectedValue()); - Assert.assertEquals(0, tb.getAge()); + assertEquals(0, tb.getAge()); } } @@ -115,9 +114,11 @@ public class DataBinderFieldAccessTests extends TestCase { DataBinder binder = new DataBinder(rod, "person"); binder.initDirectFieldAccess(); binder.registerCustomEditor(TestBean.class, "spouse", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text, 0)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -150,7 +151,7 @@ public class DataBinderFieldAccessTests extends TestCase { assertTrue("Correct number of age errors", br.getFieldErrorCount("age") == 1); assertEquals("32x", binder.getBindingResult().getFieldValue("age")); assertEquals("32x", binder.getBindingResult().getFieldError("age").getRejectedValue()); - Assert.assertEquals(0, tb.getAge()); + assertEquals(0, tb.getAge()); assertTrue("Does not have spouse errors", !br.hasFieldErrors("spouse")); assertEquals("Kerry", binder.getBindingResult().getFieldValue("spouse")); diff --git a/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java b/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java index e85cf9a6234..515a1013b02 100644 --- a/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java +++ b/spring-context/src/test/java/org/springframework/validation/DataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,16 +37,16 @@ import java.util.TreeSet; import junit.framework.TestCase; -import org.springframework.beans.BeanWithObjectProperty; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.BeanWithObjectProperty; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; import org.springframework.beans.InvalidPropertyException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.NotWritablePropertyException; import org.springframework.beans.NullValueInNestedPathException; -import org.springframework.beans.SerializablePerson; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.SerializablePerson; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomCollectionEditor; import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.context.i18n.LocaleContextHolder; @@ -254,17 +254,21 @@ public class DataBinderTests extends TestCase { TestBean rod = new TestBean(); DataBinder binder = new DataBinder(rod, "person"); binder.registerCustomEditor(String.class, "touchy", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix_" + text); } + @Override public String getAsText() { return getValue().toString().substring(7); } }); binder.registerCustomEditor(TestBean.class, "spouse", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text, 0)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -381,9 +385,11 @@ public class DataBinderTests extends TestCase { FormattingConversionService conversionService = new FormattingConversionService(); DefaultConversionService.addDefaultConverters(conversionService); conversionService.addFormatterForFieldType(String.class, new Formatter() { + @Override public String parse(String text, Locale locale) throws ParseException { throw new ParseException(text, 0); } + @Override public String print(String object, Locale locale) { return object; } @@ -669,6 +675,7 @@ public class DataBinderTests extends TestCase { DataBinder binder = new DataBinder(tb, "person"); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean()); } @@ -689,9 +696,11 @@ public class DataBinderTests extends TestCase { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(6); } @@ -725,9 +734,11 @@ public class DataBinderTests extends TestCase { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(int.class, "age", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new Integer(99)); } + @Override public String getAsText() { return "argh"; } @@ -746,9 +757,11 @@ public class DataBinderTests extends TestCase { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, null, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("prefix" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(6); } @@ -775,6 +788,7 @@ public class DataBinderTests extends TestCase { DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, null, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { if (getValue() == null || !text.equalsIgnoreCase(getValue().toString())) { setValue(text); @@ -1053,6 +1067,7 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(Set.class, new CustomCollectionEditor(TreeSet.class) { + @Override protected Object convertElement(Object element) { return new Integer(element.toString()); } @@ -1091,6 +1106,7 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("array" + text); } @@ -1130,6 +1146,7 @@ public class DataBinderTests extends TestCase { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } @@ -1166,9 +1183,11 @@ public class DataBinderTests extends TestCase { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1177,8 +1196,8 @@ public class DataBinderTests extends TestCase { pvs.add("array[0].nestedIndexedBean.list[0].name", "test1"); pvs.add("array[1].nestedIndexedBean.list[1].name", "test2"); binder.bind(pvs); - assertEquals("listtest1", tb.getArray()[0].getNestedIndexedBean().getList().get(0).getName()); - assertEquals("listtest2", tb.getArray()[1].getNestedIndexedBean().getList().get(1).getName()); + assertEquals("listtest1", ((TestBean)tb.getArray()[0].getNestedIndexedBean().getList().get(0)).getName()); + assertEquals("listtest2", ((TestBean)tb.getArray()[1].getNestedIndexedBean().getList().get(1)).getName()); assertEquals("test1", binder.getBindingResult().getFieldValue("array[0].nestedIndexedBean.list[0].name")); assertEquals("test2", binder.getBindingResult().getFieldValue("array[1].nestedIndexedBean.list[1].name")); } @@ -1189,9 +1208,11 @@ public class DataBinderTests extends TestCase { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array[0].nestedIndexedBean.list.name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1200,8 +1221,8 @@ public class DataBinderTests extends TestCase { pvs.add("array[0].nestedIndexedBean.list[0].name", "test1"); pvs.add("array[1].nestedIndexedBean.list[1].name", "test2"); binder.bind(pvs); - assertEquals("listtest1", tb.getArray()[0].getNestedIndexedBean().getList().get(0).getName()); - assertEquals("test2", tb.getArray()[1].getNestedIndexedBean().getList().get(1).getName()); + assertEquals("listtest1", ((TestBean)tb.getArray()[0].getNestedIndexedBean().getList().get(0)).getName()); + assertEquals("test2", ((TestBean)tb.getArray()[1].getNestedIndexedBean().getList().get(1)).getName()); assertEquals("test1", binder.getBindingResult().getFieldValue("array[0].nestedIndexedBean.list[0].name")); assertEquals("test2", binder.getBindingResult().getFieldValue("array[1].nestedIndexedBean.list[1].name")); } @@ -1212,9 +1233,11 @@ public class DataBinderTests extends TestCase { tb.getArray()[1].setNestedIndexedBean(new IndexedTestBean()); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "array.nestedIndexedBean.list[0].name", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("list" + text); } + @Override public String getAsText() { return ((String) getValue()).substring(4); } @@ -1223,8 +1246,8 @@ public class DataBinderTests extends TestCase { pvs.add("array[0].nestedIndexedBean.list[0].name", "test1"); pvs.add("array[1].nestedIndexedBean.list[1].name", "test2"); binder.bind(pvs); - assertEquals("listtest1", tb.getArray()[0].getNestedIndexedBean().getList().get(0).getName()); - assertEquals("test2", tb.getArray()[1].getNestedIndexedBean().getList().get(1).getName()); + assertEquals("listtest1", ((TestBean)tb.getArray()[0].getNestedIndexedBean().getList().get(0)).getName()); + assertEquals("test2", ((TestBean)tb.getArray()[1].getNestedIndexedBean().getList().get(1)).getName()); assertEquals("test1", binder.getBindingResult().getFieldValue("array[0].nestedIndexedBean.list[0].name")); assertEquals("test2", binder.getBindingResult().getFieldValue("array[1].nestedIndexedBean.list[1].name")); } @@ -1233,11 +1256,13 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "array", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1257,7 +1282,7 @@ public class DataBinderTests extends TestCase { assertEquals("NOT_ROD.tb.array", errors.getFieldError("array[0]").getCodes()[1]); assertEquals("NOT_ROD.array[0]", errors.getFieldError("array[0]").getCodes()[2]); assertEquals("NOT_ROD.array", errors.getFieldError("array[0]").getCodes()[3]); - assertEquals("NOT_ROD.org.springframework.beans.DerivedTestBean", errors.getFieldError("array[0]").getCodes()[4]); + assertEquals("NOT_ROD.org.springframework.tests.sample.beans.DerivedTestBean", errors.getFieldError("array[0]").getCodes()[4]); assertEquals("NOT_ROD", errors.getFieldError("array[0]").getCodes()[5]); assertEquals("arraya", errors.getFieldValue("array[0]")); @@ -1267,7 +1292,7 @@ public class DataBinderTests extends TestCase { assertEquals("NOT_ROD.tb.map", errors.getFieldError("map[key1]").getCodes()[1]); assertEquals("NOT_ROD.map[key1]", errors.getFieldError("map[key1]").getCodes()[2]); assertEquals("NOT_ROD.map", errors.getFieldError("map[key1]").getCodes()[3]); - assertEquals("NOT_ROD.org.springframework.beans.TestBean", errors.getFieldError("map[key1]").getCodes()[4]); + assertEquals("NOT_ROD.org.springframework.tests.sample.beans.TestBean", errors.getFieldError("map[key1]").getCodes()[4]); assertEquals("NOT_ROD", errors.getFieldError("map[key1]").getCodes()[5]); assertEquals(1, errors.getFieldErrorCount("map[key0]")); @@ -1283,11 +1308,13 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "map[key0]", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1303,7 +1330,7 @@ public class DataBinderTests extends TestCase { assertEquals("NOT_NULL.map", errors.getFieldError("map[key0]").getCodes()[3]); // This next code is only generated because of the registered editor, using the // registered type of the editor as guess for the content type of the collection. - assertEquals("NOT_NULL.org.springframework.beans.TestBean", errors.getFieldError("map[key0]").getCodes()[4]); + assertEquals("NOT_NULL.org.springframework.tests.sample.beans.TestBean", errors.getFieldError("map[key0]").getCodes()[4]); assertEquals("NOT_NULL", errors.getFieldError("map[key0]").getCodes()[5]); } @@ -1311,11 +1338,13 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1331,7 +1360,7 @@ public class DataBinderTests extends TestCase { assertEquals("NOT_NULL.map", errors.getFieldError("map[key0]").getCodes()[3]); // This next code is only generated because of the registered editor, using the // registered type of the editor as guess for the content type of the collection. - assertEquals("NOT_NULL.org.springframework.beans.TestBean", errors.getFieldError("map[key0]").getCodes()[4]); + assertEquals("NOT_NULL.org.springframework.tests.sample.beans.TestBean", errors.getFieldError("map[key0]").getCodes()[4]); assertEquals("NOT_NULL", errors.getFieldError("map[key0]").getCodes()[5]); } @@ -1339,11 +1368,13 @@ public class DataBinderTests extends TestCase { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { DerivedTestBean tb = new DerivedTestBean(); tb.setName("array" + text); setValue(tb); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -1361,7 +1392,7 @@ public class DataBinderTests extends TestCase { assertEquals("NOT_ROD.tb.array", errors.getFieldError("array[0]").getCodes()[1]); assertEquals("NOT_ROD.array[0]", errors.getFieldError("array[0]").getCodes()[2]); assertEquals("NOT_ROD.array", errors.getFieldError("array[0]").getCodes()[3]); - assertEquals("NOT_ROD.org.springframework.beans.DerivedTestBean", errors.getFieldError("array[0]").getCodes()[4]); + assertEquals("NOT_ROD.org.springframework.tests.sample.beans.DerivedTestBean", errors.getFieldError("array[0]").getCodes()[4]); assertEquals("NOT_ROD", errors.getFieldError("array[0]").getCodes()[5]); assertEquals("arraya", errors.getFieldValue("array[0]")); } @@ -1370,6 +1401,7 @@ public class DataBinderTests extends TestCase { TestBean tb = new TestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String[].class, "stringArray", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(StringUtils.delimitedListToStringArray(text, "-")); } @@ -1387,6 +1419,7 @@ public class DataBinderTests extends TestCase { TestBean tb = new TestBean(); DataBinder binder = new DataBinder(tb, "tb"); binder.registerCustomEditor(String.class, "stringArray", new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue("X" + text); } @@ -1647,10 +1680,12 @@ public class DataBinderTests extends TestCase { private static class TestBeanValidator implements Validator { + @Override public boolean supports(Class clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { TestBean tb = (TestBean) obj; if (tb.getAge() < 32) { @@ -1674,10 +1709,12 @@ public class DataBinderTests extends TestCase { private static class SpouseValidator implements Validator { + @Override public boolean supports(Class clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { TestBean tb = (TestBean) obj; if (tb == null || "XXX".equals(tb.getName())) { @@ -1703,6 +1740,7 @@ public class DataBinderTests extends TestCase { return list; } + @Override public E get(int index) { if (index >= list.size()) { for (int i = list.size(); i < index; i++) { @@ -1716,50 +1754,62 @@ public class DataBinderTests extends TestCase { } } + @Override public int size() { return list.size(); } + @Override public boolean add(E o) { return list.add(o); } + @Override public void add(int index, E element) { list.add(index, element); } + @Override public boolean addAll(int index, Collection c) { return list.addAll(index, c); } + @Override public void clear() { list.clear(); } + @Override public int indexOf(Object o) { return list.indexOf(o); } + @Override public Iterator iterator() { return list.iterator(); } + @Override public int lastIndexOf(Object o) { return list.lastIndexOf(o); } + @Override public ListIterator listIterator() { return list.listIterator(); } + @Override public ListIterator listIterator(int index) { return list.listIterator(index); } + @Override public E remove(int index) { return list.remove(index); } + @Override public E set(int index, E element) { return list.set(index, element); } diff --git a/spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java b/spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java index db86c2384d0..947677717ce 100644 --- a/spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java +++ b/spring-context/src/test/java/org/springframework/validation/DefaultMessageCodesResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.validation.DefaultMessageCodesResolver.Format; /** @@ -48,7 +48,7 @@ public class DefaultMessageCodesResolverTests { assertThat(codes, is(equalTo(new String[] { "errorCode.objectName.field", "errorCode.field", - "errorCode.org.springframework.beans.TestBean", + "errorCode.org.springframework.tests.sample.beans.TestBean", "errorCode" }))); } @@ -64,7 +64,7 @@ public class DefaultMessageCodesResolverTests { "errorCode.a.b[3].c.d", "errorCode.a.b.c.d", "errorCode.d", - "errorCode.org.springframework.beans.TestBean", + "errorCode.org.springframework.tests.sample.beans.TestBean", "errorCode" }))); } @@ -85,7 +85,7 @@ public class DefaultMessageCodesResolverTests { assertThat(codes, is(equalTo(new String[] { "prefix.errorCode.objectName.field", "prefix.errorCode.field", - "prefix.errorCode.org.springframework.beans.TestBean", + "prefix.errorCode.org.springframework.tests.sample.beans.TestBean", "prefix.errorCode" }))); } @@ -97,7 +97,7 @@ public class DefaultMessageCodesResolverTests { assertThat(codes, is(equalTo(new String[] { "errorCode.objectName.field", "errorCode.field", - "errorCode.org.springframework.beans.TestBean", + "errorCode.org.springframework.tests.sample.beans.TestBean", "errorCode" }))); } @@ -108,7 +108,7 @@ public class DefaultMessageCodesResolverTests { assertThat(codes, is(equalTo(new String[] { "errorCode.objectName.field[", "errorCode.field[", - "errorCode.org.springframework.beans.TestBean", + "errorCode.org.springframework.tests.sample.beans.TestBean", "errorCode" }))); } @@ -139,13 +139,14 @@ public class DefaultMessageCodesResolverTests { assertThat(codes, is(equalTo(new String[] { "objectName.field.errorCode", "field.errorCode", - "org.springframework.beans.TestBean.errorCode", + "org.springframework.tests.sample.beans.TestBean.errorCode", "errorCode" }))); } @Test public void shouldSupportCustomFormat() throws Exception { resolver.setMessageCodeFormatter(new MessageCodeFormatter() { + @Override public String format(String errorCode, String objectName, String field) { return DefaultMessageCodesResolver.Format.toDelimitedString( "CUSTOM-" + errorCode, objectName, field); diff --git a/spring-context/src/test/java/org/springframework/validation/ValidationUtilsTests.java b/spring-context/src/test/java/org/springframework/validation/ValidationUtilsTests.java index 4ab4f448f4c..83a36cf9558 100644 --- a/spring-context/src/test/java/org/springframework/validation/ValidationUtilsTests.java +++ b/spring-context/src/test/java/org/springframework/validation/ValidationUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ package org.springframework.validation; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Unit tests for {@link ValidationUtils}. @@ -161,10 +161,12 @@ public class ValidationUtilsTests { private static class EmptyValidator implements Validator { + @Override public boolean supports(Class clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmpty(errors, "name", "EMPTY", "You must enter a name!"); } @@ -173,10 +175,12 @@ public class ValidationUtilsTests { private static class EmptyOrWhitespaceValidator implements Validator { + @Override public boolean supports(Class clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "EMPTY_OR_WHITESPACE", "You must enter a name!"); } diff --git a/spring-context/src/test/java/org/springframework/validation/beanvalidation/BeanValidationPostProcessorTests.java b/spring-context/src/test/java/org/springframework/validation/beanvalidation/BeanValidationPostProcessorTests.java index b98fb420072..6d831328c18 100644 --- a/spring-context/src/test/java/org/springframework/validation/beanvalidation/BeanValidationPostProcessorTests.java +++ b/spring-context/src/test/java/org/springframework/validation/beanvalidation/BeanValidationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import javax.validation.constraints.Size; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.annotation.CommonAnnotationBeanPostProcessor; diff --git a/spring-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java b/spring-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java index ce29597e0c7..214f797fa0e 100644 --- a/spring-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java +++ b/spring-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -84,6 +84,7 @@ public class MethodValidationTests { @MyStereotype public static class MyValidBean implements MyValidInterface { + @Override public Object myValidMethod(String arg1, int arg2) { return (arg2 == 0 ? null : "value"); } diff --git a/spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java b/spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java index 41f500d93ef..5c2dad22a4b 100644 --- a/spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java @@ -273,9 +273,11 @@ public class ValidatorFactoryTests { public static class NameAddressValidator implements ConstraintValidator { + @Override public void initialize(NameAddressValid constraintAnnotation) { } + @Override public boolean isValid(ValidPerson value, ConstraintValidatorContext constraintValidatorContext) { return (value.name == null || !value.address.street.contains(value.name)); } diff --git a/spring-context/src/test/java/test/advice/CountingBeforeAdvice.java b/spring-context/src/test/java/test/advice/CountingBeforeAdvice.java deleted file mode 100644 index 3dc49faf24f..00000000000 --- a/spring-context/src/test/java/test/advice/CountingBeforeAdvice.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.advice; - -import java.lang.reflect.Method; - -import org.springframework.aop.MethodBeforeAdvice; - -/** - * Simple before advice example that we can use for counting checks. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class CountingBeforeAdvice extends MethodCounter implements MethodBeforeAdvice { - - public void before(Method m, Object[] args, Object target) throws Throwable { - count(m); - } - -} diff --git a/spring-context/src/test/java/test/aspect/PerTargetAspect.java b/spring-context/src/test/java/test/aspect/PerTargetAspect.java index 47fb82e40bc..b3d562e65fa 100644 --- a/spring-context/src/test/java/test/aspect/PerTargetAspect.java +++ b/spring-context/src/test/java/test/aspect/PerTargetAspect.java @@ -25,6 +25,7 @@ public class PerTargetAspect implements Ordered { ++count; } + @Override public int getOrder() { return this.order; } diff --git a/spring-context/src/test/java/test/beans/Colour.java b/spring-context/src/test/java/test/beans/Colour.java deleted file mode 100644 index 193531bcbd0..00000000000 --- a/spring-context/src/test/java/test/beans/Colour.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings({ "serial", "deprecation" }) -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - - public static final Colour BLUE = new Colour(1, "BLUE"); - - public static final Colour GREEN = new Colour(2, "GREEN"); - - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } -} diff --git a/spring-context/src/test/java/test/beans/CustomScope.java b/spring-context/src/test/java/test/beans/CustomScope.java deleted file mode 100644 index b047ae29c0c..00000000000 --- a/spring-context/src/test/java/test/beans/CustomScope.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.beans.factory.ObjectFactory; -import org.springframework.beans.factory.config.Scope; - -/** - * Simple scope implementation which creates object based on a flag. - * - * @author Costin Leau - * @author Chris Beams - */ -public class CustomScope implements Scope { - - public boolean createNewScope = true; - - private Map beans = new HashMap(); - - public Object get(String name, ObjectFactory objectFactory) { - if (createNewScope) { - beans.clear(); - // reset the flag back - createNewScope = false; - } - - Object bean = beans.get(name); - // if a new object is requested or none exists under the current - // name, create one - if (bean == null) { - beans.put(name, objectFactory.getObject()); - } - - return beans.get(name); - } - - public String getConversationId() { - return null; - } - - public void registerDestructionCallback(String name, Runnable callback) { - // do nothing - } - - public Object remove(String name) { - return beans.remove(name); - } - - public Object resolveContextualObject(String key) { - return null; - } - -} diff --git a/spring-context/src/test/java/test/beans/DependsOnTestBean.java b/spring-context/src/test/java/test/beans/DependsOnTestBean.java deleted file mode 100644 index d784bae712d..00000000000 --- a/spring-context/src/test/java/test/beans/DependsOnTestBean.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -public class DependsOnTestBean { - - public TestBean tb; - - private int state; - - public void setTestBean(TestBean tb) { - this.tb = tb; - } - - public int getState() { - return state; - } - - public TestBean getTestBean() { - return tb; - } - -} diff --git a/spring-context/src/test/java/test/beans/INestedTestBean.java b/spring-context/src/test/java/test/beans/INestedTestBean.java deleted file mode 100644 index 4cdf0cfc5cc..00000000000 --- a/spring-context/src/test/java/test/beans/INestedTestBean.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -public interface INestedTestBean { - - String getCompany(); - -} diff --git a/spring-context/src/test/java/test/beans/IOther.java b/spring-context/src/test/java/test/beans/IOther.java deleted file mode 100644 index cfd81f2bad3..00000000000 --- a/spring-context/src/test/java/test/beans/IOther.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -public interface IOther { - - void absquatulate(); - -} diff --git a/spring-context/src/test/java/test/beans/ITestBean.java b/spring-context/src/test/java/test/beans/ITestBean.java deleted file mode 100644 index 81c0e45e3b5..00000000000 --- a/spring-context/src/test/java/test/beans/ITestBean.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.io.IOException; - - -/** - * Interface used for test beans. Two methods are the same as on Person, but if this extends - * person it breaks quite a few tests - * - * @author Rod Johnson - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - /** - * t null no error. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; -} diff --git a/spring-context/src/test/java/test/beans/IndexedTestBean.java b/spring-context/src/test/java/test/beans/IndexedTestBean.java deleted file mode 100644 index 8cef5b23217..00000000000 --- a/spring-context/src/test/java/test/beans/IndexedTestBean.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] { tb0, tb1 }; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} diff --git a/spring-context/src/test/java/test/beans/NestedTestBean.java b/spring-context/src/test/java/test/beans/NestedTestBean.java deleted file mode 100644 index 2a37c6b8c1c..00000000000 --- a/spring-context/src/test/java/test/beans/NestedTestBean.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = ((company != null) ? company : ""); - } - - public String getCompany() { - return company; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - @Override - public int hashCode() { - return this.company.hashCode(); - } - - @Override - public String toString() { - return "NestedTestBean: " + this.company; - } - -} diff --git a/spring-context/src/test/java/test/beans/SideEffectBean.java b/spring-context/src/test/java/test/beans/SideEffectBean.java deleted file mode 100644 index 990989bb19c..00000000000 --- a/spring-context/src/test/java/test/beans/SideEffectBean.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.beans; - -/** - * Bean that changes state on a business invocation, so that - * we can check whether it's been invoked - * - * @author Rod Johnson - */ -public class SideEffectBean { - - private int count; - - public void setCount(int count) { - this.count = count; - } - - public int getCount() { - return this.count; - } - - public void doWork() { - ++count; - } - -} \ No newline at end of file diff --git a/spring-context/src/test/java/test/beans/TestBean.java b/spring-context/src/test/java/test/beans/TestBean.java deleted file mode 100644 index c528573e4df..00000000000 --- a/spring-context/src/test/java/test/beans/TestBean.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; - -import org.springframework.util.ObjectUtils; - -import java.io.IOException; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - - -/** - * Simple test bean used for testing bean factories, AOP framework etc. - * - * @author Rod Johnson - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean spouse; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouse = spouse; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouse = spouse; - this.someProperties = someProperties; - } - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return spouse; - } - - public void setSpouse(ITestBean spouse) { - this.spouse = spouse; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setDoctor(INestedTestBean bean) { - doctor = bean; - } - - public void setLawyer(INestedTestBean bean) { - lawyer = bean; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - /** - * @see ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - - /** - * @see ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } - - if ((other == null) || !(other instanceof TestBean)) { - return false; - } - - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && (this.age == tb2.age)); - } - - @Override - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if ((this.name != null) && (other instanceof TestBean)) { - return this.name.compareTo(((TestBean) other).getName()); - } - - return 1; - } - - @Override - public String toString() { - String s = "name=" + name + "; age=" + age + "; touchy=" + touchy; - s += "; spouse={" + ((spouse != null) ? spouse.getName() : null) + "}"; - return s; - } - -} diff --git a/spring-context/src/test/java/test/interceptor/NopInterceptor.java b/spring-context/src/test/java/test/interceptor/NopInterceptor.java deleted file mode 100644 index 79158e74ea4..00000000000 --- a/spring-context/src/test/java/test/interceptor/NopInterceptor.java +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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 test.interceptor; - -import org.aopalliance.intercept.MethodInterceptor; -import org.aopalliance.intercept.MethodInvocation; - -/** - * Trivial interceptor that can be introduced in a chain to display it. - * - * @author Rod Johnson - */ -public class NopInterceptor implements MethodInterceptor { - - private int count; - - /** - * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation) - */ - public Object invoke(MethodInvocation invocation) throws Throwable { - increment(); - return invocation.proceed(); - } - - public int getCount() { - return this.count; - } - - protected void increment() { - ++count; - } - - public boolean equals(Object other) { - if (!(other instanceof NopInterceptor)) { - return false; - } - if (this == other) { - return true; - } - return this.count == ((NopInterceptor) other).count; - } - -} diff --git a/spring-context/src/test/java/test/mixin/DefaultLockable.java b/spring-context/src/test/java/test/mixin/DefaultLockable.java index 2510395bf6c..2e84161be94 100644 --- a/spring-context/src/test/java/test/mixin/DefaultLockable.java +++ b/spring-context/src/test/java/test/mixin/DefaultLockable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -26,14 +26,17 @@ public class DefaultLockable implements Lockable { private boolean locked; + @Override public void lock() { this.locked = true; } + @Override public void unlock() { this.locked = false; } + @Override public boolean locked() { return this.locked; } diff --git a/spring-context/src/test/java/test/mixin/LockMixin.java b/spring-context/src/test/java/test/mixin/LockMixin.java index b038bff1fdc..e9463cdc9b8 100644 --- a/spring-context/src/test/java/test/mixin/LockMixin.java +++ b/spring-context/src/test/java/test/mixin/LockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -34,10 +34,12 @@ public class LockMixin extends DelegatingIntroductionInterceptor implements Lock /** This field demonstrates additional state in the mixin */ private boolean locked; + @Override public void lock() { this.locked = true; } + @Override public void unlock() { this.locked = false; } @@ -45,6 +47,7 @@ public class LockMixin extends DelegatingIntroductionInterceptor implements Lock /** * @see test.mixin.AopProxyTests.Lockable#locked() */ + @Override public boolean locked() { return this.locked; } @@ -56,6 +59,7 @@ public class LockMixin extends DelegatingIntroductionInterceptor implements Lock * Lockable(this) then target behaviour. * @see org.aopalliance.MethodInterceptor#invoke(org.aopalliance.MethodInvocation) */ + @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (locked() && invocation.getMethod().getName().indexOf("set") == 0) throw new LockedException(); diff --git a/spring-context/src/test/java/test/mixin/LockMixinAdvisor.java b/spring-context/src/test/java/test/mixin/LockMixinAdvisor.java index 7ee37ed6846..50667a7b0dc 100644 --- a/spring-context/src/test/java/test/mixin/LockMixinAdvisor.java +++ b/spring-context/src/test/java/test/mixin/LockMixinAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/test/mixin/Lockable.java b/spring-context/src/test/java/test/mixin/Lockable.java index dd006ad449a..a5f6d111464 100644 --- a/spring-context/src/test/java/test/mixin/Lockable.java +++ b/spring-context/src/test/java/test/mixin/Lockable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/java/test/mixin/LockedException.java b/spring-context/src/test/java/test/mixin/LockedException.java index 1ca010f1649..96f46e484e3 100644 --- a/spring-context/src/test/java/test/mixin/LockedException.java +++ b/spring-context/src/test/java/test/mixin/LockedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-context/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerWithExpressionLanguageTests.xml b/spring-context/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerWithExpressionLanguageTests.xml index 1067cbc26cb..3982b48c7cf 100644 --- a/spring-context/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerWithExpressionLanguageTests.xml +++ b/spring-context/src/test/resources/org/springframework/beans/factory/xml/simplePropertyNamespaceHandlerWithExpressionLanguageTests.xml @@ -4,8 +4,8 @@ xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + - + diff --git a/spring-context/src/test/resources/org/springframework/context/support/simpleThreadScopeTests.xml b/spring-context/src/test/resources/org/springframework/context/support/simpleThreadScopeTests.xml index 2b71bd30014..efb31d0297b 100644 --- a/spring-context/src/test/resources/org/springframework/context/support/simpleThreadScopeTests.xml +++ b/spring-context/src/test/resources/org/springframework/context/support/simpleThreadScopeTests.xml @@ -14,34 +14,34 @@ - + - override - override @@ -42,7 +42,7 @@ - + myname diff --git a/spring-orm/src/test/resources/org/springframework/beans/factory/xml/test.xml b/spring-orm/src/test/resources/org/springframework/beans/factory/xml/test.xml index e67e3101362..933e66b7d00 100644 --- a/spring-orm/src/test/resources/org/springframework/beans/factory/xml/test.xml +++ b/spring-orm/src/test/resources/org/springframework/beans/factory/xml/test.xml @@ -3,7 +3,7 @@ - + I have no properties and I'm happy without them. @@ -12,7 +12,7 @@ - + aliased @@ -20,17 +20,17 @@ - + aliased - + aliased - + @@ -40,7 +40,7 @@ - + Rod 31 @@ -52,29 +52,29 @@ - + Kerry 34 - + Kathy 28 - + typeMismatch 34x - + - true @@ -85,10 +85,10 @@ - + - + false @@ -113,14 +113,14 @@ - + listenerVeto 66 - + - + this is a ]]> diff --git a/spring-oxm/oxm.gradle b/spring-oxm/oxm.gradle index 9eef5484273..0b8aee62e9d 100644 --- a/spring-oxm/oxm.gradle +++ b/spring-oxm/oxm.gradle @@ -7,8 +7,8 @@ configurations { dependencies { castor "org.codehaus.castor:castor-anttasks:1.2" castor "velocity:velocity:1.5" - xjc "com.sun.xml:com.springsource.com.sun.tools.xjc:2.1.7" - xmlbeans "org.apache.xmlbeans:com.springsource.org.apache.xmlbeans:2.4.0" + xjc "com.sun.xml.bind:jaxb-xjc:2.1.7" + xmlbeans "org.apache.xmlbeans:xmlbeans:2.4.0" jibx "org.jibx:jibx-bind:1.2.3" jibx "bcel:bcel:5.1" } diff --git a/spring-oxm/src/main/java/org/springframework/oxm/GenericMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/GenericMarshaller.java index ccc8039a8f6..77115d08b52 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/GenericMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/GenericMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/GenericUnmarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/GenericUnmarshaller.java index c66d642fddb..fab56e5e5aa 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/GenericUnmarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/GenericUnmarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/Marshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/Marshaller.java index 85253a810cf..9dfb7214d20 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/Marshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/Marshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/MarshallingException.java b/spring-oxm/src/main/java/org/springframework/oxm/MarshallingException.java index 925558f7ae2..dea843c0a22 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/MarshallingException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/MarshallingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/MarshallingFailureException.java b/spring-oxm/src/main/java/org/springframework/oxm/MarshallingFailureException.java index f7eba5c93bc..ceff466c669 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/MarshallingFailureException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/MarshallingFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/UncategorizedMappingException.java b/spring-oxm/src/main/java/org/springframework/oxm/UncategorizedMappingException.java index 9986ad58b28..79644134e1a 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/UncategorizedMappingException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/UncategorizedMappingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/Unmarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/Unmarshaller.java index bdbebf2c8bd..e5fbb959adc 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/Unmarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/Unmarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/UnmarshallingFailureException.java b/spring-oxm/src/main/java/org/springframework/oxm/UnmarshallingFailureException.java index 350cdb2b0eb..901ff9f0537 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/UnmarshallingFailureException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/UnmarshallingFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/ValidationFailureException.java b/spring-oxm/src/main/java/org/springframework/oxm/ValidationFailureException.java index f39ddfd6d37..02b30141958 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/ValidationFailureException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/ValidationFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/XmlMappingException.java b/spring-oxm/src/main/java/org/springframework/oxm/XmlMappingException.java index dff92dd3095..3f38f2c9bf0 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/XmlMappingException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/XmlMappingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMappingException.java b/spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMappingException.java index 6139df1f2af..20be49ceceb 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMappingException.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMappingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/config/CastorMarshallerBeanDefinitionParser.java b/spring-oxm/src/main/java/org/springframework/oxm/config/CastorMarshallerBeanDefinitionParser.java index d3895ebccc3..e2f6a3f25bb 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/config/CastorMarshallerBeanDefinitionParser.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/config/CastorMarshallerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/config/Jaxb2MarshallerBeanDefinitionParser.java b/spring-oxm/src/main/java/org/springframework/oxm/config/Jaxb2MarshallerBeanDefinitionParser.java index 447c425da8a..2529b9ca079 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/config/Jaxb2MarshallerBeanDefinitionParser.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/config/Jaxb2MarshallerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* -* Copyright 2002-2009 the original author or authors. +* Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/config/JibxMarshallerBeanDefinitionParser.java b/spring-oxm/src/main/java/org/springframework/oxm/config/JibxMarshallerBeanDefinitionParser.java index aa99d312e27..a83051b9b02 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/config/JibxMarshallerBeanDefinitionParser.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/config/JibxMarshallerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/config/OxmNamespaceHandler.java b/spring-oxm/src/main/java/org/springframework/oxm/config/OxmNamespaceHandler.java index 6ff085146a7..19bf683caeb 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/config/OxmNamespaceHandler.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/config/OxmNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/config/XmlBeansMarshallerBeanDefinitionParser.java b/spring-oxm/src/main/java/org/springframework/oxm/config/XmlBeansMarshallerBeanDefinitionParser.java index 3fb94cddda6..0f5dc4c0f1a 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/config/XmlBeansMarshallerBeanDefinitionParser.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/config/XmlBeansMarshallerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/mime/MimeContainer.java b/spring-oxm/src/main/java/org/springframework/oxm/mime/MimeContainer.java index 9acf2322857..f7535781b3a 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/mime/MimeContainer.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/mime/MimeContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java index 983655abf05..cf584efa88e 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java b/spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java index 9c208afcfb0..7fbe4b4745c 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/support/SaxResourceUtils.java b/spring-oxm/src/main/java/org/springframework/oxm/support/SaxResourceUtils.java index 98dc0a248f6..881a3ca20ba 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/support/SaxResourceUtils.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/support/SaxResourceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlBeansMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlBeansMarshaller.java index 6d9604dde84..991d2626456 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlBeansMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlBeansMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBean.java b/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBean.java index f3e75920be9..d5d668bac68 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBean.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamUtils.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamUtils.java index c2c26b3d46d..04f53b6973b 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamUtils.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java index 0c574a4df15..1ffc5363044 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -16,10 +16,20 @@ package org.springframework.oxm.castor; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.easymock.EasyMock.aryEq; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.eq; +import static org.easymock.EasyMock.isA; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; + import java.io.StringWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Map; + import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamResult; @@ -29,18 +39,14 @@ import org.custommonkey.xmlunit.XMLUnit; import org.custommonkey.xmlunit.XpathEngine; import org.junit.Assert; import org.junit.Test; +import org.springframework.core.io.ClassPathResource; +import org.springframework.oxm.AbstractMarshallerTests; +import org.springframework.oxm.Marshaller; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; -import org.springframework.core.io.ClassPathResource; -import org.springframework.oxm.AbstractMarshallerTests; -import org.springframework.oxm.Marshaller; - -import static org.custommonkey.xmlunit.XMLAssert.*; -import static org.easymock.EasyMock.*; - /** * Tests the {@link CastorMarshaller} class. * diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java index 4c5387aaa34..367b4aa5c15 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -29,6 +29,8 @@ import org.springframework.oxm.AbstractUnmarshallerTests; import org.springframework.oxm.MarshallingException; import org.springframework.oxm.Unmarshaller; +import static org.hamcrest.CoreMatchers.*; + import static org.junit.Assert.*; /** @@ -66,7 +68,7 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests { protected void testFlight(Object o) { Flight flight = (Flight) o; assertNotNull("Flight is null", flight); - assertEquals("Number is invalid", 42L, flight.getNumber()); + assertThat("Number is invalid", flight.getNumber(), equalTo(42L)); } @Override @@ -104,10 +106,10 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests { assertEquals("Invalid amount of items", 2, order.getOrderItemCount()); OrderItem item = order.getOrderItem(0); assertEquals("Invalid items", "1", item.getId()); - assertEquals("Invalid items", 15, item.getQuantity()); + assertThat("Invalid items", item.getQuantity(), equalTo(15)); item = order.getOrderItem(1); assertEquals("Invalid items", "3", item.getId()); - assertEquals("Invalid items", 20, item.getQuantity()); + assertThat("Invalid items", item.getQuantity(), equalTo(20)); } @Test diff --git a/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java index 90e8bdf738d..38f03876791 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/BinaryObject.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/BinaryObject.java index 503b01cc016..7a7a21d39c1 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/BinaryObject.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/BinaryObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java index a550a4daedb..3d7a4978671 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java @@ -16,12 +16,26 @@ package org.springframework.oxm.jaxb; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.eq; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; +import static org.easymock.EasyMock.isA; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.ByteArrayOutputStream; import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.Collections; + import javax.activation.DataHandler; import javax.activation.FileDataSource; import javax.xml.bind.JAXBElement; @@ -33,10 +47,6 @@ import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamResult; import org.junit.Test; -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.Locator; - import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.oxm.AbstractMarshallerTests; @@ -49,11 +59,9 @@ import org.springframework.oxm.jaxb.test.ObjectFactory; import org.springframework.oxm.mime.MimeContainer; import org.springframework.util.FileCopyUtils; import org.springframework.util.ReflectionUtils; - -import static org.custommonkey.xmlunit.XMLAssert.assertFalse; -import static org.custommonkey.xmlunit.XMLAssert.*; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.assertTrue; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.Locator; public class Jaxb2MarshallerTests extends AbstractMarshallerTests { @@ -206,6 +214,7 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests { private void testSupportsPrimitives() { final Primitives primitives = new Primitives(); ReflectionUtils.doWithMethods(Primitives.class, new ReflectionUtils.MethodCallback() { + @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { Type returnType = method.getGenericReturnType(); assertTrue("Jaxb2Marshaller does not support JAXBElement<" + method.getName().substring(9) + ">", @@ -220,6 +229,7 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests { } } }, new ReflectionUtils.MethodFilter() { + @Override public boolean matches(Method method) { return method.getName().startsWith("primitive"); } @@ -229,6 +239,7 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests { private void testSupportsStandardClasses() throws Exception { final StandardClasses standardClasses = new StandardClasses(); ReflectionUtils.doWithMethods(StandardClasses.class, new ReflectionUtils.MethodCallback() { + @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { Type returnType = method.getGenericReturnType(); assertTrue("Jaxb2Marshaller does not support JAXBElement<" + method.getName().substring(13) + ">", @@ -243,6 +254,7 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests { } } }, new ReflectionUtils.MethodFilter() { + @Override public boolean matches(Method method) { return method.getName().startsWith("standardClass"); } diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Primitives.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Primitives.java index 92e98b4d060..5e982d76133 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Primitives.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Primitives.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/StandardClasses.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/StandardClasses.java index 89e41d3c656..00daa798f45 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/StandardClasses.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/StandardClasses.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java b/spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java index aa445748bdf..422f8d00355 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBeanTests.java b/spring-oxm/src/test/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBeanTests.java index 0c3b71eca5a..4123df65fd1 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBeanTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/xmlbeans/XmlOptionsFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/xstream/Flight.java b/spring-oxm/src/test/java/org/springframework/oxm/xstream/Flight.java index 0f6698f8dbb..15037de3a53 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/xstream/Flight.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/xstream/Flight.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java index cf42f1bd783..7979e4d5c52 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/ComponentControllerSupport.java b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/ComponentControllerSupport.java index d48113b6e1c..3bc05c28b31 100644 --- a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/ComponentControllerSupport.java +++ b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/ComponentControllerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesConfigurer.java b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesConfigurer.java index 3ac220ce339..4905e411f0e 100644 --- a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesConfigurer.java +++ b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesJstlView.java b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesJstlView.java index 232f1b49ff0..cbec3678174 100644 --- a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesJstlView.java +++ b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesJstlView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesView.java b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesView.java index f46433e040a..7e952690eab 100644 --- a/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesView.java +++ b/spring-struts/src/main/java/org/springframework/web/servlet/view/tiles/TilesView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/ActionServletAwareProcessor.java b/spring-struts/src/main/java/org/springframework/web/struts/ActionServletAwareProcessor.java index e2eb6e1fb6f..54c46c76a28 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/ActionServletAwareProcessor.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/ActionServletAwareProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/ActionSupport.java b/spring-struts/src/main/java/org/springframework/web/struts/ActionSupport.java index c12b895766e..b87823a8364 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/ActionSupport.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/ActionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/AutowiringRequestProcessor.java b/spring-struts/src/main/java/org/springframework/web/struts/AutowiringRequestProcessor.java index f14091729d9..27a5368ca35 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/AutowiringRequestProcessor.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/AutowiringRequestProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/AutowiringTilesRequestProcessor.java b/spring-struts/src/main/java/org/springframework/web/struts/AutowiringTilesRequestProcessor.java index 96a24c8c6e8..c9df6c84921 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/AutowiringTilesRequestProcessor.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/AutowiringTilesRequestProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/ContextLoaderPlugIn.java b/spring-struts/src/main/java/org/springframework/web/struts/ContextLoaderPlugIn.java index 74214470d54..d1d68e69956 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/ContextLoaderPlugIn.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/ContextLoaderPlugIn.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java index b43d3f5152b..860f79c2415 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionUtils.java b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionUtils.java index 32d08f5cf31..79fa1228281 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionUtils.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java index 063ad2f9a78..a9ebf4d7c66 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java index b614dd30b04..62ea98fc819 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/DispatchActionSupport.java b/spring-struts/src/main/java/org/springframework/web/struts/DispatchActionSupport.java index ff18cff838a..b9a0b186ded 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/DispatchActionSupport.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/DispatchActionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/LookupDispatchActionSupport.java b/spring-struts/src/main/java/org/springframework/web/struts/LookupDispatchActionSupport.java index 1533d81a102..a6cb4ed1092 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/LookupDispatchActionSupport.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/LookupDispatchActionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/MappingDispatchActionSupport.java b/spring-struts/src/main/java/org/springframework/web/struts/MappingDispatchActionSupport.java index b67b34f481d..1187c84f9a2 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/MappingDispatchActionSupport.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/MappingDispatchActionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/main/java/org/springframework/web/struts/SpringBindingActionForm.java b/spring-struts/src/main/java/org/springframework/web/struts/SpringBindingActionForm.java index 65bcd408b77..3cb29fb4e92 100644 --- a/spring-struts/src/main/java/org/springframework/web/struts/SpringBindingActionForm.java +++ b/spring-struts/src/main/java/org/springframework/web/struts/SpringBindingActionForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TestComponentController.java b/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TestComponentController.java index 941dd59517e..f554032e75e 100644 --- a/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TestComponentController.java +++ b/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TestComponentController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ import org.apache.struts.tiles.ComponentContext; * @author Juergen Hoeller * @since 22.08.2003 */ +@Deprecated public class TestComponentController extends ComponentControllerSupport { @Override diff --git a/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TilesViewTests.java b/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TilesViewTests.java index 389c18f9b37..71839c1837e 100644 --- a/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TilesViewTests.java +++ b/spring-struts/src/test/java/org/springframework/web/servlet/view/tiles/TilesViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -42,6 +42,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver; * @author Alef Arendsen * @author Juergen Hoeller */ +@Deprecated public class TilesViewTests { protected StaticWebApplicationContext prepareWebApplicationContext() throws Exception { diff --git a/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java b/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java index 5e77137f534..ad97b300b55 100644 --- a/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java +++ b/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-struts/src/test/java/org/springframework/web/struts/TestAction.java b/spring-struts/src/test/java/org/springframework/web/struts/TestAction.java index 68dda908f51..caded1a7f39 100644 --- a/spring-struts/src/test/java/org/springframework/web/struts/TestAction.java +++ b/spring-struts/src/test/java/org/springframework/web/struts/TestAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ public class TestAction extends Action implements BeanNameAware { private String beanName; + @Override public void setBeanName(String beanName) { this.beanName = beanName; } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java index 66e5e064ef0..56d4c5b40dd 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java @@ -120,10 +120,12 @@ public class DefaultMvcResultTests { this.asyncStarted = asyncStarted; } + @Override public boolean isAsyncStarted() { return this.asyncStarted; } + @Override public AsyncContext getAsyncContext() { return asyncContext; } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/StubMvcResult.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/StubMvcResult.java index c86e2901371..60426d8075c 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/StubMvcResult.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/StubMvcResult.java @@ -60,30 +60,37 @@ public class StubMvcResult implements MvcResult { this.response = response; } + @Override public MockHttpServletRequest getRequest() { return request; } + @Override public Object getHandler() { return handler; } + @Override public HandlerInterceptor[] getInterceptors() { return interceptors; } + @Override public Exception getResolvedException() { return resolvedException; } + @Override public ModelAndView getModelAndView() { return mav; } + @Override public FlashMap getFlashMap() { return flashMap; } + @Override public MockHttpServletResponse getResponse() { return response; } @@ -120,10 +127,12 @@ public class StubMvcResult implements MvcResult { this.response = response; } + @Override public Object getAsyncResult() { return null; } + @Override public Object getAsyncResult(long timeout) { return null; } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java index 926942869af..9320acd338b 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java @@ -392,6 +392,7 @@ public class MockHttpServletRequestBuilderTests { private final class User implements Principal { + @Override public String getName() { return "Foo"; } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java index 0eea8533762..5902cb5e94f 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java @@ -63,6 +63,7 @@ public class PrintingResultHandlerTests { public void setup() { this.handler = new TestPrintingResultHandler(); this.request = new MockHttpServletRequest("GET", "/") { + @Override public boolean isAsyncStarted() { return false; } @@ -228,11 +229,13 @@ public class PrintingResultHandlerTests { private Map> printedValues = new HashMap>(); + @Override public void printHeading(String heading) { this.printedHeading = heading; this.printedValues.put(heading, new HashMap()); } + @Override public void printValue(String label, Object value) { Assert.notNull(this.printedHeading, "Heading not printed before label " + label + " with value " + value); diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java index 0a22f71ac09..f021e1355a2 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java @@ -97,6 +97,7 @@ public class AsyncTests { @ResponseBody public Callable getCallable(final Model model) { return new Callable() { + @Override public Person call() throws Exception { return new Person("Joe"); } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java index 56539b99218..de8760c8792 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java @@ -151,6 +151,7 @@ public class FilterTests { @Override public Principal getUserPrincipal() { return new Principal() { + @Override public String getName() { return PRINCIPAL_NAME; } diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestBuilderTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestBuilderTests.java index b62a0e3dedc..b36043a7e43 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestBuilderTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestBuilderTests.java @@ -82,6 +82,7 @@ public class RequestBuilderTests { return this; } + @Override public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) { for (String headerName : this.headers.keySet()) { request.addHeader(headerName, this.headers.get(headerName)); diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java index 9282d4885a9..eaf01a5782a 100644 --- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java +++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/setup/ConditionalDelegatingFilterProxyTests.java @@ -253,10 +253,12 @@ public class ConditionalDelegatingFilterProxyTests { private FilterChain chain; private boolean destroy; + @Override public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { this.request = request; @@ -264,6 +266,7 @@ public class ConditionalDelegatingFilterProxyTests { this.chain = chain; } + @Override public void destroy() { this.destroy = true; } diff --git a/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java b/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java index c71d6e86810..d35fbdc8657 100644 --- a/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java +++ b/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java index f21936897b3..449c45facaf 100644 --- a/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java b/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java index 66ce8a2b076..f97e60e2ebb 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java +++ b/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java b/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java index 784e160483a..23694170305 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java +++ b/spring-test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java b/spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java index a6381e92baa..e8f5e91dfb6 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java +++ b/spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java b/spring-test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java index 4894fe4eb9b..6b69fdb7048 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java b/spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java index 2ea463ce8d9..b492c1fa980 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletConfig.java b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletConfig.java index 985c1e20dca..9d3a878026a 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletConfig.java +++ b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletContext.java b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletContext.java index 89dbaf0d74b..b1193ff5e1e 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletContext.java +++ b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java index d6ba452f238..70e90567b0c 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java +++ b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletSession.java b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletSession.java index 477493f4f0f..93800340b85 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletSession.java +++ b/spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AbstractDependencyInjectionSpringContextTests.java b/spring-test/src/main/java/org/springframework/test/AbstractDependencyInjectionSpringContextTests.java index 83096ddf9f8..0ef706abe11 100644 --- a/spring-test/src/main/java/org/springframework/test/AbstractDependencyInjectionSpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/AbstractDependencyInjectionSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AbstractSingleSpringContextTests.java b/spring-test/src/main/java/org/springframework/test/AbstractSingleSpringContextTests.java index bd83c9eaffa..0d5d0784801 100644 --- a/spring-test/src/main/java/org/springframework/test/AbstractSingleSpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/AbstractSingleSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AbstractSpringContextTests.java b/spring-test/src/main/java/org/springframework/test/AbstractSpringContextTests.java index c420225a632..d01144ede93 100644 --- a/spring-test/src/main/java/org/springframework/test/AbstractSpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/AbstractSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AbstractTransactionalDataSourceSpringContextTests.java b/spring-test/src/main/java/org/springframework/test/AbstractTransactionalDataSourceSpringContextTests.java index fae16151d2a..0f697d115f5 100644 --- a/spring-test/src/main/java/org/springframework/test/AbstractTransactionalDataSourceSpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/AbstractTransactionalDataSourceSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AbstractTransactionalSpringContextTests.java b/spring-test/src/main/java/org/springframework/test/AbstractTransactionalSpringContextTests.java index bae411345d7..af3c68663e0 100644 --- a/spring-test/src/main/java/org/springframework/test/AbstractTransactionalSpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/AbstractTransactionalSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/AssertThrows.java b/spring-test/src/main/java/org/springframework/test/AssertThrows.java index b810d3381cb..2958fe02546 100644 --- a/spring-test/src/main/java/org/springframework/test/AssertThrows.java +++ b/spring-test/src/main/java/org/springframework/test/AssertThrows.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -185,7 +185,7 @@ public abstract class AssertThrows { * Template method called when the test fails; i.e. the expected * {@link java.lang.Exception} is not thrown. *

The default implementation simply fails the test via a call to - * {@link junit.framework.Assert#fail(String)}. + * {@link org.junit.Assert#fail(String)}. *

If you want to customise the failure message, consider overriding * {@link #createMessageForNoExceptionThrown()}, and / or supplying an * extra, contextual failure message via the appropriate constructor overload. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/AbstractAnnotationAwareTransactionalTests.java b/spring-test/src/main/java/org/springframework/test/annotation/AbstractAnnotationAwareTransactionalTests.java index 7664b0f4609..30c08a22cb9 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/AbstractAnnotationAwareTransactionalTests.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/AbstractAnnotationAwareTransactionalTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java b/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java index 72ae28bb338..53a9b877e64 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/ExpectedException.java b/spring-test/src/main/java/org/springframework/test/annotation/ExpectedException.java index 91962ee8273..944f3aeaead 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/ExpectedException.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/ExpectedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java b/spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java index 322c7a7fd9f..c5c718468d6 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/NotTransactional.java b/spring-test/src/main/java/org/springframework/test/annotation/NotTransactional.java index 76983acf728..c8539186644 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/NotTransactional.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/NotTransactional.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSource.java b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSource.java index ee1c07f14c9..05ee407f5f1 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSource.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java index e21ace4ce78..4e240aa6ea7 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueUtils.java b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueUtils.java index 42fc03f1f4f..922e34c6295 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueUtils.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/ProfileValueUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/Repeat.java b/spring-test/src/main/java/org/springframework/test/annotation/Repeat.java index 7ab79068137..4c3dcd3a91e 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/Repeat.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/Repeat.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java b/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java index 3498074cb1c..bb0bc88cd58 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/Rollback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/annotation/Timed.java b/spring-test/src/main/java/org/springframework/test/annotation/Timed.java index 96729e409e4..a78960ce82d 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/Timed.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/Timed.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/TestContext.java b/spring-test/src/main/java/org/springframework/test/context/TestContext.java index fc64520476c..27100be94c1 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestContext.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java index 0b844447e97..0f2ceb73a48 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java index 7a820b42cbf..50cfa74474e 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractJUnit38SpringContextTests.java b/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractJUnit38SpringContextTests.java index 81658f379d9..732c1e0bf5f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractJUnit38SpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractJUnit38SpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractTransactionalJUnit38SpringContextTests.java b/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractTransactionalJUnit38SpringContextTests.java index 91dc025aacb..9b7fd03ec70 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractTransactionalJUnit38SpringContextTests.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit38/AbstractTransactionalJUnit38SpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java b/spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java index a01f214f600..5496b4ee633 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestClassCallbacks.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestClassCallbacks.java index f625c3fa5cb..c3d6c8f5c7b 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestClassCallbacks.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestClassCallbacks.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestClassCallbacks.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestClassCallbacks.java index 3112cfcc5bf..16c6f97d8c2 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestClassCallbacks.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestClassCallbacks.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestMethodCallbacks.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestMethodCallbacks.java index c35ff652460..92d32ea5172 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestMethodCallbacks.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestMethodCallbacks.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringFailOnTimeout.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringFailOnTimeout.java index 51b04ce41fc..093ae49b107 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringFailOnTimeout.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringFailOnTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringRepeat.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringRepeat.java index e3242621581..0aa21888cb9 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringRepeat.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/SpringRepeat.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/AbstractTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/support/AbstractTestExecutionListener.java index beaa77ca1a1..34dfe47ec7f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/AbstractTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/AbstractTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java index ca380e68bd8..cb852237171 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java index fef3aa74cc0..7c784741899 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/GenericPropertiesContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/GenericPropertiesContextLoader.java index a4fa110e983..823688797ff 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/GenericPropertiesContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/GenericPropertiesContextLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/support/GenericXmlContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/GenericXmlContextLoader.java index 1fffaebd967..9c636e0e705 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/GenericXmlContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/GenericXmlContextLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/transaction/AfterTransaction.java b/spring-test/src/main/java/org/springframework/test/context/transaction/AfterTransaction.java index 21be2d3da41..bb25f1f8e64 100644 --- a/spring-test/src/main/java/org/springframework/test/context/transaction/AfterTransaction.java +++ b/spring-test/src/main/java/org/springframework/test/context/transaction/AfterTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/context/transaction/BeforeTransaction.java b/spring-test/src/main/java/org/springframework/test/context/transaction/BeforeTransaction.java index f047b156d37..d36250099dd 100644 --- a/spring-test/src/main/java/org/springframework/test/context/transaction/BeforeTransaction.java +++ b/spring-test/src/main/java/org/springframework/test/context/transaction/BeforeTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/jpa/AbstractAspectjJpaTests.java b/spring-test/src/main/java/org/springframework/test/jpa/AbstractAspectjJpaTests.java index 3ccb4000e68..dd55d0e78b1 100644 --- a/spring-test/src/main/java/org/springframework/test/jpa/AbstractAspectjJpaTests.java +++ b/spring-test/src/main/java/org/springframework/test/jpa/AbstractAspectjJpaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java b/spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java index 3afa5165861..ba959d162f2 100644 --- a/spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java +++ b/spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/jpa/OrmXmlOverridingShadowingClassLoader.java b/spring-test/src/main/java/org/springframework/test/jpa/OrmXmlOverridingShadowingClassLoader.java index 8bb2d00acbb..9cf1ded10a8 100644 --- a/spring-test/src/main/java/org/springframework/test/jpa/OrmXmlOverridingShadowingClassLoader.java +++ b/spring-test/src/main/java/org/springframework/test/jpa/OrmXmlOverridingShadowingClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/main/java/org/springframework/test/web/AbstractModelAndViewTests.java b/spring-test/src/main/java/org/springframework/test/web/AbstractModelAndViewTests.java index 887adccf109..fefc31e1615 100644 --- a/spring-test/src/main/java/org/springframework/test/web/AbstractModelAndViewTests.java +++ b/spring-test/src/main/java/org/springframework/test/web/AbstractModelAndViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/beans/Colour.java b/spring-test/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 194e0037973..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings({ "serial", "deprecation" }) -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - - private Colour(int code, String label) { - super(code, label); - } - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-test/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/IOther.java b/spring-test/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/ITestBean.java b/spring-test/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-test/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index cd1724f2645..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -@SuppressWarnings("rawtypes") -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - @SuppressWarnings("unchecked") - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] { tb0, tb1 }; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-test/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/beans/TestBean.java b/spring-test/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index d84f85d0964..00000000000 --- a/spring-test/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -@SuppressWarnings("rawtypes") -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] { spouse }; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] { spouse }; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] { spouse }; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - /** - * @see ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - - /** - * @see ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java index e627a333be2..a254398c4ed 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java @@ -143,6 +143,7 @@ public class MockFilterChainTests { this.servlet = servlet; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { @@ -156,9 +157,11 @@ public class MockFilterChainTests { } } + @Override public void init(FilterConfig filterConfig) throws ServletException { } + @Override public void destroy() { } } diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockPageContextTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockPageContextTests.java index 5a6c915365d..493cdc755dd 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockPageContextTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockPageContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/AbstractSpr3350SingleSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/AbstractSpr3350SingleSpringContextTests.java index eb8f362d56d..ba8c81c2945 100644 --- a/spring-test/src/test/java/org/springframework/test/AbstractSpr3350SingleSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/AbstractSpr3350SingleSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; @@ -54,6 +54,7 @@ public abstract class AbstractSpr3350SingleSpringContextTests extends AbstractDe * * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigPath() */ + @Override protected abstract String getConfigPath(); /** diff --git a/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests-context.properties b/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests-context.properties index 307a4e93df2..7b96503a3fe 100644 --- a/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests-context.properties +++ b/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests-context.properties @@ -1,2 +1,2 @@ -cat.(class)=org.springframework.beans.Pet +cat.(class)=org.springframework.tests.sample.beans.Pet cat.$0=Garfield diff --git a/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests.java index d0da3c8e5ad..07b0cf4b5eb 100644 --- a/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/PropertiesBasedSpr3350SingleSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2012 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. @@ -44,6 +44,7 @@ public class PropertiesBasedSpr3350SingleSpringContextTests extends AbstractSpr3 * * @see org.springframework.test.AbstractSingleSpringContextTests#createBeanDefinitionReader(org.springframework.context.support.GenericApplicationContext) */ + @Override protected final BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context) { return new PropertiesBeanDefinitionReader(context); } @@ -52,6 +53,7 @@ public class PropertiesBasedSpr3350SingleSpringContextTests extends AbstractSpr3 * Returns * "PropertiesBasedSpr3350SingleSpringContextTests-context.properties". */ + @Override protected final String getConfigPath() { return "PropertiesBasedSpr3350SingleSpringContextTests-context.properties"; } diff --git a/spring-test/src/test/java/org/springframework/test/Spr3264DependencyInjectionSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/Spr3264DependencyInjectionSpringContextTests.java index ab6e42dc68c..08523c79492 100644 --- a/spring-test/src/test/java/org/springframework/test/Spr3264DependencyInjectionSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/Spr3264DependencyInjectionSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -57,6 +57,7 @@ public class Spr3264DependencyInjectionSpringContextTests extends AbstractDepend // Assert changes to AbstractDependencyInjectionSpringContextTests: new AssertThrows(IllegalStateException.class) { + @Override public void test() throws Exception { Spr3264DependencyInjectionSpringContextTests.super.injectDependencies(); } diff --git a/spring-test/src/test/java/org/springframework/test/Spr3264SingleSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/Spr3264SingleSpringContextTests.java index 496bbc1b010..4b3223f4ba6 100644 --- a/spring-test/src/test/java/org/springframework/test/Spr3264SingleSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/Spr3264SingleSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests-context.xml b/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests-context.xml index 72360454848..b1939de12fd 100644 --- a/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests-context.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests.java index 8143c775115..192d005f4a8 100644 --- a/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/XmlBasedSpr3350SingleSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2012 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 @@ public class XmlBasedSpr3350SingleSpringContextTests extends AbstractSpr3350Sing /** * Returns "XmlBasedSpr3350SingleSpringContextTests-context.xml". */ + @Override protected final String getConfigPath() { return "XmlBasedSpr3350SingleSpringContextTests-context.xml"; } diff --git a/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueAnnotationAwareTransactionalTests.java b/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueAnnotationAwareTransactionalTests.java index 580b873b10b..1568b6fbacb 100644 --- a/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueAnnotationAwareTransactionalTests.java +++ b/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueAnnotationAwareTransactionalTests.java @@ -138,6 +138,7 @@ public class ProfileValueAnnotationAwareTransactionalTests extends TestCase { public static class HardCodedProfileValueSource implements ProfileValueSource { + @Override public String get(String key) { return (key.equals(NAME) ? VALUE : null); } diff --git a/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java b/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java index 7ec007c0160..bb715753aff 100644 --- a/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java +++ b/spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java b/spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java index 613dc3acce8..3768b03cb63 100644 --- a/spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java b/spring-test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java index aace2b29a41..fdfa4eb4ac8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java @@ -447,12 +447,14 @@ public class ContextLoaderUtilsTests { private static class FooInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { } } private static class BarInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericWebApplicationContext applicationContext) { } } diff --git a/spring-test/src/test/java/org/springframework/test/context/MergedContextConfigurationTests.java b/spring-test/src/test/java/org/springframework/test/context/MergedContextConfigurationTests.java index 9bd67303ba5..35b64fa432b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/MergedContextConfigurationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/MergedContextConfigurationTests.java @@ -369,12 +369,14 @@ public class MergedContextConfigurationTests { private static class FooInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { } } private static class BarInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { } } diff --git a/spring-test/src/test/java/org/springframework/test/context/SpringRunnerContextCacheTests.java b/spring-test/src/test/java/org/springframework/test/context/SpringRunnerContextCacheTests.java index 8ae941c107e..d27e3ca50d5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/SpringRunnerContextCacheTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/SpringRunnerContextCacheTests.java @@ -146,6 +146,7 @@ public class SpringRunnerContextCacheTests { java.util.Collections.sort(testMethods, new Comparator() { + @Override public int compare(FrameworkMethod method1, FrameworkMethod method2) { return method1.getName().compareTo(method2.getName()); } diff --git a/spring-test/src/test/java/org/springframework/test/context/TestContextCacheKeyTests.java b/spring-test/src/test/java/org/springframework/test/context/TestContextCacheKeyTests.java index a504642a928..d7659379409 100644 --- a/spring-test/src/test/java/org/springframework/test/context/TestContextCacheKeyTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/TestContextCacheKeyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/TestContextManagerTests.java b/spring-test/src/test/java/org/springframework/test/context/TestContextManagerTests.java index 69c5ba2d433..97f303b809b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/TestContextManagerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/TestContextManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests-context.properties b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests-context.properties index 1efbb6201e0..45d36076bba 100644 --- a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests-context.properties +++ b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests-context.properties @@ -1,4 +1,4 @@ -dog.(class)=org.springframework.beans.Pet +dog.(class)=org.springframework.tests.sample.beans.Pet dog.$0=Fido testString2.(class)=java.lang.String diff --git a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests.java b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests.java index 869d41ab270..3a976747ea7 100644 --- a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesAndInheritedLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextLoader; diff --git a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests-context.properties b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests-context.properties index 1efbb6201e0..45d36076bba 100644 --- a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests-context.properties +++ b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests-context.properties @@ -1,4 +1,4 @@ -dog.(class)=org.springframework.beans.Pet +dog.(class)=org.springframework.tests.sample.beans.Pet dog.$0=Fido testString2.(class)=java.lang.String diff --git a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests.java b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests.java index 10f0e1ef419..77f079aec24 100644 --- a/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/configuration/ContextConfigurationWithPropertiesExtendingPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextLoader; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests-context.xml index acdab7073c1..9f2fdef412d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests-context.xml @@ -3,13 +3,13 @@ xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests.java index b1a0a4e5514..735f96a01f6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit38/ConcreteTransactionalJUnit38SpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -23,8 +23,8 @@ import javax.sql.DataSource; import org.junit.internal.runners.JUnit38ClassRunner; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; @@ -109,10 +109,12 @@ public class ConcreteTransactionalJUnit38SpringContextTests extends AbstractTran return simpleJdbcTemplate.update("DELETE FROM person WHERE name=?", name); } + @Override public final void afterPropertiesSet() throws Exception { this.beanInitialized = true; } + @Override public final void setBeanName(final String beanName) { this.beanName = beanName; } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java index 39cf8624ad5..6cecd0c267d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -187,6 +187,7 @@ public class ProfileValueJUnit38SpringContextTests extends TestCase { public static class HardCodedProfileValueSource implements ProfileValueSource { + @Override public String get(final String key) { return (key.equals(NAME) ? VALUE : null); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/AbsolutePathSpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/AbsolutePathSpringJUnit4ClassRunnerAppCtxTests.java index 419997161eb..0e53eef4824 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/AbsolutePathSpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/AbsolutePathSpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/AbstractTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/AbstractTransactionalSpringRunnerTests.java index ebe40daa0ac..5ada9b5c618 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/AbstractTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/AbstractTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelDisabledSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelDisabledSpringRunnerTests.java index 1c18259f1f9..7ae72d581f8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelDisabledSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelDisabledSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -42,22 +42,27 @@ public class ClassLevelDisabledSpringRunnerTests { public static class CustomTestExecutionListener implements TestExecutionListener { + @Override public void beforeTestClass(TestContext testContext) throws Exception { fail("A listener method for a disabled test should never be executed!"); } + @Override public void prepareTestInstance(TestContext testContext) throws Exception { fail("A listener method for a disabled test should never be executed!"); } + @Override public void beforeTestMethod(TestContext testContext) throws Exception { fail("A listener method for a disabled test should never be executed!"); } + @Override public void afterTestMethod(TestContext testContext) throws Exception { fail("A listener method for a disabled test should never be executed!"); } + @Override public void afterTestClass(TestContext testContext) throws Exception { fail("A listener method for a disabled test should never be executed!"); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelTransactionalSpringRunnerTests.java index 78075bc3f3d..02c0dcf0fa5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassLevelTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests.java index a9284c78f08..4bb3fb5bfa4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests-context.xml index a219470ce63..a91178410a2 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests-context.xml @@ -8,13 +8,13 @@ - + - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests.java index 01ec43a2fd1..c88aed37d12 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ConcreteTransactionalJUnit4SpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -29,8 +29,8 @@ import javax.sql.DataSource; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; @@ -104,6 +104,7 @@ public class ConcreteTransactionalJUnit4SpringContextTests extends AbstractTrans return simpleJdbcTemplate.update("DELETE FROM person WHERE name=?", name); } + @Override @Resource public void setDataSource(DataSource dataSource) { super.setDataSource(dataSource); @@ -119,10 +120,12 @@ public class ConcreteTransactionalJUnit4SpringContextTests extends AbstractTrans this.bar = bar; } + @Override public final void setBeanName(final String beanName) { this.beanName = beanName; } + @Override public final void afterPropertiesSet() throws Exception { this.beanInitialized = true; } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/CustomDefaultContextLoaderClassSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/CustomDefaultContextLoaderClassSpringRunnerTests.java index ad7de4f2701..3ee77974a0e 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/CustomDefaultContextLoaderClassSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/CustomDefaultContextLoaderClassSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.model.InitializationError; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.support.GenericPropertiesContextLoader; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackFalseTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackFalseTransactionalSpringRunnerTests.java index c51b95cb3f2..08f91b536af 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackFalseTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackFalseTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackTrueTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackTrueTransactionalSpringRunnerTests.java index cc5ad01ff25..d7bfb8c2cd4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackTrueTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/DefaultRollbackTrueTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java index 80366aed5aa..ca7b3126628 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/HardCodedProfileValueSourceSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/HardCodedProfileValueSourceSpringRunnerTests.java index 8e422e1c0cd..cea2a29c79d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/HardCodedProfileValueSourceSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/HardCodedProfileValueSourceSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -48,6 +48,7 @@ public class HardCodedProfileValueSourceSpringRunnerTests extends EnabledAndIgno public static class HardCodedProfileValueSource implements ProfileValueSource { + @Override public String get(final String key) { return (key.equals(NAME) ? VALUE : null); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/MethodLevelTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/MethodLevelTransactionalSpringRunnerTests.java index db69a60506c..6cc35c641b8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/MethodLevelTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/MethodLevelTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context1.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context1.xml index 2f6eda6962f..b40fed69ca8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context1.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context1.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context2.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context2.xml index cb75b8accd4..f6a90a62eac 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context2.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests-context2.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests.java index 75a32cda3af..a77f7239d1b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests-context.xml index 62206fde4a8..67590a6b584 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests-context.xml @@ -2,19 +2,19 @@ - + - + - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests.java index ed2f58de118..bf07919721b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ParameterizedDependencyInjectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -31,8 +31,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests-context.properties b/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests-context.properties index 0e62ef734fc..6df81585fb4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests-context.properties +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests-context.properties @@ -1,4 +1,4 @@ -cat.(class)=org.springframework.beans.Pet +cat.(class)=org.springframework.tests.sample.beans.Pet cat.$0=Garfield testString.(class)=java.lang.String diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests.java index 5c2d39499c4..b5d74839f68 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/PropertiesBasedSpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import java.util.Properties; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests.java index 22f0c6ebe81..a662b7b8bff 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -53,6 +53,7 @@ public class RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests e countRowsInPersonTable(simpleJdbcTemplate)); } + @Override @Before public void verifyInitialTestData() { clearPersonTable(simpleJdbcTemplate); @@ -61,6 +62,7 @@ public class RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests e countRowsInPersonTable(simpleJdbcTemplate)); } + @Override @Test @Transactional @Rollback(false) diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java index 61059c36399..3229df93d56 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml index dffdb30f99b..704b3478733 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml @@ -2,13 +2,13 @@ - + - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests.java index 85af698bd33..4973d7c68de 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -29,8 +29,8 @@ import javax.inject.Named; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.BeansException; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; @@ -136,14 +136,17 @@ public class SpringJUnit4ClassRunnerAppCtxTests implements ApplicationContextAwa // ------------------------------------------------------------------------| + @Override public final void afterPropertiesSet() throws Exception { this.beanInitialized = true; } + @Override public final void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } + @Override public final void setBeanName(final String beanName) { this.beanName = beanName; } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4SuiteTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4SuiteTests.java index d8446ea5791..2f293d88475 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4SuiteTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4SuiteTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/TimedTransactionalSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/TimedTransactionalSpringRunnerTests.java index ad6090ab612..751ec07e92d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/TimedTransactionalSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/TimedTransactionalSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/TrackingRunListener.java b/spring-test/src/test/java/org/springframework/test/context/junit4/TrackingRunListener.java index 2b387520827..4c257540b96 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/TrackingRunListener.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/TrackingRunListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/DevProfileInitializer.java b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/DevProfileInitializer.java index 64d8cf2e483..f5424607d56 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/DevProfileInitializer.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/DevProfileInitializer.java @@ -25,6 +25,7 @@ import org.springframework.context.support.GenericApplicationContext; */ public class DevProfileInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { applicationContext.getEnvironment().setActiveProfiles("dev"); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/FooBarAliasInitializer.java b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/FooBarAliasInitializer.java index 0f0858c4baa..1259b82d83d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/FooBarAliasInitializer.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/FooBarAliasInitializer.java @@ -25,6 +25,7 @@ import org.springframework.context.support.GenericApplicationContext; */ public class FooBarAliasInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { applicationContext.registerAlias("foo", "bar"); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/InitializerWithoutConfigFilesOrClassesTest.java b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/InitializerWithoutConfigFilesOrClassesTest.java index 3c0b074a812..5d1459c4ce7 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/InitializerWithoutConfigFilesOrClassesTest.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/InitializerWithoutConfigFilesOrClassesTest.java @@ -53,6 +53,7 @@ public class InitializerWithoutConfigFilesOrClassesTest { static class EntireAppInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { new AnnotatedBeanDefinitionReader(applicationContext).register(GlobalConfig.class); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/MergedInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/MergedInitializersAnnotationConfigTests.java index 30fe35276fc..0bc08e1c458 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/MergedInitializersAnnotationConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/MergedInitializersAnnotationConfigTests.java @@ -34,6 +34,7 @@ import org.springframework.test.context.junit4.aci.DevProfileInitializer; @ContextConfiguration(initializers = DevProfileInitializer.class) public class MergedInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests { + @Override @Test public void activeBeans() { assertEquals("foo", foo); diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/OrderedInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/OrderedInitializersAnnotationConfigTests.java index d3fcf1dd820..2eac43320f4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/OrderedInitializersAnnotationConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/OrderedInitializersAnnotationConfigTests.java @@ -125,10 +125,12 @@ public class OrderedInitializersAnnotationConfigTests { static class OrderedOneInitializer implements ApplicationContextInitializer, Ordered { + @Override public void initialize(GenericApplicationContext applicationContext) { applicationContext.getEnvironment().setActiveProfiles(PROFILE_ONE); } + @Override public int getOrder() { return 1; } @@ -137,6 +139,7 @@ public class OrderedInitializersAnnotationConfigTests { @Order(2) static class OrderedTwoInitializer implements ApplicationContextInitializer { + @Override public void initialize(GenericApplicationContext applicationContext) { applicationContext.getEnvironment().setActiveProfiles(PROFILE_TWO); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java index 835398cb1bb..219010f12b8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingDefaultConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingDefaultConfigClassesInheritedTests.java index 70e1a8dd5c0..a0c51ded527 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingDefaultConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingDefaultConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingExplicitConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingExplicitConfigClassesInheritedTests.java index 223c5a6f592..54a9dd26bac 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingExplicitConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/BeanOverridingExplicitConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesBaseTests.java index 87738909689..e8a440a230a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesInheritedTests.java index aed661d8385..05c74a29eb7 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingDefaultConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingDefaultConfigClassesInheritedTests.java index db1c4bca19d..7af6a541b45 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingDefaultConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingDefaultConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingExplicitConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingExplicitConfigClassesInheritedTests.java index cfc0a5fd533..26dd5f470ec 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingExplicitConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderBeanOverridingExplicitConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesBaseTests.java index f2b001e10d1..00da19f130c 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesInheritedTests.java index 6ba03e1bc4a..9b4793e462f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderDefaultConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesBaseTests.java index b2e4fedb24f..6613a695b4a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesInheritedTests.java index f769cb1a133..a0f7668ae2f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultLoaderExplicitConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesBaseTests.java index da02bb82281..7da5e68bd01 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesInheritedTests.java index 6a384d8c6ac..cca20f48278 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/ExplicitConfigClassesInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java index bd69ae15ff6..19eefe388ae 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,8 +16,8 @@ package org.springframework.test.context.junit4.annotation; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/DriversLicense.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/DriversLicense.java index 464ff84af01..dc06571f19d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/DriversLicense.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/DriversLicense.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/Person.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/Person.java index 882578a189b..c6f765ea952 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/Person.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/domain/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/PersonRepository.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/PersonRepository.java index 56bd2987393..409aade593a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/PersonRepository.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/PersonRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/hibernate/HibernatePersonRepository.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/hibernate/HibernatePersonRepository.java index 994b886b30e..eac2522cd2a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/hibernate/HibernatePersonRepository.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/repository/hibernate/HibernatePersonRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -39,11 +39,13 @@ public class HibernatePersonRepository implements PersonRepository { this.sessionFactory = sessionFactory; } + @Override public Person save(Person person) { this.sessionFactory.getCurrentSession().save(person); return person; } + @Override public Person findByName(String name) { return (Person) this.sessionFactory.getCurrentSession().createQuery( "from Person person where person.name = :name").setString("name", name).uniqueResult(); diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/PersonService.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/PersonService.java index e8a7c2f5a56..76421e3706c 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/PersonService.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/PersonService.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/impl/StandardPersonService.java b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/impl/StandardPersonService.java index 039faa6894f..92602e1527f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/impl/StandardPersonService.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/orm/service/impl/StandardPersonService.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -41,10 +41,12 @@ public class StandardPersonService implements PersonService { this.personRepository = personRepository; } + @Override public Person findByName(String name) { return this.personRepository.findByName(name); } + @Override @Transactional(readOnly = false) public Person save(Person person) { return this.personRepository.save(person); diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileAnnotationConfigTests.java index cc26b849dbb..836dca41df5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileAnnotationConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileAnnotationConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileConfig.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileConfig.java index 98cc3af1495..44b5675a89a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileConfig.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DefaultProfileConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.profile.annotation; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DevProfileConfig.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DevProfileConfig.java index 9fb695889ae..cafc8b6e475 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DevProfileConfig.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/annotation/DevProfileConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.profile.annotation; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileAnnotationConfigTests.java index f6f2907f875..07a8d2d5ffc 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileAnnotationConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileAnnotationConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileConfig.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileConfig.java index a4af38435a4..818212dd3e1 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileConfig.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/DefaultProfileConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.profile.importresource; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/import.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/import.xml index 8427a674a3d..3861d0ec592 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/import.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/importresource/import.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests-context.xml index 1fc6d4ecfc9..0e672de0843 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests-context.xml @@ -2,12 +2,12 @@ - + - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests.java index f79a9b0aa5d..1ed4f5467a4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/profile/xml/DefaultProfileXmlConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2013 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. @@ -22,8 +22,8 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/BeanOverridingDefaultLocationsInheritedTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/BeanOverridingDefaultLocationsInheritedTests-context.xml index 55a4cff1e8a..7238260bd43 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/BeanOverridingDefaultLocationsInheritedTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/BeanOverridingDefaultLocationsInheritedTests-context.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests-context.xml index 2f6eda6962f..b40fed69ca8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests-context.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests.java index fb373a03479..7131201d438 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests-context.xml index cb75b8accd4..f6a90a62eac 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests-context.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests.java index 9896e35880b..1f488ec26c6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/DefaultLocationsInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsBaseTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsBaseTests.java index 1c9fbe91255..cd81b6becb8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsBaseTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsBaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsInheritedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsInheritedTests.java index 5c99fefa39f..b01764251c8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsInheritedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr3896/ExplicitLocationsInheritedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr6128/AutowiredQualifierTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr6128/AutowiredQualifierTests.java index 47d7dab773b..6bdeeee2348 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr6128/AutowiredQualifierTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr6128/AutowiredQualifierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AbstractTransactionalAnnotatedConfigClassTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AbstractTransactionalAnnotatedConfigClassTests.java index d8b7fcacf3f..54b55c8c440 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AbstractTransactionalAnnotatedConfigClassTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AbstractTransactionalAnnotatedConfigClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassWithAtConfigurationTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassWithAtConfigurationTests.java index 373166d9b41..6e0f84f7339 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassWithAtConfigurationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassWithAtConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import static org.junit.Assert.assertSame; import javax.sql.DataSource; import org.junit.Before; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DataSourceTransactionManager; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassesWithoutAtConfigurationTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassesWithoutAtConfigurationTests.java index 3f6a054ecb0..622f0dfe682 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassesWithoutAtConfigurationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/TransactionalAnnotatedConfigClassesWithoutAtConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotSame; import javax.sql.DataSource; import org.junit.Before; -import org.springframework.beans.Employee; +import org.springframework.tests.sample.beans.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.core.JdbcTemplate; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9604/LookUpTxMgrViaTransactionManagementConfigurerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9604/LookUpTxMgrViaTransactionManagementConfigurerTests.java index de9e21b2e35..5dbba76acbd 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9604/LookUpTxMgrViaTransactionManagementConfigurerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9604/LookUpTxMgrViaTransactionManagementConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9604; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.TransactionManagementConfigurer; import org.springframework.transaction.annotation.Transactional; @@ -50,6 +50,7 @@ public class LookUpTxMgrViaTransactionManagementConfigurerTests { @Configuration static class Config implements TransactionManagementConfigurer { + @Override public PlatformTransactionManager annotationDrivenTransactionManager() { return txManager1(); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpNonexistentTxMgrTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpNonexistentTxMgrTests.java index 72af7e7a7bc..78720a8f5ec 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpNonexistentTxMgrTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpNonexistentTxMgrTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; /** diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndDefaultNameTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndDefaultNameTests.java index 6f1525229fd..331342d4fcc 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndDefaultNameTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndDefaultNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndNameTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndNameTests.java index d8c070c5043..76a82b823c2 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndNameTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,7 +27,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; import org.springframework.test.context.transaction.TransactionConfiguration; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtClassLevelTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtClassLevelTests.java index bbc0951e4fc..8492b02d5a6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtClassLevelTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtClassLevelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtMethodLevelTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtMethodLevelTests.java index b9d6b4b6aef..363d47a9b27 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtMethodLevelTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeAndQualifierAtMethodLevelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeTests.java index b7a52aa961b..957533f9130 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/spr9645/LookUpTxMgrByTypeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.test.context.junit4.spr9645; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; -import org.springframework.test.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-test/src/test/java/org/springframework/test/context/support/AnnotatedFooConfigInnerClassTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/AnnotatedFooConfigInnerClassTestCase.java index 85da86b3f55..bb2e80b9f30 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/AnnotatedFooConfigInnerClassTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/AnnotatedFooConfigInnerClassTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderTests.java b/spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderTests.java index d56c24f5e5d..9d071b1647f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/ContextConfigurationInnerClassTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/ContextConfigurationInnerClassTestCase.java index adaff61eb02..ea0c4e8401d 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/ContextConfigurationInnerClassTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/ContextConfigurationInnerClassTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/CustomizedGenericXmlContextLoaderTests.java b/spring-test/src/test/java/org/springframework/test/context/support/CustomizedGenericXmlContextLoaderTests.java index 847dbd97e8b..1d930831d08 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/CustomizedGenericXmlContextLoaderTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/CustomizedGenericXmlContextLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/FinalConfigInnerClassTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/FinalConfigInnerClassTestCase.java index 7cde8c0190b..1c5d85d6059 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/FinalConfigInnerClassTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/FinalConfigInnerClassTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests.java b/spring-test/src/test/java/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests.java index d8fc57b3f16..bf53acc5425 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/MultipleStaticConfigurationClassesTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/MultipleStaticConfigurationClassesTestCase.java index e9e69e1a19b..a9069a1d06c 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/MultipleStaticConfigurationClassesTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/MultipleStaticConfigurationClassesTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/NonStaticConfigInnerClassesTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/NonStaticConfigInnerClassesTestCase.java index a8ae4fcc8bc..db9d91790c5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/NonStaticConfigInnerClassesTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/NonStaticConfigInnerClassesTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/support/PlainVanillaFooConfigInnerClassTestCase.java b/spring-test/src/test/java/org/springframework/test/context/support/PlainVanillaFooConfigInnerClassTestCase.java index a5693135559..427191bcfcc 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/PlainVanillaFooConfigInnerClassTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/PlainVanillaFooConfigInnerClassTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/AnnotationConfigTransactionalTestNGSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/testng/AnnotationConfigTransactionalTestNGSpringContextTests.java index 4cfb6b8abc4..f20e466410f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/AnnotationConfigTransactionalTestNGSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/testng/AnnotationConfigTransactionalTestNGSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -23,8 +23,8 @@ import static org.testng.Assert.assertNotNull; import javax.sql.DataSource; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests-context.xml b/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests-context.xml index 11e92153da0..a46a6da3d1f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests-context.xml +++ b/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests-context.xml @@ -5,10 +5,10 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"> - - + diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests.java index 27a08c054c2..ee25cb32e45 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/testng/ConcreteTransactionalTestNGSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -25,8 +25,8 @@ import static org.testng.Assert.assertTrue; import javax.annotation.Resource; -import org.springframework.beans.Employee; -import org.springframework.beans.Pet; +import org.springframework.tests.sample.beans.Employee; +import org.springframework.tests.sample.beans.Pet; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; @@ -90,10 +90,12 @@ public class ConcreteTransactionalTestNGSpringContextTests extends AbstractTrans return simpleJdbcTemplate.update("DELETE FROM person WHERE name=?", name); } + @Override public void afterPropertiesSet() throws Exception { this.beanInitialized = true; } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java index 66318987d00..05ba435f9b3 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -123,27 +123,34 @@ public class FailingBeforeAndAfterMethodsTests { int failedConfigurationsCount = 0; + @Override public void onFinish(ITestContext testContext) { this.failedConfigurationsCount += testContext.getFailedConfigurations().size(); } + @Override public void onStart(ITestContext testContext) { } + @Override public void onTestFailedButWithinSuccessPercentage(ITestResult testResult) { } + @Override public void onTestFailure(ITestResult testResult) { this.testFailureCount++; } + @Override public void onTestSkipped(ITestResult testResult) { } + @Override public void onTestStart(ITestResult testResult) { this.testStartCount++; } + @Override public void onTestSuccess(ITestResult testResult) { this.testSuccessCount++; } @@ -230,7 +237,8 @@ public class FailingBeforeAndAfterMethodsTests { @BeforeTransaction public void beforeTransaction() { - org.testng.Assert.fail("always failing beforeTransaction()"); + // See SPR-8116 + //org.testng.Assert.fail("always failing beforeTransaction()"); } } @@ -243,7 +251,8 @@ public class FailingBeforeAndAfterMethodsTests { @AfterTransaction public void afterTransaction() { - org.testng.Assert.fail("always failing afterTransaction()"); + // See SPR-8116 + //org.testng.Assert.fail("always failing afterTransaction()"); } } diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java b/spring-test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java index cdc23e35bf3..bedd776bce9 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/testng/TimedTransactionalTestNGSpringContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/context/web/AbstractBasicWacTests.java b/spring-test/src/test/java/org/springframework/test/context/web/AbstractBasicWacTests.java index 5a1a8421dda..334983d8076 100644 --- a/spring-test/src/test/java/org/springframework/test/context/web/AbstractBasicWacTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/web/AbstractBasicWacTests.java @@ -66,6 +66,7 @@ public abstract class AbstractBasicWacTests implements ServletContextAware { protected String foo; + @Override public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } diff --git a/spring-test/src/test/java/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests.java b/spring-test/src/test/java/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests.java index c07b25a9273..829d70ffec5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpSession; diff --git a/spring-test/src/test/java/org/springframework/test/transaction/TransactionTestUtils.java b/spring-test/src/test/java/org/springframework/test/transaction/TransactionTestUtils.java index 3be9e53ca87..d5598c26f5f 100644 --- a/spring-test/src/test/java/org/springframework/test/transaction/TransactionTestUtils.java +++ b/spring-test/src/test/java/org/springframework/test/transaction/TransactionTestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java b/spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java index 5b64657360d..7e10a054531 100644 --- a/spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java +++ b/spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java @@ -86,6 +86,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling setField() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { setField(person, "id", null, long.class); } @@ -94,6 +95,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling setField() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { setField(person, "age", null, int.class); } @@ -102,6 +104,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling setField() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { setField(person, "likesPets", null, boolean.class); } @@ -187,6 +190,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling invokeSetterMethod() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { invokeSetterMethod(person, "id", null, long.class); } @@ -195,6 +199,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling invokeSetterMethod() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { invokeSetterMethod(person, "age", null, int.class); } @@ -203,6 +208,7 @@ public class ReflectionTestUtilsTests { new AssertThrows(IllegalArgumentException.class, "Calling invokeSetterMethod() with NULL for a primitive type should throw an IllegalArgumentException.") { + @Override public void test() throws Exception { invokeSetterMethod(person, "likesPets", null, boolean.class); } diff --git a/spring-test/src/test/java/org/springframework/test/util/subpackage/Person.java b/spring-test/src/test/java/org/springframework/test/util/subpackage/Person.java index eac5e7b76f5..66304779575 100644 --- a/spring-test/src/test/java/org/springframework/test/util/subpackage/Person.java +++ b/spring-test/src/test/java/org/springframework/test/util/subpackage/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-test/src/test/resources/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests-context.xml b/spring-test/src/test/resources/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests-context.xml index 0930460eeaa..7f2a6c5b232 100644 --- a/spring-test/src/test/resources/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests-context.xml +++ b/spring-test/src/test/resources/org/springframework/test/context/web/RequestAndSessionScopedBeansWacTests-context.xml @@ -2,10 +2,10 @@ - + - + diff --git a/spring-tx/src/main/java/org/springframework/dao/CannotAcquireLockException.java b/spring-tx/src/main/java/org/springframework/dao/CannotAcquireLockException.java index b9c8aa80e99..82cd00574b4 100644 --- a/spring-tx/src/main/java/org/springframework/dao/CannotAcquireLockException.java +++ b/spring-tx/src/main/java/org/springframework/dao/CannotAcquireLockException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/CannotSerializeTransactionException.java b/spring-tx/src/main/java/org/springframework/dao/CannotSerializeTransactionException.java index b75a74281ea..1e303dd9075 100644 --- a/spring-tx/src/main/java/org/springframework/dao/CannotSerializeTransactionException.java +++ b/spring-tx/src/main/java/org/springframework/dao/CannotSerializeTransactionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java index 4e77ce5a162..b6801d20bca 100644 --- a/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/ConcurrencyFailureException.java b/spring-tx/src/main/java/org/springframework/dao/ConcurrencyFailureException.java index 48404930548..eda824bb3e8 100644 --- a/spring-tx/src/main/java/org/springframework/dao/ConcurrencyFailureException.java +++ b/spring-tx/src/main/java/org/springframework/dao/ConcurrencyFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java index 4ee94c17aed..bc1c8ce35b9 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DataAccessResourceFailureException.java b/spring-tx/src/main/java/org/springframework/dao/DataAccessResourceFailureException.java index c1af3068a71..c7b6c88e36e 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DataAccessResourceFailureException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DataAccessResourceFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DataIntegrityViolationException.java b/spring-tx/src/main/java/org/springframework/dao/DataIntegrityViolationException.java index 445e7e5171b..ae06fa821f1 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DataIntegrityViolationException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DataIntegrityViolationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DataRetrievalFailureException.java b/spring-tx/src/main/java/org/springframework/dao/DataRetrievalFailureException.java index c28811f4cce..4631790d62d 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DataRetrievalFailureException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DataRetrievalFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DeadlockLoserDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/DeadlockLoserDataAccessException.java index 17592afe479..7b41fe7d559 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DeadlockLoserDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DeadlockLoserDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java b/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java index 08de0dbaca7..4ec0b72512c 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java index cec38dc16bf..3179a3adc9d 100644 --- a/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessApiUsageException.java b/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessApiUsageException.java index 7a401c24d37..907f621809f 100644 --- a/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessApiUsageException.java +++ b/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessApiUsageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessResourceUsageException.java b/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessResourceUsageException.java index fc29c8a0c16..f284362602f 100644 --- a/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessResourceUsageException.java +++ b/spring-tx/src/main/java/org/springframework/dao/InvalidDataAccessResourceUsageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java index 7970724c43e..d41930a6d95 100644 --- a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessResourceException.java b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessResourceException.java index 5bf9e388782..99bdcf324be 100644 --- a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessResourceException.java +++ b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessResourceException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/OptimisticLockingFailureException.java b/spring-tx/src/main/java/org/springframework/dao/OptimisticLockingFailureException.java index f42faa26a39..131bbd6fd90 100644 --- a/spring-tx/src/main/java/org/springframework/dao/OptimisticLockingFailureException.java +++ b/spring-tx/src/main/java/org/springframework/dao/OptimisticLockingFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/PermissionDeniedDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/PermissionDeniedDataAccessException.java index ce08465ae4e..4ec552b2173 100644 --- a/spring-tx/src/main/java/org/springframework/dao/PermissionDeniedDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/PermissionDeniedDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/PessimisticLockingFailureException.java b/spring-tx/src/main/java/org/springframework/dao/PessimisticLockingFailureException.java index 698e3d07d03..a5ab2dc9d8a 100644 --- a/spring-tx/src/main/java/org/springframework/dao/PessimisticLockingFailureException.java +++ b/spring-tx/src/main/java/org/springframework/dao/PessimisticLockingFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java index 5c30bd6bafa..64e940b5223 100644 --- a/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java index 94f31e0bfb6..699d2eca64b 100644 --- a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessResourceException.java b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessResourceException.java index 032abe67f44..592bf859a4d 100644 --- a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessResourceException.java +++ b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessResourceException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/TypeMismatchDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/TypeMismatchDataAccessException.java index 875db8c3194..fe93de4cae4 100644 --- a/spring-tx/src/main/java/org/springframework/dao/TypeMismatchDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/TypeMismatchDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/UncategorizedDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/UncategorizedDataAccessException.java index 0b5d532c33c..69d5e94cc2f 100644 --- a/spring-tx/src/main/java/org/springframework/dao/UncategorizedDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/UncategorizedDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisor.java b/spring-tx/src/main/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisor.java index 19b5cba0a19..2b8358d678c 100644 --- a/spring-tx/src/main/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisor.java +++ b/spring-tx/src/main/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslator.java b/spring-tx/src/main/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslator.java index 4310c88371d..bdaddb8c55a 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslator.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/support/DaoSupport.java b/spring-tx/src/main/java/org/springframework/dao/support/DaoSupport.java index cc78d086e5a..4b5f6865c7d 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/DaoSupport.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/DaoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java b/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java index cbfeceb996f..d4c086695ec 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java index 5cd145bb303..9cf7432c435 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslator.java b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslator.java index b86d256a627..0c660ce0d6e 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslator.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/CannotCreateRecordException.java b/spring-tx/src/main/java/org/springframework/jca/cci/CannotCreateRecordException.java index 71025dbf6f7..d211087b372 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/CannotCreateRecordException.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/CannotCreateRecordException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/CannotGetCciConnectionException.java b/spring-tx/src/main/java/org/springframework/jca/cci/CannotGetCciConnectionException.java index d977f44576d..252a5255e64 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/CannotGetCciConnectionException.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/CannotGetCciConnectionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/CciOperationNotSupportedException.java b/spring-tx/src/main/java/org/springframework/jca/cci/CciOperationNotSupportedException.java index 8ecf30261d3..e6b66461463 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/CciOperationNotSupportedException.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/CciOperationNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/InvalidResultSetAccessException.java b/spring-tx/src/main/java/org/springframework/jca/cci/InvalidResultSetAccessException.java index 14185f79200..7e3200a3d5f 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/InvalidResultSetAccessException.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/InvalidResultSetAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/RecordTypeNotSupportedException.java b/spring-tx/src/main/java/org/springframework/jca/cci/RecordTypeNotSupportedException.java index 8eefbd7cc86..d0256cb1c76 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/RecordTypeNotSupportedException.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/RecordTypeNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/CciLocalTransactionManager.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/CciLocalTransactionManager.java index e2061896c88..aa7d38943d9 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/CciLocalTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/CciLocalTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionFactoryUtils.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionFactoryUtils.java index d9860a38bac..482a8dc0c92 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionFactoryUtils.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionFactoryUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java index 693345dc629..d6ad87f02b7 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionSpecConnectionFactoryAdapter.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionSpecConnectionFactoryAdapter.java index 532f12c007a..78f3b29a716 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionSpecConnectionFactoryAdapter.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionSpecConnectionFactoryAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/DelegatingConnectionFactory.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/DelegatingConnectionFactory.java index 24337ad0c0e..f01ac831008 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/DelegatingConnectionFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/DelegatingConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/NotSupportedRecordFactory.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/NotSupportedRecordFactory.java index 2fb9c1378ee..bf1808db812 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/NotSupportedRecordFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/NotSupportedRecordFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java index e9d43f4094c..fe391c88056 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/connection/TransactionAwareConnectionFactoryProxy.java b/spring-tx/src/main/java/org/springframework/jca/cci/connection/TransactionAwareConnectionFactoryProxy.java index fed1e44a994..f5b2b5d0ec4 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/connection/TransactionAwareConnectionFactoryProxy.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/connection/TransactionAwareConnectionFactoryProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/CciTemplate.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/CciTemplate.java index 11a9c147c95..d55909ebe07 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/CciTemplate.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/CciTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/ConnectionCallback.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/ConnectionCallback.java index 70ff9111e94..df138bdc0ae 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/ConnectionCallback.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/ConnectionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/InteractionCallback.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/InteractionCallback.java index 969a90115d8..7145d36b001 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/InteractionCallback.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/InteractionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordCreator.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordCreator.java index fea0d11ac9d..f19f6ac2c3d 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordCreator.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordExtractor.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordExtractor.java index 8dbfd91b21b..51ec87b2656 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordExtractor.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/RecordExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java index 107391e0a24..65cf5652870 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CommAreaRecord.java b/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CommAreaRecord.java index f69c1137ac0..982b43064b9 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CommAreaRecord.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/core/support/CommAreaRecord.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingCommAreaOperation.java b/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingCommAreaOperation.java index 638ae9d23aa..79612bea39c 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingCommAreaOperation.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingCommAreaOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingRecordOperation.java b/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingRecordOperation.java index 006ef3b8b39..413a034ae72 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingRecordOperation.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/object/MappingRecordOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/cci/object/SimpleRecordOperation.java b/spring-tx/src/main/java/org/springframework/jca/cci/object/SimpleRecordOperation.java index b7ad70d01c3..efbec34e4a7 100644 --- a/spring-tx/src/main/java/org/springframework/jca/cci/object/SimpleRecordOperation.java +++ b/spring-tx/src/main/java/org/springframework/jca/cci/object/SimpleRecordOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/context/BootstrapContextAware.java b/spring-tx/src/main/java/org/springframework/jca/context/BootstrapContextAware.java index d256310dfef..326b7f977c8 100644 --- a/spring-tx/src/main/java/org/springframework/jca/context/BootstrapContextAware.java +++ b/spring-tx/src/main/java/org/springframework/jca/context/BootstrapContextAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/context/SpringContextResourceAdapter.java b/spring-tx/src/main/java/org/springframework/jca/context/SpringContextResourceAdapter.java index 8e91d93394f..25bac956685 100644 --- a/spring-tx/src/main/java/org/springframework/jca/context/SpringContextResourceAdapter.java +++ b/spring-tx/src/main/java/org/springframework/jca/context/SpringContextResourceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/endpoint/AbstractMessageEndpointFactory.java b/spring-tx/src/main/java/org/springframework/jca/endpoint/AbstractMessageEndpointFactory.java index df965959bc6..01f27f23ffe 100644 --- a/spring-tx/src/main/java/org/springframework/jca/endpoint/AbstractMessageEndpointFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/endpoint/AbstractMessageEndpointFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java index 731467a77c0..fac5eba990c 100644 --- a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/jca/support/SimpleBootstrapContext.java b/spring-tx/src/main/java/org/springframework/jca/support/SimpleBootstrapContext.java index ac6ed06d323..d26fea73320 100644 --- a/spring-tx/src/main/java/org/springframework/jca/support/SimpleBootstrapContext.java +++ b/spring-tx/src/main/java/org/springframework/jca/support/SimpleBootstrapContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/CannotCreateTransactionException.java b/spring-tx/src/main/java/org/springframework/transaction/CannotCreateTransactionException.java index 76a84a53414..6e6fde8405b 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/CannotCreateTransactionException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/CannotCreateTransactionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java b/spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java index bd4910f1aef..1b60ca1606d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/IllegalTransactionStateException.java b/spring-tx/src/main/java/org/springframework/transaction/IllegalTransactionStateException.java index c234ec1a185..b5380bd9d1f 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/IllegalTransactionStateException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/IllegalTransactionStateException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/InvalidIsolationLevelException.java b/spring-tx/src/main/java/org/springframework/transaction/InvalidIsolationLevelException.java index 5db61b37409..196caa86d23 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/InvalidIsolationLevelException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/InvalidIsolationLevelException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java b/spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java index 2e483881520..bf6f4c39677 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/NestedTransactionNotSupportedException.java b/spring-tx/src/main/java/org/springframework/transaction/NestedTransactionNotSupportedException.java index a237550a017..e4831a66603 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/NestedTransactionNotSupportedException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/NestedTransactionNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/NoTransactionException.java b/spring-tx/src/main/java/org/springframework/transaction/NoTransactionException.java index 57ebb3804b3..40c34d52a6c 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/NoTransactionException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/NoTransactionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/PlatformTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/PlatformTransactionManager.java index 406efe17ac9..2c2030f6bc9 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/PlatformTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/PlatformTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java b/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java index 1d5a102d42c..56cb13e474d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java index df7afdc1c81..5eda8a28d26 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionException.java index 8facfc5a6c2..7bb67d4780c 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionSuspensionNotSupportedException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionSuspensionNotSupportedException.java index f3274c2e920..7076fe0f5f0 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionSuspensionNotSupportedException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionSuspensionNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java index 88713688991..43518ee9306 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionSystemException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionTimedOutException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionTimedOutException.java index e98eb1c4f43..e8e9a351fe9 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionTimedOutException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionTimedOutException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionUsageException.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionUsageException.java index 5c757474a07..8a6c2e4d463 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionUsageException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionUsageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/UnexpectedRollbackException.java b/spring-tx/src/main/java/org/springframework/transaction/UnexpectedRollbackException.java index 1a48ca044ec..03b4a28af27 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/UnexpectedRollbackException.java +++ b/spring-tx/src/main/java/org/springframework/transaction/UnexpectedRollbackException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/Isolation.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/Isolation.java index 457eb87d47f..e574705c692 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/Isolation.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/Isolation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java index 3a140590d58..707207574e3 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionAnnotationParser.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionAnnotationParser.java index e6722d469c3..cc07a9ae16b 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionAnnotationParser.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionAnnotationParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java index 312169b6fdc..856d24ace55 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/Transactional.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/config/AnnotationDrivenBeanDefinitionParser.java b/spring-tx/src/main/java/org/springframework/transaction/config/AnnotationDrivenBeanDefinitionParser.java index 4c897e2fd6c..07bea12ee54 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/config/AnnotationDrivenBeanDefinitionParser.java +++ b/spring-tx/src/main/java/org/springframework/transaction/config/AnnotationDrivenBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/config/TxNamespaceHandler.java b/spring-tx/src/main/java/org/springframework/transaction/config/TxNamespaceHandler.java index bf4647cb220..28736d0177e 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/config/TxNamespaceHandler.java +++ b/spring-tx/src/main/java/org/springframework/transaction/config/TxNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/BeanFactoryTransactionAttributeSourceAdvisor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/BeanFactoryTransactionAttributeSourceAdvisor.java index 514dd625e6c..551eb287daa 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/BeanFactoryTransactionAttributeSourceAdvisor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/BeanFactoryTransactionAttributeSourceAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java index 8837a05eb4a..1deed0c7205 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java index eea06e27065..f505b8bf5cd 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DelegatingTransactionAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DelegatingTransactionAttribute.java index c4ef1953f5c..32c66e68ddf 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DelegatingTransactionAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DelegatingTransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java index fbf824f5c54..b67ed6982b0 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java index c6745d9d9b9..c71f01d6815 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java index 9d52c141b5b..8fa8be22a3d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/NoRollbackRuleAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/NoRollbackRuleAttribute.java index 2588187ddd8..f6748ef890e 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/NoRollbackRuleAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/NoRollbackRuleAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java index 5e7021b0f2f..0f605308add 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java index eeb0046baba..0d45ed9b9c4 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttribute.java index 9f6a0bddfdf..debf7a9523d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java index 055d42c797b..a7d2abdfede 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisor.java index f253c2a8b56..a5a632411da 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditor.java index 31c739cbd7b..21e8e92baf7 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java index 53f78b9a535..4b9314edf70 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionInterceptor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionInterceptor.java index 75133366d9d..11f72759a7f 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionInterceptor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/JtaAfterCompletionSynchronization.java b/spring-tx/src/main/java/org/springframework/transaction/jta/JtaAfterCompletionSynchronization.java index d60cf2f8aff..fded50e1675 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/JtaAfterCompletionSynchronization.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/JtaAfterCompletionSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java index 47e6773bd4f..35f30be7f7c 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/SpringJtaSynchronizationAdapter.java b/spring-tx/src/main/java/org/springframework/transaction/jta/SpringJtaSynchronizationAdapter.java index 2026ada3bae..e4ecffce744 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/SpringJtaSynchronizationAdapter.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/SpringJtaSynchronizationAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/TransactionFactory.java b/spring-tx/src/main/java/org/springframework/transaction/jta/TransactionFactory.java index 50d4cf7c386..aac7f91e5e3 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/TransactionFactory.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/TransactionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java index 6381bea66d4..d493e950b47 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java index d622ff97998..de51a5425c5 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/jta/WebSphereUowTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java index 6d0f16f8eda..ef30ce0af4a 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java index 3b4a4c10da3..1e2f4455c9c 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/CallbackPreferringPlatformTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/CallbackPreferringPlatformTransactionManager.java index f3d62a4b827..6a1f9decf02 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/CallbackPreferringPlatformTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/CallbackPreferringPlatformTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionDefinition.java b/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionDefinition.java index b7e77b6f608..f1a63abc119 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionDefinition.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionStatus.java b/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionStatus.java index 8b730722670..9569dc1098d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionStatus.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/DefaultTransactionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/DelegatingTransactionDefinition.java b/spring-tx/src/main/java/org/springframework/transaction/support/DelegatingTransactionDefinition.java index 30bfd66a02e..4bc84fb3927 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/DelegatingTransactionDefinition.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/DelegatingTransactionDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceHolderSynchronization.java b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceHolderSynchronization.java index 7dab8d56188..b9e668fc572 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceHolderSynchronization.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceHolderSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionManager.java index c2188a108f1..760d7b69515 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/SimpleTransactionStatus.java b/spring-tx/src/main/java/org/springframework/transaction/support/SimpleTransactionStatus.java index 85be9f8bca6..fd6f184304e 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/SimpleTransactionStatus.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/SimpleTransactionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java index 0ba452e84f2..98841f3cbe9 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallbackWithoutResult.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallbackWithoutResult.java index 0083f2dd245..e3168e1b7bc 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallbackWithoutResult.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallbackWithoutResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionOperations.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionOperations.java index 1d576966b57..bc1ffbc820d 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionOperations.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java index c9600ca0a11..bfb35698bcb 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java index c18ee985155..7b203821049 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationUtils.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationUtils.java index f7f429a7982..b31eab96af0 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationUtils.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionTemplate.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionTemplate.java index 8d7df115f91..47d8319af68 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionTemplate.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/beans/Colour.java b/spring-tx/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-tx/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-tx/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-tx/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-tx/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/IOther.java b/spring-tx/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/ITestBean.java b/spring-tx/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-tx/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-tx/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/TestBean.java b/spring-tx/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeacf..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see org.springframework.beans.ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see org.springframework.beans.IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java b/spring-tx/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java deleted file mode 100644 index e2bfda3f1d6..00000000000 --- a/spring-tx/src/test/java/org/springframework/beans/factory/parsing/CollectingReaderEventListener.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory.parsing; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.springframework.core.CollectionFactory; - -/** - * @author Rob Harrop - * @author Juergen Hoeller - */ -public class CollectingReaderEventListener implements ReaderEventListener { - - private final List defaults = new LinkedList(); - - private final Map componentDefinitions = CollectionFactory.createLinkedMapIfPossible(8); - - private final Map aliasMap = CollectionFactory.createLinkedMapIfPossible(8); - - private final List imports = new LinkedList(); - - - public void defaultsRegistered(DefaultsDefinition defaultsDefinition) { - this.defaults.add(defaultsDefinition); - } - - public List getDefaults() { - return Collections.unmodifiableList(this.defaults); - } - - public void componentRegistered(ComponentDefinition componentDefinition) { - this.componentDefinitions.put(componentDefinition.getName(), componentDefinition); - } - - public ComponentDefinition getComponentDefinition(String name) { - return (ComponentDefinition) this.componentDefinitions.get(name); - } - - public ComponentDefinition[] getComponentDefinitions() { - Collection collection = this.componentDefinitions.values(); - return (ComponentDefinition[]) collection.toArray(new ComponentDefinition[collection.size()]); - } - - public void aliasRegistered(AliasDefinition aliasDefinition) { - List aliases = (List) this.aliasMap.get(aliasDefinition.getBeanName()); - if(aliases == null) { - aliases = new ArrayList(); - this.aliasMap.put(aliasDefinition.getBeanName(), aliases); - } - aliases.add(aliasDefinition); - } - - public List getAliases(String beanName) { - List aliases = (List) this.aliasMap.get(beanName); - return aliases == null ? null : Collections.unmodifiableList(aliases); - } - - public void importProcessed(ImportDefinition importDefinition) { - this.imports.add(importDefinition); - } - - public List getImports() { - return Collections.unmodifiableList(this.imports); - } - -} \ No newline at end of file diff --git a/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisorTests.java b/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisorTests.java index 8099156006c..c7c1970cc35 100644 --- a/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisorTests.java +++ b/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -167,12 +167,14 @@ public class PersistenceExceptionTranslationAdvisorTests extends TestCase { this.runtimeException = rex; } + @Override public void noThrowsClause() { if (runtimeException != null) { throw runtimeException; } } + @Override public void throwsPersistenceException() throws PersistenceException { if (runtimeException != null) { throw runtimeException; diff --git a/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationPostProcessorTests.java b/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationPostProcessorTests.java index 3b759466a57..fb6259de932 100644 --- a/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationPostProcessorTests.java +++ b/spring-tx/src/test/java/org/springframework/dao/annotation/PersistenceExceptionTranslationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -114,6 +114,7 @@ public class PersistenceExceptionTranslationPostProcessorTests extends TestCase public static class RepositoryWithoutInterfaceAndOtherwiseAdvised extends StereotypedRepositoryInterfaceImpl implements Additional { + @Override public void additionalMethod() { } } diff --git a/spring-tx/src/test/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslatorTests.java b/spring-tx/src/test/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslatorTests.java index 5cd19f8f02d..9998d9af65a 100644 --- a/spring-tx/src/test/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslatorTests.java +++ b/spring-tx/src/test/java/org/springframework/dao/support/ChainedPersistenceExceptionTranslatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/dao/support/DataAccessUtilsTests.java b/spring-tx/src/test/java/org/springframework/dao/support/DataAccessUtilsTests.java index e0a4523bfb2..74953d4d370 100644 --- a/spring-tx/src/test/java/org/springframework/dao/support/DataAccessUtilsTests.java +++ b/spring-tx/src/test/java/org/springframework/dao/support/DataAccessUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -270,6 +270,7 @@ public class DataAccessUtilsTests extends TestCase { this.translations.put(in, out); } + @Override public DataAccessException translateExceptionIfPossible(RuntimeException ex) { return (DataAccessException) translations.get(ex); } diff --git a/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java b/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java index 16f1012a75e..2038b8ecc07 100644 --- a/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java +++ b/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -81,6 +81,7 @@ public class CciLocalTransactionTests { TransactionTemplate tt = new TransactionTemplate(tm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue("Has thread connection", TransactionSynchronizationManager.hasResource(connectionFactory)); CciTemplate ct = new CciTemplate(connectionFactory); @@ -131,6 +132,7 @@ public class CciLocalTransactionTests { try { tt.execute(new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue("Has thread connection", TransactionSynchronizationManager.hasResource(connectionFactory)); CciTemplate ct = new CciTemplate(connectionFactory); diff --git a/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java b/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java index 50bdd4c2de7..ddbdc800693 100644 --- a/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java +++ b/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -153,6 +153,7 @@ public class CciTemplateTests { CciTemplate ct = new CciTemplate(connectionFactory); ct.setOutputRecordCreator(new RecordCreator() { + @Override public Record createRecord(RecordFactory recordFactory) { assertTrue(recordFactory instanceof NotSupportedRecordFactory); return outputRecord; diff --git a/spring-tx/src/test/java/org/springframework/jca/cci/EisOperationTests.java b/spring-tx/src/test/java/org/springframework/jca/cci/EisOperationTests.java index bd8f7fb5d00..4e5a3281d49 100644 --- a/spring-tx/src/test/java/org/springframework/jca/cci/EisOperationTests.java +++ b/spring-tx/src/test/java/org/springframework/jca/cci/EisOperationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -233,10 +233,12 @@ public class EisOperationTests { this.callDetector = callDetector; } + @Override protected Record createInputRecord(RecordFactory recordFactory, Object inputObject) { return this.callDetector.callCreateInputRecord(recordFactory, inputObject); } + @Override protected Object extractOutputData(Record outputRecord) throws ResourceException { return this.callDetector.callExtractOutputData(outputRecord); } diff --git a/spring-tx/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java b/spring-tx/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java deleted file mode 100644 index 10ae6d42837..00000000000 --- a/spring-tx/src/test/java/org/springframework/mock/jndi/ExpectedLookupTemplate.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.mock.jndi; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import javax.naming.NamingException; - -import org.springframework.jndi.JndiTemplate; - -/** - * Simple extension of the JndiTemplate class that always returns - * a given object. Very useful for testing. Effectively a mock object. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public class ExpectedLookupTemplate extends JndiTemplate { - - private final Map jndiObjects = new ConcurrentHashMap(); - - - /** - * Construct a new JndiTemplate that will always return given objects - * for given names. To be populated through {@code addObject} calls. - * @see #addObject(String, Object) - */ - public ExpectedLookupTemplate() { - } - - /** - * Construct a new JndiTemplate that will always return the - * given object, but honour only requests for the given name. - * @param name the name the client is expected to look up - * @param object the object that will be returned - */ - public ExpectedLookupTemplate(String name, Object object) { - addObject(name, object); - } - - - /** - * Add the given object to the list of JNDI objects that this - * template will expose. - * @param name the name the client is expected to look up - * @param object the object that will be returned - */ - public void addObject(String name, Object object) { - this.jndiObjects.put(name, object); - } - - - /** - * If the name is the expected name specified in the constructor, - * return the object provided in the constructor. If the name is - * unexpected, a respective NamingException gets thrown. - */ - public Object lookup(String name) throws NamingException { - Object object = this.jndiObjects.get(name); - if (object == null) { - throw new NamingException("Unexpected JNDI name '" + name + "': expecting " + this.jndiObjects.keySet()); - } - return object; - } - -} diff --git a/spring-test/src/test/java/org/springframework/test/transaction/CallCountingTransactionManager.java b/spring-tx/src/test/java/org/springframework/tests/transaction/CallCountingTransactionManager.java similarity index 94% rename from spring-test/src/test/java/org/springframework/test/transaction/CallCountingTransactionManager.java rename to spring-tx/src/test/java/org/springframework/tests/transaction/CallCountingTransactionManager.java index 8713dbe5ee6..d3852d4e34a 100644 --- a/spring-test/src/test/java/org/springframework/test/transaction/CallCountingTransactionManager.java +++ b/spring-tx/src/test/java/org/springframework/tests/transaction/CallCountingTransactionManager.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.test.transaction; +package org.springframework.tests.transaction; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.support.AbstractPlatformTransactionManager; @@ -33,22 +33,25 @@ public class CallCountingTransactionManager extends AbstractPlatformTransactionM public int rollbacks; public int inflight; - + @Override protected Object doGetTransaction() { return new Object(); } + @Override protected void doBegin(Object transaction, TransactionDefinition definition) { this.lastDefinition = definition; ++begun; ++inflight; } + @Override protected void doCommit(DefaultTransactionStatus status) { ++commits; --inflight; } + @Override protected void doRollback(DefaultTransactionStatus status) { ++rollbacks; --inflight; diff --git a/spring-tx/src/test/java/org/springframework/transaction/MockJtaTransaction.java b/spring-tx/src/test/java/org/springframework/tests/transaction/MockJtaTransaction.java similarity index 88% rename from spring-tx/src/test/java/org/springframework/transaction/MockJtaTransaction.java rename to spring-tx/src/test/java/org/springframework/tests/transaction/MockJtaTransaction.java index c9c8709c48b..eb68f255173 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/MockJtaTransaction.java +++ b/spring-tx/src/test/java/org/springframework/tests/transaction/MockJtaTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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.transaction; +package org.springframework.tests.transaction; import javax.transaction.Status; import javax.transaction.Synchronization; @@ -28,10 +28,12 @@ public class MockJtaTransaction implements javax.transaction.Transaction { private Synchronization synchronization; + @Override public int getStatus() { return Status.STATUS_ACTIVE; } + @Override public void registerSynchronization(Synchronization synchronization) { this.synchronization = synchronization; } @@ -40,20 +42,25 @@ public class MockJtaTransaction implements javax.transaction.Transaction { return synchronization; } + @Override public boolean enlistResource(XAResource xaResource) { return false; } + @Override public boolean delistResource(XAResource xaResource, int i) { return false; } + @Override public void commit() { } + @Override public void rollback() { } + @Override public void setRollbackOnly() { } diff --git a/spring-tx/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java b/spring-tx/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java deleted file mode 100644 index 0c0b3cb81cf..00000000000 --- a/spring-tx/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.transaction; - -import org.springframework.transaction.support.AbstractPlatformTransactionManager; -import org.springframework.transaction.support.DefaultTransactionStatus; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -@SuppressWarnings("serial") -public class CallCountingTransactionManager extends AbstractPlatformTransactionManager { - - public TransactionDefinition lastDefinition; - public int begun; - public int commits; - public int rollbacks; - public int inflight; - - protected Object doGetTransaction() { - return new Object(); - } - - protected void doBegin(Object transaction, TransactionDefinition definition) { - this.lastDefinition = definition; - ++begun; - ++inflight; - } - - protected void doCommit(DefaultTransactionStatus status) { - ++commits; - --inflight; - } - - protected void doRollback(DefaultTransactionStatus status) { - ++rollbacks; - --inflight; - } - - public void clear() { - begun = commits = rollbacks = inflight = 0; - } - -} diff --git a/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java b/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java index c78fdcf43cb..04e937b7ecc 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import javax.transaction.UserTransaction; import junit.framework.TestCase; import org.easymock.MockControl; -import org.springframework.mock.jndi.ExpectedLookupTemplate; +import org.springframework.tests.mock.jndi.ExpectedLookupTemplate; import org.springframework.transaction.jta.JtaTransactionManager; import org.springframework.transaction.jta.UserTransactionAdapter; import org.springframework.transaction.support.TransactionCallbackWithoutResult; @@ -112,6 +112,7 @@ public class JndiJtaTransactionManagerTests extends TestCase { assertTrue(!TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -157,6 +158,7 @@ public class JndiJtaTransactionManagerTests extends TestCase { assertTrue(!TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -206,6 +208,7 @@ public class JndiJtaTransactionManagerTests extends TestCase { assertTrue(!TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -215,6 +218,7 @@ public class JndiJtaTransactionManagerTests extends TestCase { ptm.setJndiTemplate(new ExpectedLookupTemplate("java:comp/UserTransaction", ut2)); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -232,6 +236,7 @@ public class JndiJtaTransactionManagerTests extends TestCase { * Prevent any side-effects due to this test modifying ThreadLocals that might * affect subsequent tests when all tests are run in the same JVM, as with Eclipse. */ + @Override protected void tearDown() { assertTrue(TransactionSynchronizationManager.getResourceMap().isEmpty()); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); diff --git a/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java b/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java index 480b869d3aa..c13ea6bc417 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -30,6 +30,7 @@ import junit.framework.TestCase; import org.easymock.MockControl; import org.springframework.dao.OptimisticLockingFailureException; +import org.springframework.tests.transaction.MockJtaTransaction; import org.springframework.transaction.jta.JtaTransactionManager; import org.springframework.transaction.support.DefaultTransactionDefinition; import org.springframework.transaction.support.TransactionCallbackWithoutResult; @@ -78,6 +79,7 @@ public class JtaTransactionManagerTests extends TestCase { assertNull(TransactionSynchronizationManager.getCurrentTransactionName()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -124,6 +126,7 @@ public class JtaTransactionManagerTests extends TestCase { ptm.setTransactionSynchronization(JtaTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -156,6 +159,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); } @@ -197,6 +201,7 @@ public class JtaTransactionManagerTests extends TestCase { assertNull(TransactionSynchronizationManager.getCurrentTransactionName()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -242,6 +247,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setTimeout(10); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -277,6 +283,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); status.setRollbackOnly(); @@ -308,6 +315,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -342,6 +350,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -383,6 +392,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -421,6 +431,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -454,6 +465,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -500,6 +512,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -538,6 +551,7 @@ public class JtaTransactionManagerTests extends TestCase { ptm.setTransactionSynchronization(JtaTransactionManager.SYNCHRONIZATION_ON_ACTUAL_TRANSACTION); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -566,6 +580,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); status.setRollbackOnly(); @@ -598,6 +613,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -630,6 +646,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); TransactionSynchronizationManager.registerSynchronization(synch); @@ -657,6 +674,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); status.setRollbackOnly(); @@ -682,6 +700,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); status.setRollbackOnly(); @@ -713,6 +732,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NOT_SUPPORTED); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); status.setRollbackOnly(); @@ -757,6 +777,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertEquals("txName", TransactionSynchronizationManager.getCurrentTransactionName()); @@ -767,6 +788,7 @@ public class JtaTransactionManagerTests extends TestCase { tt2.setReadOnly(true); tt2.setName("txName2"); tt2.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertEquals("txName2", TransactionSynchronizationManager.getCurrentTransactionName()); @@ -804,6 +826,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); @@ -812,6 +835,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt2 = new TransactionTemplate(ptm); tt2.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); tt2.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); @@ -854,6 +878,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); } @@ -882,6 +907,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); } @@ -921,6 +947,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); } @@ -958,6 +985,7 @@ public class JtaTransactionManagerTests extends TestCase { tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); } @@ -980,6 +1008,7 @@ public class JtaTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); try { tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { } }); @@ -1005,6 +1034,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); tt.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1029,6 +1059,7 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1057,6 +1088,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NESTED); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1079,6 +1111,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NESTED); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1106,6 +1139,7 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(ptm); tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NESTED); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1132,6 +1166,7 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional } @@ -1162,9 +1197,11 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_ROLLED_BACK); } @@ -1218,9 +1255,11 @@ public class JtaTransactionManagerTests extends TestCase { TransactionTemplate tt = new TransactionTemplate(tm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_ROLLED_BACK); } @@ -1266,9 +1305,11 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_UNKNOWN); } @@ -1302,9 +1343,11 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_UNKNOWN); } @@ -1338,9 +1381,11 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { // something transactional TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_UNKNOWN); } @@ -1373,8 +1418,10 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_UNKNOWN); } @@ -1404,6 +1451,7 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { status.setRollbackOnly(); } @@ -1430,9 +1478,11 @@ public class JtaTransactionManagerTests extends TestCase { JtaTransactionManager ptm = newJtaTransactionManager(ut); TransactionTemplate tt = new TransactionTemplate(ptm); tt.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { status.setRollbackOnly(); TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override public void afterCompletion(int status) { assertTrue("Correct completion status", status == TransactionSynchronization.STATUS_UNKNOWN); } @@ -1562,6 +1612,7 @@ public class JtaTransactionManagerTests extends TestCase { * Prevent any side-effects due to this test modifying ThreadLocals that might * affect subsequent tests when all tests are run in the same JVM, as with Eclipse. */ + @Override protected void tearDown() { assertTrue(TransactionSynchronizationManager.getResourceMap().isEmpty()); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); diff --git a/spring-tx/src/test/java/org/springframework/transaction/MockCallbackPreferringTransactionManager.java b/spring-tx/src/test/java/org/springframework/transaction/MockCallbackPreferringTransactionManager.java index f810e715b9b..df1604401f1 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/MockCallbackPreferringTransactionManager.java +++ b/spring-tx/src/test/java/org/springframework/transaction/MockCallbackPreferringTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -30,6 +30,7 @@ public class MockCallbackPreferringTransactionManager implements CallbackPreferr private TransactionStatus status; + @Override public Object execute(TransactionDefinition definition, TransactionCallback callback) throws TransactionException { this.definition = definition; this.status = new SimpleTransactionStatus(); @@ -45,14 +46,17 @@ public class MockCallbackPreferringTransactionManager implements CallbackPreferr } + @Override public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException { throw new UnsupportedOperationException(); } + @Override public void commit(TransactionStatus status) throws TransactionException { throw new UnsupportedOperationException(); } + @Override public void rollback(TransactionStatus status) throws TransactionException { throw new UnsupportedOperationException(); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/TestTransactionManager.java b/spring-tx/src/test/java/org/springframework/transaction/TestTransactionManager.java index 1fdd0659ebe..67f965a6502 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/TestTransactionManager.java +++ b/spring-tx/src/test/java/org/springframework/transaction/TestTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -46,14 +46,17 @@ class TestTransactionManager extends AbstractPlatformTransactionManager { setTransactionSynchronization(SYNCHRONIZATION_NEVER); } + @Override protected Object doGetTransaction() { return TRANSACTION; } + @Override protected boolean isExistingTransaction(Object transaction) { return existingTransaction; } + @Override protected void doBegin(Object transaction, TransactionDefinition definition) { if (!TRANSACTION.equals(transaction)) { throw new IllegalArgumentException("Not the same transaction object"); @@ -64,6 +67,7 @@ class TestTransactionManager extends AbstractPlatformTransactionManager { this.begin = true; } + @Override protected void doCommit(DefaultTransactionStatus status) { if (!TRANSACTION.equals(status.getTransaction())) { throw new IllegalArgumentException("Not the same transaction object"); @@ -71,6 +75,7 @@ class TestTransactionManager extends AbstractPlatformTransactionManager { this.commit = true; } + @Override protected void doRollback(DefaultTransactionStatus status) { if (!TRANSACTION.equals(status.getTransaction())) { throw new IllegalArgumentException("Not the same transaction object"); @@ -78,6 +83,7 @@ class TestTransactionManager extends AbstractPlatformTransactionManager { this.rollback = true; } + @Override protected void doSetRollbackOnly(DefaultTransactionStatus status) { if (!TRANSACTION.equals(status.getTransaction())) { throw new IllegalArgumentException("Not the same transaction object"); diff --git a/spring-tx/src/test/java/org/springframework/transaction/TransactionSupportTests.java b/spring-tx/src/test/java/org/springframework/transaction/TransactionSupportTests.java index 13646322584..2e42257b422 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/TransactionSupportTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/TransactionSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -139,6 +139,7 @@ public class TransactionSupportTests extends TestCase { TestTransactionManager tm = new TestTransactionManager(false, true); TransactionTemplate template = new TransactionTemplate(tm); template.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { } }); @@ -152,6 +153,7 @@ public class TransactionSupportTests extends TestCase { MockCallbackPreferringTransactionManager ptm = new MockCallbackPreferringTransactionManager(); TransactionTemplate template = new TransactionTemplate(ptm); template.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { } }); @@ -165,6 +167,7 @@ public class TransactionSupportTests extends TestCase { final RuntimeException ex = new RuntimeException("Some application exception"); try { template.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { throw ex; } @@ -185,6 +188,7 @@ public class TransactionSupportTests extends TestCase { public void testTransactionTemplateWithRollbackException() { final TransactionSystemException tex = new TransactionSystemException("system exception"); TestTransactionManager tm = new TestTransactionManager(false, true) { + @Override protected void doRollback(DefaultTransactionStatus status) { super.doRollback(status); throw tex; @@ -194,6 +198,7 @@ public class TransactionSupportTests extends TestCase { final RuntimeException ex = new RuntimeException("Some application exception"); try { template.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { throw ex; } @@ -215,6 +220,7 @@ public class TransactionSupportTests extends TestCase { TransactionTemplate template = new TransactionTemplate(tm); try { template.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(TransactionStatus status) { throw new Error("Some application error"); } @@ -277,6 +283,7 @@ public class TransactionSupportTests extends TestCase { assertTrue("Correct isolation level set", template.getIsolationLevel() == TransactionDefinition.ISOLATION_REPEATABLE_READ); } + @Override protected void tearDown() { assertTrue(TransactionSynchronizationManager.getResourceMap().isEmpty()); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); diff --git a/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerEventTests.java b/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerEventTests.java index e2a96b972ac..3f4286e51b9 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerEventTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -19,11 +19,11 @@ package org.springframework.transaction; import junit.framework.TestCase; import org.springframework.beans.factory.parsing.BeanComponentDefinition; -import org.springframework.beans.factory.parsing.CollectingReaderEventListener; import org.springframework.beans.factory.parsing.ComponentDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.ClassPathResource; +import org.springframework.tests.beans.CollectingReaderEventListener; /** * @author Torsten Juergeleit @@ -36,6 +36,7 @@ public class TxNamespaceHandlerEventTests extends TestCase { private CollectingReaderEventListener eventListener = new CollectingReaderEventListener(); + @Override public void setUp() throws Exception { XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory); reader.setEventListener(this.eventListener); diff --git a/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerTests.java b/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerTests.java index cfae77ca56b..813a905e079 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/TxNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,7 +21,8 @@ import java.lang.reflect.Method; import junit.framework.TestCase; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.transaction.interceptor.TransactionAttribute; @@ -40,6 +41,7 @@ public class TxNamespaceHandlerTests extends TestCase { private Method setAgeMethod; + @Override public void setUp() throws Exception { this.context = new ClassPathXmlApplicationContext("txNamespaceHandlerTests.xml", getClass()); this.getAgeMethod = ITestBean.class.getMethod("getAge", new Class[0]); diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSourceTests.java b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSourceTests.java index 1dfd6a1bb1c..ad05997a079 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSourceTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -30,7 +30,7 @@ import org.junit.Test; import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.interceptor.NoRollbackRuleAttribute; import org.springframework.transaction.interceptor.RollbackRuleAttribute; import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute; @@ -311,18 +311,22 @@ public class AnnotationTransactionAttributeSourceTests { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -344,19 +348,23 @@ public class AnnotationTransactionAttributeSourceTests { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override @Transactional(rollbackFor=Exception.class) public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -377,18 +385,22 @@ public class AnnotationTransactionAttributeSourceTests { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -409,20 +421,24 @@ public class AnnotationTransactionAttributeSourceTests { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override @Transactional(propagation=Propagation.REQUIRES_NEW, isolation=Isolation.REPEATABLE_READ, timeout=5, readOnly=true, rollbackFor=Exception.class, noRollbackFor={IOException.class}) public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -444,18 +460,22 @@ public class AnnotationTransactionAttributeSourceTests { this.age = age; } + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -495,6 +515,7 @@ public class AnnotationTransactionAttributeSourceTests { public static class MyFoo implements Foo { + @Override @Transactional public void doSomething(String theArgument) { System.out.println(theArgument); @@ -508,20 +529,24 @@ public class AnnotationTransactionAttributeSourceTests { private int age; + @Override @javax.ejb.TransactionAttribute(TransactionAttributeType.SUPPORTS) public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override @javax.ejb.TransactionAttribute public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -535,19 +560,23 @@ public class AnnotationTransactionAttributeSourceTests { private int age; + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override @javax.ejb.TransactionAttribute public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } @@ -574,18 +603,22 @@ public class AnnotationTransactionAttributeSourceTests { private int age; + @Override public String getName() { return name; } + @Override public void setName(String name) { this.name = name; } + @Override public int getAge() { return age; } + @Override public void setAge(int age) { this.age = age; } diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionInterceptorTests.java b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionInterceptorTests.java index 608512aefa0..556cb599659 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionInterceptorTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ package org.springframework.transaction.annotation; import junit.framework.TestCase; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.interceptor.TransactionInterceptor; import org.springframework.transaction.support.TransactionSynchronizationManager; @@ -36,6 +36,7 @@ public class AnnotationTransactionInterceptorTests extends TestCase { private TransactionInterceptor ti; + @Override public void setUp() { this.ptm = new CallCountingTransactionManager(); this.source = new AnnotationTransactionAttributeSource(); @@ -319,11 +320,13 @@ public class AnnotationTransactionInterceptorTests extends TestCase { public static class TestWithInterfaceImpl implements TestWithInterface { + @Override public void doSomething() { assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); } + @Override public void doSomethingElse() { assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); assertTrue(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); @@ -345,13 +348,16 @@ public class AnnotationTransactionInterceptorTests extends TestCase { public static class SomeServiceImpl implements SomeService { + @Override public void bar() { } + @Override @Transactional public void foo() { } + @Override @Transactional(readOnly = false) public void fooBar() { } @@ -367,6 +373,7 @@ public class AnnotationTransactionInterceptorTests extends TestCase { @Transactional public static class OtherServiceImpl implements OtherService { + @Override public void foo() { } } diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionNamespaceHandlerTests.java b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionNamespaceHandlerTests.java index 36c076ce521..92f1ed65142 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionNamespaceHandlerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/AnnotationTransactionNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -31,7 +31,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jmx.export.annotation.ManagedOperation; import org.springframework.jmx.export.annotation.ManagedResource; import org.springframework.stereotype.Service; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; /** * @author Rob Harrop @@ -41,11 +41,13 @@ public class AnnotationTransactionNamespaceHandlerTests extends TestCase { private ConfigurableApplicationContext context; + @Override public void setUp() { this.context = new ClassPathXmlApplicationContext( "org/springframework/transaction/annotation/annotationTransactionNamespaceHandlerTests.xml"); } + @Override protected void tearDown() { this.context.close(); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java b/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java index fcbc5e880ab..5c11e26d5dd 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -29,7 +29,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Service; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.AnnotationTransactionNamespaceHandlerTests.TransactionalTestBean; @@ -127,6 +127,7 @@ public class EnableTransactionManagementTests { return new CallCountingTransactionManager(); } + @Override public PlatformTransactionManager annotationDrivenTransactionManager() { return txManager2(); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/annotationTransactionNamespaceHandlerTests.xml b/spring-tx/src/test/java/org/springframework/transaction/annotation/annotationTransactionNamespaceHandlerTests.xml index d30fd87be1a..bd659fd8934 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/annotationTransactionNamespaceHandlerTests.xml +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/annotationTransactionNamespaceHandlerTests.xml @@ -11,7 +11,7 @@ - + diff --git a/spring-tx/src/test/java/org/springframework/transaction/config/AnnotationDrivenTests.java b/spring-tx/src/test/java/org/springframework/transaction/config/AnnotationDrivenTests.java index ec6f49fe145..ee458c0cf84 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/config/AnnotationDrivenTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/config/AnnotationDrivenTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import org.springframework.aop.support.AopUtils; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.util.SerializationTestUtils; @@ -87,6 +87,7 @@ public class AnnotationDrivenTests extends TestCase { @SuppressWarnings("serial") public static class TransactionCheckingInterceptor implements MethodInterceptor, Serializable { + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { if (methodInvocation.getMethod().getName().equals("setSomething")) { assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); diff --git a/spring-tx/src/test/java/org/springframework/transaction/config/TransactionManagerConfiguration.java b/spring-tx/src/test/java/org/springframework/transaction/config/TransactionManagerConfiguration.java index 11a649ad50d..965a0db01e0 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/config/TransactionManagerConfiguration.java +++ b/spring-tx/src/test/java/org/springframework/transaction/config/TransactionManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ package org.springframework.transaction.config; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; /** diff --git a/spring-tx/src/test/java/org/springframework/transaction/config/TransactionalService.java b/spring-tx/src/test/java/org/springframework/transaction/config/TransactionalService.java index 4ae36b3c1dd..f7ecfb89c09 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/config/TransactionalService.java +++ b/spring-tx/src/test/java/org/springframework/transaction/config/TransactionalService.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/config/annotationDrivenProxyTargetClassTests.xml b/spring-tx/src/test/java/org/springframework/transaction/config/annotationDrivenProxyTargetClassTests.xml index ea4f7189c83..a707e84fd36 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/config/annotationDrivenProxyTargetClassTests.xml +++ b/spring-tx/src/test/java/org/springframework/transaction/config/annotationDrivenProxyTargetClassTests.xml @@ -12,11 +12,11 @@ - + - + diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java index 59947292cfd..2b01ef4a916 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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,8 +21,8 @@ import java.lang.reflect.Method; import junit.framework.TestCase; import org.easymock.MockControl; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.transaction.CannotCreateTransactionException; import org.springframework.transaction.MockCallbackPreferringTransactionManager; @@ -250,6 +250,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { final String spouseName = "innerName"; TestBean outer = new TestBean() { + @Override public void exceptional(Throwable t) throws Throwable { TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); assertTrue(ti.hasTransaction()); @@ -257,6 +258,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { } }; TestBean inner = new TestBean() { + @Override public String getName() { // Assert that we're in the inner proxy TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); @@ -311,6 +313,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { final String spouseName = "innerName"; TestBean outer = new TestBean() { + @Override public void exceptional(Throwable t) throws Throwable { TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); assertTrue(ti.hasTransaction()); @@ -319,6 +322,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { } }; TestBean inner = new TestBean() { + @Override public String getName() { // Assert that we're in the inner proxy TransactionInfo ti = TransactionAspectSupport.currentTransactionInfo(); @@ -386,6 +390,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { final Exception ex, final boolean shouldRollback, boolean rollbackException) throws Exception { TransactionAttribute txatt = new DefaultTransactionAttribute() { + @Override public boolean rollbackOn(Throwable t) { assertTrue(t == ex); return shouldRollback; @@ -461,6 +466,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { final String name = "jenny"; TestBean tb = new TestBean() { + @Override public String getName() { TransactionStatus txStatus = TransactionInterceptor.currentTransactionStatus(); txStatus.setRollbackOnly(); @@ -504,6 +510,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase { ptmControl.replay(); TestBean tb = new TestBean() { + @Override public String getName() { throw new UnsupportedOperationException( "Shouldn't have invoked target method when couldn't create transaction for transactional method"); diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/BeanFactoryTransactionTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/BeanFactoryTransactionTests.java index 27d72c2dc4e..1ff4a262f4e 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/BeanFactoryTransactionTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/BeanFactoryTransactionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,20 +21,21 @@ import java.lang.reflect.Proxy; import java.util.Map; import junit.framework.TestCase; + import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.easymock.MockControl; - import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.StaticMethodMatcherPointcut; import org.springframework.aop.target.HotSwappableTargetSource; -import org.springframework.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; import org.springframework.beans.FatalBeanException; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.xml.XmlBeanFactory; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.transaction.CallCountingTransactionManager; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.io.ClassPathResource; -import org.springframework.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionException; @@ -48,10 +49,13 @@ import org.springframework.transaction.TransactionStatus; */ public class BeanFactoryTransactionTests extends TestCase { - private XmlBeanFactory factory; + private DefaultListableBeanFactory factory; + @Override public void setUp() { - this.factory = new XmlBeanFactory(new ClassPathResource("transactionalBeanFactory.xml", getClass())); + this.factory = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(this.factory).loadBeanDefinitions( + new ClassPathResource("transactionalBeanFactory.xml", getClass())); } public void testGetsAreNotTransactionalWithProxyFactory1() throws NoSuchMethodException { @@ -127,6 +131,7 @@ public class BeanFactoryTransactionTests extends TestCase { final TransactionStatus ts = (TransactionStatus) statusControl.getMock(); ptm = new PlatformTransactionManager() { private boolean invoked; + @Override public TransactionStatus getTransaction(TransactionDefinition def) throws TransactionException { if (invoked) { throw new IllegalStateException("getTransaction should not get invoked more than once"); @@ -138,9 +143,11 @@ public class BeanFactoryTransactionTests extends TestCase { } return ts; } + @Override public void commit(TransactionStatus status) throws TransactionException { assertTrue(status == ts); } + @Override public void rollback(TransactionStatus status) throws TransactionException { throw new IllegalStateException("rollback should not get invoked"); } @@ -163,7 +170,8 @@ public class BeanFactoryTransactionTests extends TestCase { */ public void testNoTransactionAttributeSource() { try { - XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("noTransactionAttributeSource.xml", getClass())); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("noTransactionAttributeSource.xml", getClass())); ITestBean testBean = (ITestBean) bf.getBean("noTransactionAttributeSource"); fail("Should require TransactionAttributeSource to be set"); } @@ -204,6 +212,7 @@ public class BeanFactoryTransactionTests extends TestCase { int counter = 0; + @Override public boolean matches(Method method, Class clazz) { counter++; return true; @@ -215,6 +224,7 @@ public class BeanFactoryTransactionTests extends TestCase { int counter = 0; + @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { counter++; return methodInvocation.proceed(); diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/ImplementsNoInterfaces.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/ImplementsNoInterfaces.java index 75e100602f2..79885dd3ee3 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/ImplementsNoInterfaces.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/ImplementsNoInterfaces.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.transaction.interceptor; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * Test for CGLIB proxying that implements no interfaces diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/MapTransactionAttributeSource.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/MapTransactionAttributeSource.java index a260d3ef719..e21ded175d5 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/MapTransactionAttributeSource.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/MapTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -40,10 +40,12 @@ public class MapTransactionAttributeSource extends AbstractFallbackTransactionAt } + @Override protected TransactionAttribute findTransactionAttribute(Method method) { return this.attributeMap.get(method); } + @Override protected TransactionAttribute findTransactionAttribute(Class clazz) { return this.attributeMap.get(clazz); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/MyRuntimeException.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/MyRuntimeException.java index 1e804de1321..4778f5925d9 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/MyRuntimeException.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/MyRuntimeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/PlatformTransactionManagerFacade.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/PlatformTransactionManagerFacade.java index 7aa4a1e275b..0970132a940 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/PlatformTransactionManagerFacade.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/PlatformTransactionManagerFacade.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,14 +37,17 @@ public class PlatformTransactionManagerFacade implements PlatformTransactionMana */ public static PlatformTransactionManager delegate; + @Override public TransactionStatus getTransaction(TransactionDefinition definition) { return delegate.getTransaction(definition); } + @Override public void commit(TransactionStatus status) { delegate.commit(status); } + @Override public void rollback(TransactionStatus status) { delegate.rollback(status); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/RollbackRuleTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/RollbackRuleTests.java index d1884954fd7..0a45d64be46 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/RollbackRuleTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/RollbackRuleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeEditorTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeEditorTests.java index f32779ef369..327675aaa24 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeEditorTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisorTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisorTests.java index 81364f12b41..bfd9071cdc8 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisorTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditorTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditorTests.java index ff21ee0a8bc..5aa47465428 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditorTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java index 5255b972ac8..9b41bc3997f 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ import org.springframework.util.SerializationTestUtils; */ public class TransactionInterceptorTests extends AbstractTransactionAspectTests { + @Override protected Object advised(Object target, PlatformTransactionManager ptm, TransactionAttributeSource[] tas) throws Exception { TransactionInterceptor ti = new TransactionInterceptor(); ti.setTransactionManager(ptm); @@ -49,6 +50,7 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests * target object and transaction setup. * Creates a TransactionInterceptor and applies it. */ + @Override protected Object advised(Object target, PlatformTransactionManager ptm, TransactionAttributeSource tas) { TransactionInterceptor ti = new TransactionInterceptor(); ti.setTransactionManager(ptm); @@ -111,14 +113,17 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests @SuppressWarnings("serial") public static class SerializableTransactionManager implements PlatformTransactionManager, Serializable { + @Override public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException { throw new UnsupportedOperationException(); } + @Override public void commit(TransactionStatus status) throws TransactionException { throw new UnsupportedOperationException(); } + @Override public void rollback(TransactionStatus status) throws TransactionException { throw new UnsupportedOperationException(); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/interceptor/noTransactionAttributeSource.xml b/spring-tx/src/test/java/org/springframework/transaction/interceptor/noTransactionAttributeSource.xml index 09c860fffd5..e9ef193b449 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/interceptor/noTransactionAttributeSource.xml +++ b/spring-tx/src/test/java/org/springframework/transaction/interceptor/noTransactionAttributeSource.xml @@ -4,11 +4,11 @@ - + custom 666 - + - + custom 666 @@ -22,16 +22,16 @@ - org.springframework.beans.ITestBean.s*=PROPAGATION_MANDATORY - org.springframework.beans.ITestBean.setAg*=PROPAGATION_REQUIRED - org.springframework.beans.ITestBean.set*= PROPAGATION_SUPPORTS , readOnly + org.springframework.tests.sample.beans.ITestBean.s*=PROPAGATION_MANDATORY + org.springframework.tests.sample.beans.ITestBean.setAg*=PROPAGATION_REQUIRED + org.springframework.tests.sample.beans.ITestBean.set*= PROPAGATION_SUPPORTS , readOnly - org.springframework.beans.ITestBean + org.springframework.tests.sample.beans.ITestBean diff --git a/spring-tx/src/test/java/org/springframework/transaction/jta/MockUOWManager.java b/spring-tx/src/test/java/org/springframework/transaction/jta/MockUOWManager.java index 94ca9025802..aed9bdb27f8 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/jta/MockUOWManager.java +++ b/spring-tx/src/test/java/org/springframework/transaction/jta/MockUOWManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -48,6 +48,7 @@ public class MockUOWManager implements UOWManager { private final List synchronizations = new LinkedList(); + @Override public void runUnderUOW(int type, boolean join, UOWAction action) throws UOWActionException, UOWException { this.type = type; this.joined = join; @@ -70,6 +71,7 @@ public class MockUOWManager implements UOWManager { } } + @Override public int getUOWType() { return this.type; } @@ -78,22 +80,27 @@ public class MockUOWManager implements UOWManager { return this.joined; } + @Override public long getLocalUOWId() { return 0; } + @Override public void setUOWTimeout(int uowType, int timeout) { this.timeout = timeout; } + @Override public int getUOWTimeout() { return this.timeout; } + @Override public void setRollbackOnly() { this.rollbackOnly = true; } + @Override public boolean getRollbackOnly() { return this.rollbackOnly; } @@ -102,18 +109,22 @@ public class MockUOWManager implements UOWManager { this.status = status; } + @Override public int getUOWStatus() { return this.status; } + @Override public void putResource(Object key, Object value) { this.resources.put(key, value); } + @Override public Object getResource(Object key) throws NullPointerException { return this.resources.get(key); } + @Override public void registerInterposedSynchronization(Synchronization sync) { this.synchronizations.add(sync); } diff --git a/spring-tx/src/test/java/org/springframework/transaction/jta/WebSphereUowTransactionManagerTests.java b/spring-tx/src/test/java/org/springframework/transaction/jta/WebSphereUowTransactionManagerTests.java index b6dbf51348f..5630bd82197 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/jta/WebSphereUowTransactionManagerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/jta/WebSphereUowTransactionManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import junit.framework.TestCase; import org.easymock.MockControl; import org.springframework.dao.OptimisticLockingFailureException; -import org.springframework.mock.jndi.ExpectedLookupTemplate; +import org.springframework.tests.mock.jndi.ExpectedLookupTemplate; import org.springframework.transaction.IllegalTransactionStateException; import org.springframework.transaction.NestedTransactionNotSupportedException; import org.springframework.transaction.TransactionDefinition; @@ -52,6 +52,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { DefaultTransactionDefinition definition = new DefaultTransactionDefinition(); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { return "result"; } @@ -87,6 +88,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { TransactionStatus ts = ptm.getTransaction(definition); ptm.commit(ts); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { return "result"; } @@ -105,6 +107,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { try { ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { return "result"; } @@ -174,6 +177,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { if (synchMode == WebSphereUowTransactionManager.SYNCHRONIZATION_ALWAYS) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -257,6 +261,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { if (synchMode != WebSphereUowTransactionManager.SYNCHRONIZATION_NEVER) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); @@ -294,6 +299,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -315,6 +321,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { public void testNewTransactionWithCommitException() { final RollbackException rex = new RollbackException(); MockUOWManager manager = new MockUOWManager() { + @Override public void runUnderUOW(int type, boolean join, UOWAction action) throws UOWException { throw new UOWException(rex); } @@ -328,6 +335,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { try { ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -362,6 +370,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { try { ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -395,6 +404,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -425,6 +435,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -452,6 +463,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { try { ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { return "result"; } @@ -472,6 +484,7 @@ public class WebSphereUowTransactionManagerTests extends TestCase { try { ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { return "result"; } @@ -508,11 +521,13 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result2", ptm.execute(definition2, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); @@ -555,11 +570,13 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result2", ptm.execute(definition2, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertEquals(propagationBehavior == TransactionDefinition.PROPAGATION_REQUIRES_NEW, @@ -600,11 +617,13 @@ public class WebSphereUowTransactionManagerTests extends TestCase { assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result", ptm.execute(definition, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); assertFalse(TransactionSynchronizationManager.isCurrentTransactionReadOnly()); assertEquals("result2", ptm.execute(definition2, new TransactionCallback() { + @Override public Object doInTransaction(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); assertFalse(TransactionSynchronizationManager.isActualTransactionActive()); diff --git a/spring-tx/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java b/spring-tx/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java index 7f699d8e909..ff819d3ede5 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import javax.transaction.UserTransaction; import junit.framework.TestCase; -import org.springframework.mock.jndi.SimpleNamingContextBuilder; +import org.springframework.tests.mock.jndi.SimpleNamingContextBuilder; import org.springframework.transaction.jta.JtaTransactionManager; import org.springframework.util.SerializationTestUtils; diff --git a/spring-tx/src/test/java/org/springframework/transaction/txNamespaceHandlerTests.xml b/spring-tx/src/test/java/org/springframework/transaction/txNamespaceHandlerTests.xml index 0a4b7e9f1c5..a8adf10c6df 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/txNamespaceHandlerTests.xml +++ b/spring-tx/src/test/java/org/springframework/transaction/txNamespaceHandlerTests.xml @@ -26,8 +26,8 @@ - + - + diff --git a/spring-tx/src/test/java/org/springframework/util/SerializationTestUtils.java b/spring-tx/src/test/java/org/springframework/util/SerializationTestUtils.java deleted file mode 100644 index dbe6421093e..00000000000 --- a/spring-tx/src/test/java/org/springframework/util/SerializationTestUtils.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The Spring Framework is published under the terms - * of the Apache Software License. - */ - -package org.springframework.util; - -import java.awt.Point; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; - -import junit.framework.TestCase; - -import org.springframework.beans.TestBean; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * Extends TestCase only to test itself. - * - * @author Rod Johnson - */ -public class SerializationTestUtils extends TestCase { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - - return o2; - } - - public SerializationTestUtils(String s) { - super(s); - } - - public void testWithNonSerializableObject() throws IOException { - TestBean o = new TestBean(); - assertFalse(o instanceof Serializable); - - assertFalse(isSerializable(o)); - - try { - testSerialization(o); - fail(); - } - catch (NotSerializableException ex) { - // Ok - } - } - - public void testWithSerializableObject() throws Exception { - int x = 5; - int y = 10; - Point p = new Point(x, y); - assertTrue(p instanceof Serializable); - - testSerialization(p); - - assertTrue(isSerializable(p)); - - Point p2 = (Point) serializeAndDeserialize(p); - assertNotSame(p, p2); - assertEquals(x, (int) p2.getX()); - assertEquals(y, (int) p2.getY()); - } - -} \ No newline at end of file diff --git a/spring-web/src/main/java/org/springframework/http/MediaTypeEditor.java b/spring-web/src/main/java/org/springframework/http/MediaTypeEditor.java index 7c1bfcfdc8e..eac003d0c84 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaTypeEditor.java +++ b/spring-web/src/main/java/org/springframework/http/MediaTypeEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequest.java index 55a3f5188d1..7137365507d 100644 --- a/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/ClientHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java index ab13bc68c77..3e833d44590 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequest.java index de141afc41c..9d397604799 100644 --- a/spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/AbstractHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/AbstractHttpMessageConverter.java index c95a20c4307..680225e928a 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/AbstractHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/AbstractHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/ByteArrayHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/ByteArrayHttpMessageConverter.java index 23543c384f8..f1ddc0080f7 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/ByteArrayHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/ByteArrayHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageConversionException.java b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageConversionException.java index 600082bfe43..a27bef02c46 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageConversionException.java +++ b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java index 4b7b747d2f4..6271a198da5 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java +++ b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotWritableException.java b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotWritableException.java index 5c2cebb357c..d8f8f33f973 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotWritableException.java +++ b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotWritableException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/MarshallingHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/MarshallingHttpMessageConverter.java index ae0c080131a..189bf9b2188 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/xml/MarshallingHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/xml/MarshallingHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/XmlAwareFormHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/XmlAwareFormHttpMessageConverter.java index 1aee1d6a05b..87cddf189fa 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/xml/XmlAwareFormHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/xml/XmlAwareFormHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java index 9b819edc8df..28b6bd50876 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java index e02fb1e2308..ff89f1bb86f 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java index 55ffc30c638..5aba1cb1544 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/AbstractHttpInvokerRequestExecutor.java b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/AbstractHttpInvokerRequestExecutor.java index 7dd174260bc..5a024973eae 100644 --- a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/AbstractHttpInvokerRequestExecutor.java +++ b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/AbstractHttpInvokerRequestExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientConfiguration.java b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientConfiguration.java index 2177d0d297a..7e894a53e44 100644 --- a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientConfiguration.java +++ b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java index 7f6c8eeb640..18668f53004 100644 --- a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortClientInterceptor.java index 7a754e198b8..373b301dc7f 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortProxyFactoryBean.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortProxyFactoryBean.java index 9f6a53ef8ba..610168c678e 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortProxyFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcPortProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcSoapFaultException.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcSoapFaultException.java index 1242cad1218..9087aaf2095 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcSoapFaultException.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/JaxRpcSoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactory.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactory.java index f6ef74740fc..9713e21d213 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactory.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactoryBean.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactoryBean.java index 4a27d8b7a4d..35d8afa8c57 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/LocalJaxRpcServiceFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/ServletEndpointSupport.java b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/ServletEndpointSupport.java index 1e642e37553..4a3d34185b3 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxrpc/ServletEndpointSupport.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxrpc/ServletEndpointSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java index cf2cb7d2216..65ff59c8150 100644 --- a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java +++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/HttpMediaTypeException.java b/spring-web/src/main/java/org/springframework/web/HttpMediaTypeException.java index b9f2357dcaf..f41a2b8f92c 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpMediaTypeException.java +++ b/spring-web/src/main/java/org/springframework/web/HttpMediaTypeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/HttpMediaTypeNotAcceptableException.java b/spring-web/src/main/java/org/springframework/web/HttpMediaTypeNotAcceptableException.java index 2c015834c3b..0434e6174bc 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpMediaTypeNotAcceptableException.java +++ b/spring-web/src/main/java/org/springframework/web/HttpMediaTypeNotAcceptableException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java b/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java index 1f76983228c..f76aad06fb7 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java +++ b/spring-web/src/main/java/org/springframework/web/HttpRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/HttpRequestMethodNotSupportedException.java b/spring-web/src/main/java/org/springframework/web/HttpRequestMethodNotSupportedException.java index 97be2859205..a70b37386c3 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpRequestMethodNotSupportedException.java +++ b/spring-web/src/main/java/org/springframework/web/HttpRequestMethodNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/HttpSessionRequiredException.java b/spring-web/src/main/java/org/springframework/web/HttpSessionRequiredException.java index 84880225b54..448bd4eddf6 100644 --- a/spring-web/src/main/java/org/springframework/web/HttpSessionRequiredException.java +++ b/spring-web/src/main/java/org/springframework/web/HttpSessionRequiredException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/EscapedErrors.java b/spring-web/src/main/java/org/springframework/web/bind/EscapedErrors.java index 10863f82fc6..67144395e29 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/EscapedErrors.java +++ b/spring-web/src/main/java/org/springframework/web/bind/EscapedErrors.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/MethodArgumentNotValidException.java b/spring-web/src/main/java/org/springframework/web/bind/MethodArgumentNotValidException.java index 71619890579..4d685333ca9 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/MethodArgumentNotValidException.java +++ b/spring-web/src/main/java/org/springframework/web/bind/MethodArgumentNotValidException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/MissingServletRequestParameterException.java b/spring-web/src/main/java/org/springframework/web/bind/MissingServletRequestParameterException.java index d27a5dd6286..24a69ad9eb8 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/MissingServletRequestParameterException.java +++ b/spring-web/src/main/java/org/springframework/web/bind/MissingServletRequestParameterException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestBindingException.java b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestBindingException.java index 2c28431a4cf..240f29d8c2e 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestBindingException.java +++ b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestBindingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestDataBinder.java b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestDataBinder.java index 83c0660e5a9..2b59850fbc2 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestDataBinder.java +++ b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestDataBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestParameterPropertyValues.java b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestParameterPropertyValues.java index febc333f2b7..fa5d2c6746b 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestParameterPropertyValues.java +++ b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestParameterPropertyValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestUtils.java b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestUtils.java index 1bb0351ea66..0745e9494f9 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/ServletRequestUtils.java +++ b/spring-web/src/main/java/org/springframework/web/bind/ServletRequestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java b/spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java index 8adf208b32c..4adf614f9a2 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java +++ b/spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/WebDataBinder.java b/spring-web/src/main/java/org/springframework/web/bind/WebDataBinder.java index d48e3d611df..175750c027d 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/WebDataBinder.java +++ b/spring-web/src/main/java/org/springframework/web/bind/WebDataBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java index a071859af9d..7f469a43185 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java index 760fd840ff2..90191f1d8df 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/InitBinder.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/InitBinder.java index 3608d9c7e45..2f6096168e3 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/InitBinder.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/InitBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/MatrixVariable.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/MatrixVariable.java index 73b1ab56823..1f29473baa5 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/MatrixVariable.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/MatrixVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java index 24ade7d0fd1..9d094d75d32 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java index 0782b22a67c..43032ba5981 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java index a6e90fb981a..a299313dce3 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java index 6ea979dea55..04d7d8cb092 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/SessionAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/ValueConstants.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/ValueConstants.java index 3d2717c4c1c..fda9ae23dd3 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/ValueConstants.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/ValueConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvocationException.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvocationException.java index b6c07ee59af..98ad9992b3e 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvocationException.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvoker.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvoker.java index f9ea11e44ba..4e77885aba6 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvoker.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/support/HandlerMethodInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/DefaultDataBinderFactory.java b/spring-web/src/main/java/org/springframework/web/bind/support/DefaultDataBinderFactory.java index 92b78c17213..bab588d5a48 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/DefaultDataBinderFactory.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/DefaultDataBinderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/SessionAttributeStore.java b/spring-web/src/main/java/org/springframework/web/bind/support/SessionAttributeStore.java index db5ce0aef9d..47a9b103c73 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/SessionAttributeStore.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/SessionAttributeStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/SimpleSessionStatus.java b/spring-web/src/main/java/org/springframework/web/bind/support/SimpleSessionStatus.java index 7eac9e58e92..f9d1d7c1026 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/SimpleSessionStatus.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/SimpleSessionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/WebArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/bind/support/WebArgumentResolver.java index 6faa10fddc0..143edb28e45 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/WebArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/WebArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/WebDataBinderFactory.java b/spring-web/src/main/java/org/springframework/web/bind/support/WebDataBinderFactory.java index d10d7c81dd6..03f13d86ff6 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/WebDataBinderFactory.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/WebDataBinderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java b/spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java index 3b14991df2b..bc870ea5d55 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java +++ b/spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/client/HttpMessageConverterExtractor.java b/spring-web/src/main/java/org/springframework/web/client/HttpMessageConverterExtractor.java index 31bc57888ce..b4232ff47c4 100644 --- a/spring-web/src/main/java/org/springframework/web/client/HttpMessageConverterExtractor.java +++ b/spring-web/src/main/java/org/springframework/web/client/HttpMessageConverterExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/client/ResponseErrorHandler.java b/spring-web/src/main/java/org/springframework/web/client/ResponseErrorHandler.java index de03dc36698..39ddfe4dd14 100644 --- a/spring-web/src/main/java/org/springframework/web/client/ResponseErrorHandler.java +++ b/spring-web/src/main/java/org/springframework/web/client/ResponseErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java b/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java index 5529a0dbb06..b9585787d86 100644 --- a/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java +++ b/spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/AbstractRequestAttributesScope.java b/spring-web/src/main/java/org/springframework/web/context/request/AbstractRequestAttributesScope.java index e65e7a75056..155eadeb7ea 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/AbstractRequestAttributesScope.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/AbstractRequestAttributesScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/DestructionCallbackBindingListener.java b/spring-web/src/main/java/org/springframework/web/context/request/DestructionCallbackBindingListener.java index 46dc4234380..27202c36bec 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/DestructionCallbackBindingListener.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/DestructionCallbackBindingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/FacesRequestAttributes.java b/spring-web/src/main/java/org/springframework/web/context/request/FacesRequestAttributes.java index 42615d3401a..8570211fa31 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/FacesRequestAttributes.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/FacesRequestAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/FacesWebRequest.java b/spring-web/src/main/java/org/springframework/web/context/request/FacesWebRequest.java index 839c13b5a67..f921d2a5417 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/FacesWebRequest.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/FacesWebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/NativeWebRequest.java b/spring-web/src/main/java/org/springframework/web/context/request/NativeWebRequest.java index 820f57a2a11..2b0df14d95a 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/NativeWebRequest.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/NativeWebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/RequestAttributes.java b/spring-web/src/main/java/org/springframework/web/context/request/RequestAttributes.java index b7c201f7fc0..8286de1bebe 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/RequestAttributes.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/RequestAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/RequestContextHolder.java b/spring-web/src/main/java/org/springframework/web/context/request/RequestContextHolder.java index 20fe615e23a..8cf39688a38 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/RequestContextHolder.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/RequestContextHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/RequestContextListener.java b/spring-web/src/main/java/org/springframework/web/context/request/RequestContextListener.java index 207e6a6c26d..6c8ff6de889 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/RequestContextListener.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/RequestContextListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/RequestScope.java b/spring-web/src/main/java/org/springframework/web/context/request/RequestScope.java index a92085dfb7b..b95814a00e5 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/RequestScope.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/RequestScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/SessionScope.java b/spring-web/src/main/java/org/springframework/web/context/request/SessionScope.java index dedc298753d..19bcb0d7725 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/SessionScope.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/SessionScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/WebRequest.java b/spring-web/src/main/java/org/springframework/web/context/request/WebRequest.java index f45ef255aa7..cce42d4c5fa 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/WebRequest.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/WebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/request/WebRequestInterceptor.java b/spring-web/src/main/java/org/springframework/web/context/request/WebRequestInterceptor.java index 2ffa1e99fef..1a5089bd969 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/WebRequestInterceptor.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/WebRequestInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java b/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java index c01de6e6fc0..34df1b1de19 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java b/spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java index 685a0571429..343aad71c5d 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextParameterFactoryBean.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextParameterFactoryBean.java index fec95de6ff7..6af3d808634 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextParameterFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextParameterFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertyPlaceholderConfigurer.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertyPlaceholderConfigurer.java index 97a9e86073d..ea6cda9767c 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertyPlaceholderConfigurer.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertyPlaceholderConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertySource.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertySource.java index 4dc22c2449a..d5c3cdbf1c0 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertySource.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextResourcePatternResolver.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextResourcePatternResolver.java index e1e54b6b218..8ce1a653920 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextResourcePatternResolver.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextResourcePatternResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextScope.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextScope.java index 59b043910f8..180645580f9 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletContextScope.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletContextScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/ServletRequestHandledEvent.java b/spring-web/src/main/java/org/springframework/web/context/support/ServletRequestHandledEvent.java index 37e5d2519d5..a2eca47b119 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/ServletRequestHandledEvent.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/ServletRequestHandledEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java b/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java index 7a64224ce08..15af5f435de 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java b/spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java index a0ef9e29fc7..9aa2547d62f 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/WebApplicationObjectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/filter/CompositeFilter.java b/spring-web/src/main/java/org/springframework/web/filter/CompositeFilter.java index b85cb1e23e1..a3551ff7671 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/CompositeFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/CompositeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/filter/GenericFilterBean.java b/spring-web/src/main/java/org/springframework/web/filter/GenericFilterBean.java index 9864566193c..816a52c3c16 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/GenericFilterBean.java +++ b/spring-web/src/main/java/org/springframework/web/filter/GenericFilterBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/filter/HiddenHttpMethodFilter.java b/spring-web/src/main/java/org/springframework/web/filter/HiddenHttpMethodFilter.java index 45a76d97a06..5d9ea1a0d39 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/HiddenHttpMethodFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/HiddenHttpMethodFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/DelegatingPhaseListenerMulticaster.java b/spring-web/src/main/java/org/springframework/web/jsf/DelegatingPhaseListenerMulticaster.java index 84c41caa592..d554e05cf59 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/DelegatingPhaseListenerMulticaster.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/DelegatingPhaseListenerMulticaster.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/DelegatingVariableResolver.java b/spring-web/src/main/java/org/springframework/web/jsf/DelegatingVariableResolver.java index f044157f48f..4b3b4858bfe 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/DelegatingVariableResolver.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/DelegatingVariableResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/FacesContextUtils.java b/spring-web/src/main/java/org/springframework/web/jsf/FacesContextUtils.java index eb9edbaf162..3c2519f5a6d 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/FacesContextUtils.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/FacesContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/WebApplicationContextVariableResolver.java b/spring-web/src/main/java/org/springframework/web/jsf/WebApplicationContextVariableResolver.java index 7dcaf3ebfca..949f0042e4f 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/WebApplicationContextVariableResolver.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/WebApplicationContextVariableResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/el/SpringBeanFacesELResolver.java b/spring-web/src/main/java/org/springframework/web/jsf/el/SpringBeanFacesELResolver.java index cb4af40c706..be9f6888af4 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/el/SpringBeanFacesELResolver.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/el/SpringBeanFacesELResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/jsf/el/WebApplicationContextFacesELResolver.java b/spring-web/src/main/java/org/springframework/web/jsf/el/WebApplicationContextFacesELResolver.java index f1ae54882d3..712e50f341c 100644 --- a/spring-web/src/main/java/org/springframework/web/jsf/el/WebApplicationContextFacesELResolver.java +++ b/spring-web/src/main/java/org/springframework/web/jsf/el/WebApplicationContextFacesELResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/HandlerMethodSelector.java b/spring-web/src/main/java/org/springframework/web/method/HandlerMethodSelector.java index c0ea3fc3450..4d93eff7f2c 100644 --- a/spring-web/src/main/java/org/springframework/web/method/HandlerMethodSelector.java +++ b/spring-web/src/main/java/org/springframework/web/method/HandlerMethodSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/AbstractCookieValueMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/annotation/AbstractCookieValueMethodArgumentResolver.java index 4f25d7633b9..07c44b32a88 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/AbstractCookieValueMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/AbstractCookieValueMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolver.java index 083e6fe5e54..92a2aa88d13 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/InitBinderDataBinderFactory.java b/spring-web/src/main/java/org/springframework/web/method/annotation/InitBinderDataBinderFactory.java index c7520687e10..b00f6e46d82 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/InitBinderDataBinderFactory.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/InitBinderDataBinderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/ModelFactory.java b/spring-web/src/main/java/org/springframework/web/method/annotation/ModelFactory.java index 5cac3e8eb6a..ee5672cfa44 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/ModelFactory.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/ModelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMethodArgumentResolver.java index 57a622118e5..e7b46bdb6a9 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java index 79a49c1cad9..e2a7b7d7982 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java index 4b77ba622ec..d97fe876d19 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java b/spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java index 94aa67671e6..36eb573b57e 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartException.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartException.java index 6aec889ab6a..c4a74bdd0de 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartException.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java index 632e9fb4720..86f73591a47 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartRequest.java index ed1ce75a97b..f24bb2207de 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java index 93e0ee5b65e..3fd05f91518 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java index c50df92d4b9..e05e110a7d8 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java index 677613a61ad..ae9ae6ecf10 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java index 92e20f3044f..25f743befc9 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java index ab995b112fd..ee0a9b7f65a 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java b/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java index ad002782ae4..b78ad775f91 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/MultipartFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java index 2d8c260ef65..1329c782320 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/RequestPartServletServerHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StringMultipartFileEditor.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StringMultipartFileEditor.java index 7d8e8dff17a..9b6b909283e 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StringMultipartFileEditor.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StringMultipartFileEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityReferences.java b/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityReferences.java index 3d7c91cee07..0fc4ee78e8f 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityReferences.java +++ b/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityReferences.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java index 23e9a81f669..2c93058c5b9 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/HttpSessionMutexListener.java b/spring-web/src/main/java/org/springframework/web/util/HttpSessionMutexListener.java index cb0367c2e23..ab7a7101478 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HttpSessionMutexListener.java +++ b/spring-web/src/main/java/org/springframework/web/util/HttpSessionMutexListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/IntrospectorCleanupListener.java b/spring-web/src/main/java/org/springframework/web/util/IntrospectorCleanupListener.java index 0d0e7de648a..bf0ed911b4a 100644 --- a/spring-web/src/main/java/org/springframework/web/util/IntrospectorCleanupListener.java +++ b/spring-web/src/main/java/org/springframework/web/util/IntrospectorCleanupListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/Log4jConfigListener.java b/spring-web/src/main/java/org/springframework/web/util/Log4jConfigListener.java index 6ee0c086269..0ca9e35d32b 100644 --- a/spring-web/src/main/java/org/springframework/web/util/Log4jConfigListener.java +++ b/spring-web/src/main/java/org/springframework/web/util/Log4jConfigListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/NestedServletException.java b/spring-web/src/main/java/org/springframework/web/util/NestedServletException.java index 81d3e0f5971..adeddf78afb 100644 --- a/spring-web/src/main/java/org/springframework/web/util/NestedServletException.java +++ b/spring-web/src/main/java/org/springframework/web/util/NestedServletException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/TagUtils.java b/spring-web/src/main/java/org/springframework/web/util/TagUtils.java index cf8d45148cf..ee9daf8feaa 100644 --- a/spring-web/src/main/java/org/springframework/web/util/TagUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/TagUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java index 6682a0a0098..a8699042e97 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java b/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java index ea8382ee019..67b7a4c024f 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java +++ b/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java @@ -397,6 +397,7 @@ public class UrlPathHelper { return source; } + @SuppressWarnings("deprecation") private String decodeInternal(HttpServletRequest request, String source) { String enc = determineEncoding(request); try { diff --git a/spring-web/src/main/java/org/springframework/web/util/WebAppRootListener.java b/spring-web/src/main/java/org/springframework/web/util/WebAppRootListener.java index 437216a9692..832ea24d31a 100644 --- a/spring-web/src/main/java/org/springframework/web/util/WebAppRootListener.java +++ b/spring-web/src/main/java/org/springframework/web/util/WebAppRootListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java index 0a901294a09..c7acf095029 100644 --- a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/beans/BeanWithObjectProperty.java b/spring-web/src/test/java/org/springframework/beans/BeanWithObjectProperty.java deleted file mode 100644 index bb5e71f5cd0..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/BeanWithObjectProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * @author Juergen Hoeller - * @since 17.08.2004 - */ -public class BeanWithObjectProperty { - - private Object object; - - public Object getObject() { - return object; - } - - public void setObject(Object object) { - this.object = object; - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/Colour.java b/spring-web/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-web/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-web/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-web/src/test/java/org/springframework/beans/FieldAccessBean.java b/spring-web/src/test/java/org/springframework/beans/FieldAccessBean.java deleted file mode 100644 index 61f911902c7..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/FieldAccessBean.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -/** - * @author Juergen Hoeller - * @since 07.03.2006 - */ -public class FieldAccessBean { - - public String name; - - protected int age; - - private TestBean spouse; - - - public String getName() { - return name; - } - - public int getAge() { - return age; - } - - public TestBean getSpouse() { - return spouse; - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-web/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/IOther.java b/spring-web/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-web/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-web/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/Person.java b/spring-web/src/test/java/org/springframework/beans/Person.java deleted file mode 100644 index a78998ad5d4..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/Person.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * - * @author Rod Johnson - */ -public interface Person { - - String getName(); - void setName(String name); - int getAge(); - void setAge(int i); - - /** - * Test for non-property method matching. - * If the parameter is a Throwable, it will be thrown rather than - * returned. - */ - Object echo(Object o) throws Throwable; -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/TestBean.java b/spring-web/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 282a18352d7..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Integer[][] nestedIntegerArray; - - private int[] someIntArray; - - private int[][] nestedIntArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setConcreteSpouse(TestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean getConcreteSpouse() { - return (spouses != null ? (TestBean) spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Integer[][] getNestedIntegerArray() { - return nestedIntegerArray; - } - - public void setNestedIntegerArray(Integer[][] nestedIntegerArray) { - this.nestedIntegerArray = nestedIntegerArray; - } - - public int[] getSomeIntArray() { - return someIntArray; - } - - public void setSomeIntArray(int[] someIntArray) { - this.someIntArray = someIntArray; - } - - public int[][] getNestedIntArray() { - return nestedIntArray; - } - - public void setNestedIntArray(int[][] nestedIntArray) { - this.nestedIntArray = nestedIntArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - - public Object returnsThis() { - return this; - } - - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/beans/factory/DummyFactory.java b/spring-web/src/test/java/org/springframework/beans/factory/DummyFactory.java deleted file mode 100644 index 006228975a7..00000000000 --- a/spring-web/src/test/java/org/springframework/beans/factory/DummyFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; - -/** - * Simple factory to allow testing of FactoryBean support in AbstractBeanFactory. - * Depending on whether its singleton property is set, it will return a singleton - * or a prototype instance. - * - *

Implements InitializingBean interface, so we can check that - * factories get this lifecycle callback if they want. - * - * @author Rod Johnson - * @since 10.03.2003 - */ -public class DummyFactory - implements FactoryBean, BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - public static final String SINGLETON_NAME = "Factory singleton"; - - private static boolean prototypeCreated; - - /** - * Clear static state. - */ - public static void reset() { - prototypeCreated = false; - } - - - /** - * Default is for factories to return a singleton instance. - */ - private boolean singleton = true; - - private String beanName; - - private AutowireCapableBeanFactory beanFactory; - - private boolean postProcessed; - - private boolean initialized; - - private TestBean testBean; - - private TestBean otherTestBean; - - - public DummyFactory() { - this.testBean = new TestBean(); - this.testBean.setName(SINGLETON_NAME); - this.testBean.setAge(25); - } - - /** - * Return if the bean managed by this factory is a singleton. - * @see FactoryBean#isSingleton() - */ - public boolean isSingleton() { - return this.singleton; - } - - /** - * Set if the bean managed by this factory is a singleton. - */ - public void setSingleton(boolean singleton) { - this.singleton = singleton; - } - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = (AutowireCapableBeanFactory) beanFactory; - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public void setOtherTestBean(TestBean otherTestBean) { - this.otherTestBean = otherTestBean; - this.testBean.setSpouse(otherTestBean); - } - - public TestBean getOtherTestBean() { - return otherTestBean; - } - - public void afterPropertiesSet() { - if (initialized) { - throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); - } - this.initialized = true; - } - - /** - * Was this initialized by invocation of the - * afterPropertiesSet() method from the InitializingBean interface? - */ - public boolean wasInitialized() { - return initialized; - } - - public static boolean wasPrototypeCreated() { - return prototypeCreated; - } - - - /** - * Return the managed object, supporting both singleton - * and prototype mode. - * @see FactoryBean#getObject() - */ - public Object getObject() throws BeansException { - if (isSingleton()) { - return this.testBean; - } - else { - TestBean prototype = new TestBean("prototype created at " + System.currentTimeMillis(), 11); - if (this.beanFactory != null) { - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(prototype, this.beanName); - } - prototypeCreated = true; - return prototype; - } - } - - public Class getObjectType() { - return TestBean.class; - } - - - public void destroy() { - if (this.testBean != null) { - this.testBean.setName(null); - } - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/core/task/MockRunnable.java b/spring-web/src/test/java/org/springframework/core/task/MockRunnable.java index 42b9adbfd56..3ee1f452dac 100644 --- a/spring-web/src/test/java/org/springframework/core/task/MockRunnable.java +++ b/spring-web/src/test/java/org/springframework/core/task/MockRunnable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ public class MockRunnable implements Runnable { private boolean executed = false; + @Override public void run() { this.executed = true; } diff --git a/spring-web/src/test/java/org/springframework/http/MockHttpInputMessage.java b/spring-web/src/test/java/org/springframework/http/MockHttpInputMessage.java index 4461024f642..18412ce33cc 100644 --- a/spring-web/src/test/java/org/springframework/http/MockHttpInputMessage.java +++ b/spring-web/src/test/java/org/springframework/http/MockHttpInputMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -41,10 +41,12 @@ public class MockHttpInputMessage implements HttpInputMessage { this.body = body; } + @Override public HttpHeaders getHeaders() { return headers; } + @Override public InputStream getBody() throws IOException { return body; } diff --git a/spring-web/src/test/java/org/springframework/http/MockHttpOutputMessage.java b/spring-web/src/test/java/org/springframework/http/MockHttpOutputMessage.java index 323fff1af36..c8dfbfc079b 100644 --- a/spring-web/src/test/java/org/springframework/http/MockHttpOutputMessage.java +++ b/spring-web/src/test/java/org/springframework/http/MockHttpOutputMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -30,10 +30,12 @@ public class MockHttpOutputMessage implements HttpOutputMessage { private final ByteArrayOutputStream body = new ByteArrayOutputStream(); + @Override public HttpHeaders getHeaders() { return headers; } + @Override public OutputStream getBody() throws IOException { return body; } diff --git a/spring-web/src/test/java/org/springframework/http/client/AbstractHttpRequestFactoryTestCase.java b/spring-web/src/test/java/org/springframework/http/client/AbstractHttpRequestFactoryTestCase.java index 2af35321ff6..3a3d4a68851 100644 --- a/spring-web/src/test/java/org/springframework/http/client/AbstractHttpRequestFactoryTestCase.java +++ b/spring-web/src/test/java/org/springframework/http/client/AbstractHttpRequestFactoryTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -43,6 +43,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import org.springframework.tests.web.FreePortScanner; import org.springframework.util.FileCopyUtils; public abstract class AbstractHttpRequestFactoryTestCase { diff --git a/spring-web/src/test/java/org/springframework/http/client/BufferedSimpleHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/BufferedSimpleHttpRequestFactoryTests.java index 7408552ff58..4904ea31910 100644 --- a/spring-web/src/test/java/org/springframework/http/client/BufferedSimpleHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/BufferedSimpleHttpRequestFactoryTests.java @@ -28,6 +28,7 @@ public class BufferedSimpleHttpRequestFactoryTests extends AbstractHttpRequestFa return new SimpleClientHttpRequestFactory(); } + @Override @Test public void httpMethods() throws Exception { try { diff --git a/spring-web/src/test/java/org/springframework/http/client/CommonsHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/CommonsHttpRequestFactoryTests.java index 4fd3017ca23..c067159017e 100644 --- a/spring-web/src/test/java/org/springframework/http/client/CommonsHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/CommonsHttpRequestFactoryTests.java @@ -21,6 +21,7 @@ import java.net.URI; import org.junit.Test; import org.springframework.http.HttpMethod; +@Deprecated public class CommonsHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase { @Override diff --git a/spring-web/src/test/java/org/springframework/http/client/FreePortScanner.java b/spring-web/src/test/java/org/springframework/http/client/FreePortScanner.java deleted file mode 100644 index 113f3d4910a..00000000000 --- a/spring-web/src/test/java/org/springframework/http/client/FreePortScanner.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2002-2010 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 - * - * http://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.http.client; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.util.Random; - -import org.springframework.util.Assert; - -/** - * Utility class that finds free BSD ports for use in testing scenario's. - * - * @author Ben Hale - * @author Arjen Poutsma - */ -public abstract class FreePortScanner { - - private static final int MIN_SAFE_PORT = 1024; - - private static final int MAX_PORT = 65535; - - private static final Random random = new Random(); - - /** - * Returns the number of a free port in the default range. - */ - public static int getFreePort() { - return getFreePort(MIN_SAFE_PORT, MAX_PORT); - } - - /** - * Returns the number of a free port in the given range. - */ - public static int getFreePort(int minPort, int maxPort) { - Assert.isTrue(minPort > 0, "'minPort' must be larger than 0"); - Assert.isTrue(maxPort > minPort, "'maxPort' must be larger than minPort"); - int portRange = maxPort - minPort; - int candidatePort; - int searchCounter = 0; - do { - if (++searchCounter > portRange) { - throw new IllegalStateException( - String.format("There were no ports available in the range %d to %d", minPort, maxPort)); - } - candidatePort = getRandomPort(minPort, portRange); - } - while (!isPortAvailable(candidatePort)); - - return candidatePort; - } - - private static int getRandomPort(int minPort, int portRange) { - return minPort + random.nextInt(portRange); - } - - private static boolean isPortAvailable(int port) { - ServerSocket serverSocket; - try { - serverSocket = new ServerSocket(); - } - catch (IOException ex) { - throw new IllegalStateException("Unable to create ServerSocket.", ex); - } - - try { - InetSocketAddress sa = new InetSocketAddress(port); - serverSocket.bind(sa); - return true; - } - catch (IOException ex) { - return false; - } - finally { - try { - serverSocket.close(); - } - catch (IOException ex) { - // ignore - } - } - } - -} diff --git a/spring-web/src/test/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactoryTests.java index 917e5de114b..0eabc67d937 100644 --- a/spring-web/src/test/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactoryTests.java @@ -26,6 +26,7 @@ public class HttpComponentsClientHttpRequestFactoryTests extends AbstractHttpReq return new HttpComponentsClientHttpRequestFactory(); } + @Override @Test public void httpMethods() throws Exception { assertHttpMethod("patch", HttpMethod.PATCH); diff --git a/spring-web/src/test/java/org/springframework/http/client/InterceptingClientHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/InterceptingClientHttpRequestFactoryTests.java index 70f5e257d25..2df6331b8e3 100644 --- a/spring-web/src/test/java/org/springframework/http/client/InterceptingClientHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/InterceptingClientHttpRequestFactoryTests.java @@ -79,6 +79,7 @@ public class InterceptingClientHttpRequestFactoryTests { public void noExecution() throws Exception { List interceptors = new ArrayList(); interceptors.add(new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { return responseMock; @@ -101,6 +102,7 @@ public class InterceptingClientHttpRequestFactoryTests { final String headerName = "Foo"; final String headerValue = "Bar"; ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { @@ -134,6 +136,7 @@ public class InterceptingClientHttpRequestFactoryTests { public void changeURI() throws Exception { final URI changedUri = new URI("http://example.com/2"); ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { @@ -166,6 +169,7 @@ public class InterceptingClientHttpRequestFactoryTests { public void changeMethod() throws Exception { final HttpMethod changedMethod = HttpMethod.POST; ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { @@ -198,6 +202,7 @@ public class InterceptingClientHttpRequestFactoryTests { public void changeBody() throws Exception { final byte[] changedBody = "Foo".getBytes(); ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { @@ -217,6 +222,7 @@ public class InterceptingClientHttpRequestFactoryTests { private boolean invoked = false; + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { invoked = true; @@ -226,6 +232,7 @@ public class InterceptingClientHttpRequestFactoryTests { private class RequestFactoryMock implements ClientHttpRequestFactory { + @Override public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException { requestMock.setURI(uri); requestMock.setMethod(httpMethod); @@ -249,6 +256,7 @@ public class InterceptingClientHttpRequestFactoryTests { private RequestMock() { } + @Override public URI getURI() { return uri; } @@ -257,6 +265,7 @@ public class InterceptingClientHttpRequestFactoryTests { this.uri = uri; } + @Override public HttpMethod getMethod() { return method; } @@ -265,14 +274,17 @@ public class InterceptingClientHttpRequestFactoryTests { this.method = method; } + @Override public HttpHeaders getHeaders() { return headers; } + @Override public OutputStream getBody() throws IOException { return body; } + @Override public ClientHttpResponse execute() throws IOException { executed = true; return responseMock; @@ -287,26 +299,32 @@ public class InterceptingClientHttpRequestFactoryTests { private HttpHeaders headers = new HttpHeaders(); + @Override public HttpStatus getStatusCode() throws IOException { return statusCode; } + @Override public int getRawStatusCode() throws IOException { return statusCode.value(); } + @Override public String getStatusText() throws IOException { return statusText; } + @Override public HttpHeaders getHeaders() { return headers; } + @Override public InputStream getBody() throws IOException { return null; } + @Override public void close() { } } diff --git a/spring-web/src/test/java/org/springframework/http/client/StreamingSimpleHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/StreamingSimpleHttpRequestFactoryTests.java index 8507cdbfe83..ccb91450a4a 100644 --- a/spring-web/src/test/java/org/springframework/http/client/StreamingSimpleHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/StreamingSimpleHttpRequestFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -47,6 +47,7 @@ public class StreamingSimpleHttpRequestFactoryTests extends AbstractHttpRequestF final String headerName = "MyHeader"; final String headerValue = "MyValue"; ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { + @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { request.getHeaders().add(headerName, headerValue); diff --git a/spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java b/spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java index 0771b1f4c73..2344269b634 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java +++ b/spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -167,20 +167,24 @@ public class FormHttpMessageConverterTests { this.outputMessage = outputMessage; } + @Override public String getCharacterEncoding() { MediaType contentType = outputMessage.getHeaders().getContentType(); return contentType != null && contentType.getCharSet() != null ? contentType.getCharSet().name() : null; } + @Override public String getContentType() { MediaType contentType = outputMessage.getHeaders().getContentType(); return contentType != null ? contentType.toString() : null; } + @Override public int getContentLength() { return outputMessage.getBodyAsBytes().length; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(outputMessage.getBodyAsBytes()); } diff --git a/spring-web/src/test/java/org/springframework/http/converter/HttpMessageConverterTests.java b/spring-web/src/test/java/org/springframework/http/converter/HttpMessageConverterTests.java index 803bd80d240..d29b2b71298 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/HttpMessageConverterTests.java +++ b/spring-web/src/test/java/org/springframework/http/converter/HttpMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/http/converter/StringHttpMessageConverterTests.java b/spring-web/src/test/java/org/springframework/http/converter/StringHttpMessageConverterTests.java index 3f5171390d4..2af8ea38167 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/StringHttpMessageConverterTests.java +++ b/spring-web/src/test/java/org/springframework/http/converter/StringHttpMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java b/spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java index e2545123fe1..2f12bc988b7 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java +++ b/spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/http/converter/xml/SourceHttpMessageConverterTests.java b/spring-web/src/test/java/org/springframework/http/converter/xml/SourceHttpMessageConverterTests.java index a273cfffab0..c34e202330d 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/xml/SourceHttpMessageConverterTests.java +++ b/spring-web/src/test/java/org/springframework/http/converter/xml/SourceHttpMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -16,9 +16,14 @@ package org.springframework.http.converter.xml; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.io.InputStreamReader; import java.io.StringReader; import java.nio.charset.Charset; + import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; @@ -27,19 +32,17 @@ import javax.xml.transform.stream.StreamSource; import org.junit.Before; import org.junit.Test; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - import org.springframework.http.MediaType; import org.springframework.http.MockHttpInputMessage; import org.springframework.http.MockHttpOutputMessage; import org.springframework.util.FileCopyUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.InputSource; -import static org.custommonkey.xmlunit.XMLAssert.*; - -/** @author Arjen Poutsma */ -@SuppressWarnings("unchecked") +/** + * @author Arjen Poutsma + */ public class SourceHttpMessageConverterTests { private SourceHttpMessageConverter converter; diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletInputStream.java b/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletInputStream.java index d3e3ff67857..f0a259edd20 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletInputStream.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletInputStream.java @@ -54,10 +54,12 @@ public class DelegatingServletInputStream extends ServletInputStream { } + @Override public int read() throws IOException { return this.sourceStream.read(); } + @Override public void close() throws IOException { super.close(); this.sourceStream.close(); diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletOutputStream.java b/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletOutputStream.java index 5f32208ecb6..58aa59d49da 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletOutputStream.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/DelegatingServletOutputStream.java @@ -54,15 +54,18 @@ public class DelegatingServletOutputStream extends ServletOutputStream { } + @Override public void write(int b) throws IOException { this.targetStream.write(b); } + @Override public void flush() throws IOException { super.flush(); this.targetStream.flush(); } + @Override public void close() throws IOException { super.close(); this.targetStream.close(); diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockAsyncContext.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockAsyncContext.java index 00a632f47dc..f4ff566922c 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockAsyncContext.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockAsyncContext.java @@ -56,14 +56,17 @@ public class MockAsyncContext implements AsyncContext { this.response = (HttpServletResponse) response; } + @Override public ServletRequest getRequest() { return this.request; } + @Override public ServletResponse getResponse() { return this.response; } + @Override public boolean hasOriginalRequestAndResponse() { return (this.request instanceof MockHttpServletRequest) && (this.response instanceof MockHttpServletResponse); } @@ -72,18 +75,22 @@ public class MockAsyncContext implements AsyncContext { return this.dispatchedPath; } + @Override public void dispatch() { dispatch(this.request.getRequestURI()); } + @Override public void dispatch(String path) { dispatch(null, path); } + @Override public void dispatch(ServletContext context, String path) { this.dispatchedPath = path; } + @Override public void complete() { MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(request, MockHttpServletRequest.class); if (mockRequest != null) { @@ -99,6 +106,7 @@ public class MockAsyncContext implements AsyncContext { } } + @Override public void start(Runnable runnable) { runnable.run(); } @@ -107,22 +115,27 @@ public class MockAsyncContext implements AsyncContext { return this.listeners; } + @Override public void addListener(AsyncListener listener) { this.listeners.add(listener); } + @Override public void addListener(AsyncListener listener, ServletRequest request, ServletResponse response) { this.listeners.add(listener); } + @Override public T createListener(Class clazz) throws ServletException { return BeanUtils.instantiateClass(clazz); } + @Override public long getTimeout() { return this.timeout; } + @Override public void setTimeout(long timeout) { this.timeout = timeout; } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockBodyContent.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockBodyContent.java index 7160e641557..eb3ebe8e8b6 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockBodyContent.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockBodyContent.java @@ -77,14 +77,17 @@ public class MockBodyContent extends BodyContent { } + @Override public Reader getReader() { return new StringReader(this.content); } + @Override public String getString() { return this.content; } + @Override public void writeOut(Writer writer) throws IOException { writer.write(this.content); } @@ -94,102 +97,127 @@ public class MockBodyContent extends BodyContent { // Delegating implementations of JspWriter's abstract methods //--------------------------------------------------------------------- + @Override public void clear() throws IOException { getEnclosingWriter().clear(); } + @Override public void clearBuffer() throws IOException { getEnclosingWriter().clearBuffer(); } + @Override public void close() throws IOException { getEnclosingWriter().close(); } + @Override public int getRemaining() { return getEnclosingWriter().getRemaining(); } + @Override public void newLine() throws IOException { getEnclosingWriter().println(); } + @Override public void write(char value[], int offset, int length) throws IOException { getEnclosingWriter().write(value, offset, length); } + @Override public void print(boolean value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(char value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(char[] value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(double value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(float value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(int value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(long value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(Object value) throws IOException { getEnclosingWriter().print(value); } + @Override public void print(String value) throws IOException { getEnclosingWriter().print(value); } + @Override public void println() throws IOException { getEnclosingWriter().println(); } + @Override public void println(boolean value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(char value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(char[] value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(double value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(float value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(int value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(long value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(Object value) throws IOException { getEnclosingWriter().println(value); } + @Override public void println(String value) throws IOException { getEnclosingWriter().println(value); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockExpressionEvaluator.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockExpressionEvaluator.java index e13749eef11..95e5c5d436d 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockExpressionEvaluator.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockExpressionEvaluator.java @@ -40,6 +40,7 @@ import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; * @since 1.1.5 * @see org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager */ +@Deprecated public class MockExpressionEvaluator extends ExpressionEvaluator { private final PageContext pageContext; @@ -53,17 +54,20 @@ public class MockExpressionEvaluator extends ExpressionEvaluator { this.pageContext = pageContext; } + @Override public Expression parseExpression( final String expression, final Class expectedType, final FunctionMapper functionMapper) throws ELException { return new Expression() { + @Override public Object evaluate(VariableResolver variableResolver) throws ELException { return doEvaluate(expression, expectedType, functionMapper); } }; } + @Override public Object evaluate( String expression, Class expectedType, VariableResolver variableResolver, FunctionMapper functionMapper) throws ELException { diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterChain.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterChain.java index a6fa2f6b261..5b4b68b94d7 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterChain.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterChain.java @@ -117,6 +117,7 @@ public class MockFilterChain implements FilterChain { * Invoke registered {@link Filter}s and/or {@link Servlet} also saving the * request and response. */ + @Override public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { Assert.notNull(request, "Request must not be null"); Assert.notNull(response, "Response must not be null"); @@ -160,15 +161,18 @@ public class MockFilterChain implements FilterChain { this.delegateServlet = servlet; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { this.delegateServlet.service(request, response); } + @Override public void init(FilterConfig filterConfig) throws ServletException { } + @Override public void destroy() { } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterConfig.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterConfig.java index 9db10c665bd..12fbe613ec8 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterConfig.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockFilterConfig.java @@ -79,10 +79,12 @@ public class MockFilterConfig implements FilterConfig { } + @Override public String getFilterName() { return filterName; } + @Override public ServletContext getServletContext() { return servletContext; } @@ -92,11 +94,13 @@ public class MockFilterConfig implements FilterConfig { this.initParameters.put(name, value); } + @Override public String getInitParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.initParameters.get(name); } + @Override public Enumeration getInitParameterNames() { return Collections.enumeration(this.initParameters.keySet()); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java index 4544448afaf..5694b666105 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java @@ -264,6 +264,7 @@ public class MockHttpServletRequest implements HttpServletRequest { * Return the ServletContext that this request is associated with. (Not * available in the standard HttpServletRequest interface for some reason.) */ + @Override public ServletContext getServletContext() { return this.servletContext; } @@ -305,20 +306,24 @@ public class MockHttpServletRequest implements HttpServletRequest { // ServletRequest interface //--------------------------------------------------------------------- + @Override public Object getAttribute(String name) { checkActive(); return this.attributes.get(name); } + @Override public Enumeration getAttributeNames() { checkActive(); return Collections.enumeration(this.attributes.keySet()); } + @Override public String getCharacterEncoding() { return this.characterEncoding; } + @Override public void setCharacterEncoding(String characterEncoding) { this.characterEncoding = characterEncoding; updateContentTypeHeader(); @@ -338,6 +343,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.content = content; } + @Override public int getContentLength() { return (this.content != null ? this.content.length : -1); } @@ -354,10 +360,12 @@ public class MockHttpServletRequest implements HttpServletRequest { } } + @Override public String getContentType() { return this.contentType; } + @Override public ServletInputStream getInputStream() { if (this.content != null) { return new DelegatingServletInputStream(new ByteArrayInputStream(this.content)); @@ -480,21 +488,25 @@ public class MockHttpServletRequest implements HttpServletRequest { this.parameters.clear(); } + @Override public String getParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); String[] arr = this.parameters.get(name); return (arr != null && arr.length > 0 ? arr[0] : null); } + @Override public Enumeration getParameterNames() { return Collections.enumeration(this.parameters.keySet()); } + @Override public String[] getParameterValues(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.parameters.get(name); } + @Override public Map getParameterMap() { return Collections.unmodifiableMap(this.parameters); } @@ -503,6 +515,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.protocol = protocol; } + @Override public String getProtocol() { return this.protocol; } @@ -511,6 +524,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.scheme = scheme; } + @Override public String getScheme() { return this.scheme; } @@ -519,6 +533,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.serverName = serverName; } + @Override public String getServerName() { return this.serverName; } @@ -527,10 +542,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.serverPort = serverPort; } + @Override public int getServerPort() { return this.serverPort; } + @Override public BufferedReader getReader() throws UnsupportedEncodingException { if (this.content != null) { InputStream sourceStream = new ByteArrayInputStream(this.content); @@ -547,6 +564,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.remoteAddr = remoteAddr; } + @Override public String getRemoteAddr() { return this.remoteAddr; } @@ -555,10 +573,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.remoteHost = remoteHost; } + @Override public String getRemoteHost() { return this.remoteHost; } + @Override public void setAttribute(String name, Object value) { checkActive(); Assert.notNull(name, "Attribute name must not be null"); @@ -570,6 +590,7 @@ public class MockHttpServletRequest implements HttpServletRequest { } } + @Override public void removeAttribute(String name) { checkActive(); Assert.notNull(name, "Attribute name must not be null"); @@ -604,10 +625,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.locales.addAll(locales); } + @Override public Locale getLocale() { return this.locales.get(0); } + @Override public Enumeration getLocales() { return Collections.enumeration(this.locales); } @@ -616,14 +639,17 @@ public class MockHttpServletRequest implements HttpServletRequest { this.secure = secure; } + @Override public boolean isSecure() { return this.secure; } + @Override public RequestDispatcher getRequestDispatcher(String path) { return new MockRequestDispatcher(path); } + @Override public String getRealPath(String path) { return this.servletContext.getRealPath(path); } @@ -632,6 +658,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.remotePort = remotePort; } + @Override public int getRemotePort() { return this.remotePort; } @@ -640,6 +667,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.localName = localName; } + @Override public String getLocalName() { return this.localName; } @@ -648,6 +676,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.localAddr = localAddr; } + @Override public String getLocalAddr() { return this.localAddr; } @@ -656,6 +685,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.localPort = localPort; } + @Override public int getLocalPort() { return this.localPort; } @@ -669,6 +699,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.authType = authType; } + @Override public String getAuthType() { return this.authType; } @@ -677,6 +708,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.cookies = cookies; } + @Override public Cookie[] getCookies() { return this.cookies; } @@ -725,6 +757,7 @@ public class MockHttpServletRequest implements HttpServletRequest { } } + @Override public long getDateHeader(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); Object value = (header != null ? header.getValue() : null); @@ -743,20 +776,24 @@ public class MockHttpServletRequest implements HttpServletRequest { } } + @Override public String getHeader(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); return (header != null ? header.getValue().toString() : null); } + @Override public Enumeration getHeaders(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); return Collections.enumeration(header != null ? header.getStringValues() : new LinkedList()); } + @Override public Enumeration getHeaderNames() { return Collections.enumeration(this.headers.keySet()); } + @Override public int getIntHeader(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); Object value = (header != null ? header.getValue() : null); @@ -778,6 +815,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.method = method; } + @Override public String getMethod() { return this.method; } @@ -786,10 +824,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.pathInfo = pathInfo; } + @Override public String getPathInfo() { return this.pathInfo; } + @Override public String getPathTranslated() { return (this.pathInfo != null ? getRealPath(this.pathInfo) : null); } @@ -798,6 +838,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.contextPath = contextPath; } + @Override public String getContextPath() { return this.contextPath; } @@ -806,6 +847,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.queryString = queryString; } + @Override public String getQueryString() { return this.queryString; } @@ -814,6 +856,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.remoteUser = remoteUser; } + @Override public String getRemoteUser() { return this.remoteUser; } @@ -822,6 +865,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.userRoles.add(role); } + @Override public boolean isUserInRole(String role) { return (this.userRoles.contains(role) || (this.servletContext instanceof MockServletContext && ((MockServletContext) this.servletContext).getDeclaredRoles().contains( role))); @@ -831,6 +875,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.userPrincipal = userPrincipal; } + @Override public Principal getUserPrincipal() { return this.userPrincipal; } @@ -839,6 +884,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.requestedSessionId = requestedSessionId; } + @Override public String getRequestedSessionId() { return this.requestedSessionId; } @@ -847,10 +893,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.requestURI = requestURI; } + @Override public String getRequestURI() { return this.requestURI; } + @Override public StringBuffer getRequestURL() { StringBuffer url = new StringBuffer(this.scheme); url.append("://").append(this.serverName).append(':').append(this.serverPort); @@ -862,6 +910,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.servletPath = servletPath; } + @Override public String getServletPath() { return this.servletPath; } @@ -874,6 +923,7 @@ public class MockHttpServletRequest implements HttpServletRequest { } } + @Override public HttpSession getSession(boolean create) { checkActive(); // Reset session if invalidated. @@ -887,6 +937,7 @@ public class MockHttpServletRequest implements HttpServletRequest { return this.session; } + @Override public HttpSession getSession() { return getSession(true); } @@ -895,6 +946,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.requestedSessionIdValid = requestedSessionIdValid; } + @Override public boolean isRequestedSessionIdValid() { return this.requestedSessionIdValid; } @@ -903,6 +955,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.requestedSessionIdFromCookie = requestedSessionIdFromCookie; } + @Override public boolean isRequestedSessionIdFromCookie() { return this.requestedSessionIdFromCookie; } @@ -911,10 +964,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.requestedSessionIdFromURL = requestedSessionIdFromURL; } + @Override public boolean isRequestedSessionIdFromURL() { return this.requestedSessionIdFromURL; } + @Override public boolean isRequestedSessionIdFromUrl() { return isRequestedSessionIdFromURL(); } @@ -924,6 +979,7 @@ public class MockHttpServletRequest implements HttpServletRequest { // Methods introduced in Servlet 3.0 //--------------------------------------------------------------------- + @Override public AsyncContext getAsyncContext() { return this.asyncContext; } @@ -932,6 +988,7 @@ public class MockHttpServletRequest implements HttpServletRequest { this.asyncContext = asyncContext; } + @Override public DispatcherType getDispatcherType() { return this.dispatcherType; } @@ -944,14 +1001,17 @@ public class MockHttpServletRequest implements HttpServletRequest { this.asyncSupported = asyncSupported; } + @Override public boolean isAsyncSupported() { return this.asyncSupported; } + @Override public AsyncContext startAsync() { return startAsync(this, null); } + @Override public AsyncContext startAsync(ServletRequest request, ServletResponse response) { if (!this.asyncSupported) { throw new IllegalStateException("Async not supported"); @@ -965,10 +1025,12 @@ public class MockHttpServletRequest implements HttpServletRequest { this.asyncStarted = asyncStarted; } + @Override public boolean isAsyncStarted() { return this.asyncStarted; } + @Override public boolean authenticate(HttpServletResponse arg0) throws IOException, ServletException { throw new UnsupportedOperationException(); } @@ -977,18 +1039,22 @@ public class MockHttpServletRequest implements HttpServletRequest { parts.put(part.getName(), part); } + @Override public Part getPart(String key) throws IOException, IllegalStateException, ServletException { return parts.get(key); } + @Override public Collection getParts() throws IOException, IllegalStateException, ServletException { return parts.values(); } + @Override public void login(String arg0, String arg1) throws ServletException { throw new UnsupportedOperationException(); } + @Override public void logout() throws ServletException { throw new UnsupportedOperationException(); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java index ce6ef7fa9bc..6f52ab8e3e8 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java @@ -138,6 +138,7 @@ public class MockHttpServletResponse implements HttpServletResponse { return this.writerAccessAllowed; } + @Override public void setCharacterEncoding(String characterEncoding) { this.characterEncoding = characterEncoding; this.charset = true; @@ -154,10 +155,12 @@ public class MockHttpServletResponse implements HttpServletResponse { } } + @Override public String getCharacterEncoding() { return this.characterEncoding; } + @Override public ServletOutputStream getOutputStream() { if (!this.outputStreamAccessAllowed) { throw new IllegalStateException("OutputStream access not allowed"); @@ -165,6 +168,7 @@ public class MockHttpServletResponse implements HttpServletResponse { return this.outputStream; } + @Override public PrintWriter getWriter() throws UnsupportedEncodingException { if (!this.writerAccessAllowed) { throw new IllegalStateException("Writer access not allowed"); @@ -188,6 +192,7 @@ public class MockHttpServletResponse implements HttpServletResponse { this.content.toString(this.characterEncoding) : this.content.toString(); } + @Override public void setContentLength(int contentLength) { this.contentLength = contentLength; doAddHeaderValue(CONTENT_LENGTH_HEADER, contentLength, true); @@ -197,6 +202,7 @@ public class MockHttpServletResponse implements HttpServletResponse { return this.contentLength; } + @Override public void setContentType(String contentType) { this.contentType = contentType; if (contentType != null) { @@ -210,22 +216,27 @@ public class MockHttpServletResponse implements HttpServletResponse { } } + @Override public String getContentType() { return this.contentType; } + @Override public void setBufferSize(int bufferSize) { this.bufferSize = bufferSize; } + @Override public int getBufferSize() { return this.bufferSize; } + @Override public void flushBuffer() { setCommitted(true); } + @Override public void resetBuffer() { if (isCommitted()) { throw new IllegalStateException("Cannot reset buffer - response is already committed"); @@ -244,10 +255,12 @@ public class MockHttpServletResponse implements HttpServletResponse { this.committed = committed; } + @Override public boolean isCommitted() { return this.committed; } + @Override public void reset() { resetBuffer(); this.characterEncoding = null; @@ -260,10 +273,12 @@ public class MockHttpServletResponse implements HttpServletResponse { this.errorMessage = null; } + @Override public void setLocale(Locale locale) { this.locale = locale; } + @Override public Locale getLocale() { return this.locale; } @@ -273,6 +288,7 @@ public class MockHttpServletResponse implements HttpServletResponse { // HttpServletResponse interface //--------------------------------------------------------------------- + @Override public void addCookie(Cookie cookie) { Assert.notNull(cookie, "Cookie must not be null"); this.cookies.add(cookie); @@ -292,6 +308,7 @@ public class MockHttpServletResponse implements HttpServletResponse { return null; } + @Override public boolean containsHeader(String name) { return (HeaderValueHolder.getByName(this.headers, name) != null); } @@ -301,6 +318,7 @@ public class MockHttpServletResponse implements HttpServletResponse { *

As of Servlet 3.0, this method is also defined HttpServletResponse. * @return the {@code Set} of header name {@code Strings}, or an empty {@code Set} if none */ + @Override public Set getHeaderNames() { return this.headers.keySet(); } @@ -314,6 +332,7 @@ public class MockHttpServletResponse implements HttpServletResponse { * @param name the name of the header * @return the associated header value, or {@code null} if none */ + @Override public String getHeader(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); return (header != null ? header.getStringValue() : null); @@ -327,6 +346,7 @@ public class MockHttpServletResponse implements HttpServletResponse { * @param name the name of the header * @return the associated header values, or an empty List if none */ + @Override public List getHeaders(String name) { HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); if (header != null) { @@ -367,6 +387,7 @@ public class MockHttpServletResponse implements HttpServletResponse { * The default implementation returns the given URL String as-is. *

Can be overridden in subclasses, appending a session id or the like. */ + @Override public String encodeURL(String url) { return url; } @@ -379,18 +400,22 @@ public class MockHttpServletResponse implements HttpServletResponse { * override the common {@link #encodeURL} method instead, applying * to redirect URLs as well as to general URLs. */ + @Override public String encodeRedirectURL(String url) { return encodeURL(url); } + @Override public String encodeUrl(String url) { return encodeURL(url); } + @Override public String encodeRedirectUrl(String url) { return encodeRedirectURL(url); } + @Override public void sendError(int status, String errorMessage) throws IOException { if (isCommitted()) { throw new IllegalStateException("Cannot set error status - response is already committed"); @@ -400,6 +425,7 @@ public class MockHttpServletResponse implements HttpServletResponse { setCommitted(true); } + @Override public void sendError(int status) throws IOException { if (isCommitted()) { throw new IllegalStateException("Cannot set error status - response is already committed"); @@ -408,6 +434,7 @@ public class MockHttpServletResponse implements HttpServletResponse { setCommitted(true); } + @Override public void sendRedirect(String url) throws IOException { if (isCommitted()) { throw new IllegalStateException("Cannot send redirect - response is already committed"); @@ -422,26 +449,32 @@ public class MockHttpServletResponse implements HttpServletResponse { return getHeader(LOCATION_HEADER); } + @Override public void setDateHeader(String name, long value) { setHeaderValue(name, value); } + @Override public void addDateHeader(String name, long value) { addHeaderValue(name, value); } + @Override public void setHeader(String name, String value) { setHeaderValue(name, value); } + @Override public void addHeader(String name, String value) { addHeaderValue(name, value); } + @Override public void setIntHeader(String name, int value) { setHeaderValue(name, value); } + @Override public void addIntHeader(String name, int value) { addHeaderValue(name, value); } @@ -489,15 +522,18 @@ public class MockHttpServletResponse implements HttpServletResponse { } } + @Override public void setStatus(int status) { this.status = status; } + @Override public void setStatus(int status, String errorMessage) { this.status = status; this.errorMessage = errorMessage; } + @Override public int getStatus() { return this.status; } @@ -555,12 +591,14 @@ public class MockHttpServletResponse implements HttpServletResponse { super(out); } + @Override public void write(int b) throws IOException { super.write(b); super.flush(); setCommittedIfBufferSizeExceeded(); } + @Override public void flush() throws IOException { super.flush(); setCommitted(true); @@ -578,24 +616,28 @@ public class MockHttpServletResponse implements HttpServletResponse { super(out, true); } + @Override public void write(char buf[], int off, int len) { super.write(buf, off, len); super.flush(); setCommittedIfBufferSizeExceeded(); } + @Override public void write(String s, int off, int len) { super.write(s, off, len); super.flush(); setCommittedIfBufferSizeExceeded(); } + @Override public void write(int c) { super.write(c); super.flush(); setCommittedIfBufferSizeExceeded(); } + @Override public void flush() { super.flush(); setCommitted(true); diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpSession.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpSession.java index ae7d58af432..12301763b6b 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpSession.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpSession.java @@ -98,10 +98,12 @@ public class MockHttpSession implements HttpSession { this.id = (id != null ? id : Integer.toString(nextId++)); } + @Override public long getCreationTime() { return this.creationTime; } + @Override public String getId() { return this.id; } @@ -111,43 +113,53 @@ public class MockHttpSession implements HttpSession { this.isNew = false; } + @Override public long getLastAccessedTime() { return this.lastAccessedTime; } + @Override public ServletContext getServletContext() { return this.servletContext; } + @Override public void setMaxInactiveInterval(int interval) { this.maxInactiveInterval = interval; } + @Override public int getMaxInactiveInterval() { return this.maxInactiveInterval; } + @Override public HttpSessionContext getSessionContext() { throw new UnsupportedOperationException("getSessionContext"); } + @Override public Object getAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); } + @Override public Object getValue(String name) { return getAttribute(name); } + @Override public Enumeration getAttributeNames() { return Collections.enumeration(this.attributes.keySet()); } + @Override public String[] getValueNames() { return this.attributes.keySet().toArray(new String[this.attributes.size()]); } + @Override public void setAttribute(String name, Object value) { Assert.notNull(name, "Attribute name must not be null"); if (value != null) { @@ -161,10 +173,12 @@ public class MockHttpSession implements HttpSession { } } + @Override public void putValue(String name, Object value) { setAttribute(name, value); } + @Override public void removeAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); Object value = this.attributes.remove(name); @@ -173,6 +187,7 @@ public class MockHttpSession implements HttpSession { } } + @Override public void removeValue(String name) { removeAttribute(name); } @@ -197,6 +212,7 @@ public class MockHttpSession implements HttpSession { * * @throws IllegalStateException if this method is called on an already invalidated session */ + @Override public void invalidate() { if (this.invalid) { throw new IllegalStateException("The session has already been invalidated"); @@ -215,6 +231,7 @@ public class MockHttpSession implements HttpSession { this.isNew = value; } + @Override public boolean isNew() { return this.isNew; } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockJspWriter.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockJspWriter.java index dc1dc5c51ce..e83ff23521f 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockJspWriter.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockJspWriter.java @@ -82,6 +82,7 @@ public class MockJspWriter extends JspWriter { } + @Override public void clear() throws IOException { if (this.response.isCommitted()) { throw new IOException("Response already committed"); @@ -89,101 +90,126 @@ public class MockJspWriter extends JspWriter { this.response.resetBuffer(); } + @Override public void clearBuffer() throws IOException { } + @Override public void flush() throws IOException { this.response.flushBuffer(); } + @Override public void close() throws IOException { flush(); } + @Override public int getRemaining() { return Integer.MAX_VALUE; } + @Override public void newLine() throws IOException { getTargetWriter().println(); } + @Override public void write(char value[], int offset, int length) throws IOException { getTargetWriter().write(value, offset, length); } + @Override public void print(boolean value) throws IOException { getTargetWriter().print(value); } + @Override public void print(char value) throws IOException { getTargetWriter().print(value); } + @Override public void print(char[] value) throws IOException { getTargetWriter().print(value); } + @Override public void print(double value) throws IOException { getTargetWriter().print(value); } + @Override public void print(float value) throws IOException { getTargetWriter().print(value); } + @Override public void print(int value) throws IOException { getTargetWriter().print(value); } + @Override public void print(long value) throws IOException { getTargetWriter().print(value); } + @Override public void print(Object value) throws IOException { getTargetWriter().print(value); } + @Override public void print(String value) throws IOException { getTargetWriter().print(value); } + @Override public void println() throws IOException { getTargetWriter().println(); } + @Override public void println(boolean value) throws IOException { getTargetWriter().println(value); } + @Override public void println(char value) throws IOException { getTargetWriter().println(value); } + @Override public void println(char[] value) throws IOException { getTargetWriter().println(value); } + @Override public void println(double value) throws IOException { getTargetWriter().println(value); } + @Override public void println(float value) throws IOException { getTargetWriter().println(value); } + @Override public void println(int value) throws IOException { getTargetWriter().println(value); } + @Override public void println(long value) throws IOException { getTargetWriter().println(value); } + @Override public void println(Object value) throws IOException { getTargetWriter().println(value); } + @Override public void println(String value) throws IOException { getTargetWriter().println(value); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartFile.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartFile.java index c9bf0742967..8cad672a2de 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartFile.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartFile.java @@ -96,34 +96,42 @@ public class MockMultipartFile implements MultipartFile { } + @Override public String getName() { return this.name; } + @Override public String getOriginalFilename() { return this.originalFilename; } + @Override public String getContentType() { return this.contentType; } + @Override public boolean isEmpty() { return (this.content.length == 0); } + @Override public long getSize() { return this.content.length; } + @Override public byte[] getBytes() throws IOException { return this.content; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(this.content); } + @Override public void transferTo(File dest) throws IOException, IllegalStateException { FileCopyUtils.copy(this.content, dest); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartHttpServletRequest.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartHttpServletRequest.java index dc915eec4f3..868d786bdd3 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartHttpServletRequest.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockMultipartHttpServletRequest.java @@ -66,14 +66,17 @@ public class MockMultipartHttpServletRequest extends MockHttpServletRequest impl this.multipartFiles.add(file.getName(), file); } + @Override public Iterator getFileNames() { return this.multipartFiles.keySet().iterator(); } + @Override public MultipartFile getFile(String name) { return this.multipartFiles.getFirst(name); } + @Override public List getFiles(String name) { List multipartFiles = this.multipartFiles.get(name); if (multipartFiles != null) { @@ -84,14 +87,17 @@ public class MockMultipartHttpServletRequest extends MockHttpServletRequest impl } } + @Override public Map getFileMap() { return this.multipartFiles.toSingleValueMap(); } + @Override public MultiValueMap getMultiFileMap() { return new LinkedMultiValueMap(this.multipartFiles); } + @Override public String getMultipartContentType(String paramOrFileName) { MultipartFile file = getFile(paramOrFileName); if (file != null) { @@ -102,10 +108,12 @@ public class MockMultipartHttpServletRequest extends MockHttpServletRequest impl } } + @Override public HttpMethod getRequestMethod() { return HttpMethod.valueOf(getMethod()); } + @Override public HttpHeaders getRequestHeaders() { HttpHeaders headers = new HttpHeaders(); Enumeration headerNames = getHeaderNames(); @@ -116,6 +124,7 @@ public class MockMultipartHttpServletRequest extends MockHttpServletRequest impl return headers; } + @Override public HttpHeaders getMultipartHeaders(String paramOrFileName) { String contentType = getMultipartContentType(paramOrFileName); if (contentType != null) { diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockPageContext.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockPageContext.java index efa1319b92d..d4d5f2011eb 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockPageContext.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockPageContext.java @@ -22,6 +22,7 @@ import java.util.Collections; import java.util.Enumeration; import java.util.LinkedHashMap; import java.util.Map; + import javax.el.ELContext; import javax.servlet.Servlet; import javax.servlet.ServletConfig; @@ -125,6 +126,7 @@ public class MockPageContext extends PageContext { } + @Override public void initialize( Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) { @@ -132,9 +134,11 @@ public class MockPageContext extends PageContext { throw new UnsupportedOperationException("Use appropriate constructor"); } + @Override public void release() { } + @Override public void setAttribute(String name, Object value) { Assert.notNull(name, "Attribute name must not be null"); if (value != null) { @@ -145,6 +149,7 @@ public class MockPageContext extends PageContext { } } + @Override public void setAttribute(String name, Object value, int scope) { Assert.notNull(name, "Attribute name must not be null"); switch (scope) { @@ -165,11 +170,13 @@ public class MockPageContext extends PageContext { } } + @Override public Object getAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); } + @Override public Object getAttribute(String name, int scope) { Assert.notNull(name, "Attribute name must not be null"); switch (scope) { @@ -187,6 +194,7 @@ public class MockPageContext extends PageContext { } } + @Override public Object findAttribute(String name) { Object value = getAttribute(name); if (value == null) { @@ -201,6 +209,7 @@ public class MockPageContext extends PageContext { return value; } + @Override public void removeAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); this.removeAttribute(name, PageContext.PAGE_SCOPE); @@ -209,6 +218,7 @@ public class MockPageContext extends PageContext { this.removeAttribute(name, PageContext.APPLICATION_SCOPE); } + @Override public void removeAttribute(String name, int scope) { Assert.notNull(name, "Attribute name must not be null"); switch (scope) { @@ -229,6 +239,7 @@ public class MockPageContext extends PageContext { } } + @Override public int getAttributesScope(String name) { if (getAttribute(name) != null) { return PAGE_SCOPE; @@ -251,7 +262,7 @@ public class MockPageContext extends PageContext { return Collections.enumeration(this.attributes.keySet()); } - @SuppressWarnings("unchecked") + @Override public Enumeration getAttributeNamesInScope(int scope) { switch (scope) { case PAGE_SCOPE: @@ -268,6 +279,7 @@ public class MockPageContext extends PageContext { } } + @Override public JspWriter getOut() { if (this.out == null) { this.out = new MockJspWriter(this.response); @@ -275,54 +287,69 @@ public class MockPageContext extends PageContext { return this.out; } + @Override + @Deprecated public ExpressionEvaluator getExpressionEvaluator() { return new MockExpressionEvaluator(this); } + @Override public ELContext getELContext() { return null; } + @Override + @Deprecated public VariableResolver getVariableResolver() { return null; } + @Override public HttpSession getSession() { return this.request.getSession(); } + @Override public Object getPage() { return this; } + @Override public ServletRequest getRequest() { return this.request; } + @Override public ServletResponse getResponse() { return this.response; } + @Override public Exception getException() { return null; } + @Override public ServletConfig getServletConfig() { return this.servletConfig; } + @Override public ServletContext getServletContext() { return this.servletContext; } + @Override public void forward(String path) throws ServletException, IOException { this.request.getRequestDispatcher(path).forward(this.request, this.response); } + @Override public void include(String path) throws ServletException, IOException { this.request.getRequestDispatcher(path).include(this.request, this.response); } + @Override public void include(String path, boolean flush) throws ServletException, IOException { this.request.getRequestDispatcher(path).include(this.request, this.response); if (flush) { @@ -340,10 +367,12 @@ public class MockPageContext extends PageContext { return ((MockHttpServletResponse) this.response).getContentAsString(); } + @Override public void handlePageException(Exception ex) throws ServletException, IOException { throw new ServletException("Page exception", ex); } + @Override public void handlePageException(Throwable ex) throws ServletException, IOException { throw new ServletException("Page exception", ex); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockPart.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockPart.java index ef594bc7577..f26dfc2b9c1 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockPart.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockPart.java @@ -90,22 +90,27 @@ public class MockPart implements Part { } + @Override public String getName() { return this.name; } + @Override public String getContentType() { return this.contentType; } + @Override public long getSize() { return this.content.length; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(this.content); } + @Override public String getHeader(String name) { if (CONTENT_TYPE.equalsIgnoreCase(name)) { return this.contentType; @@ -115,6 +120,7 @@ public class MockPart implements Part { } } + @Override public Collection getHeaders(String name) { if (CONTENT_TYPE.equalsIgnoreCase(name)) { return Collections.singleton(this.contentType); @@ -124,14 +130,17 @@ public class MockPart implements Part { } } + @Override public Collection getHeaderNames() { return Collections.singleton(CONTENT_TYPE); } + @Override public void write(String fileName) throws IOException { throw new UnsupportedOperationException(); } + @Override public void delete() throws IOException { throw new UnsupportedOperationException(); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockRequestDispatcher.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockRequestDispatcher.java index d2766fcb0f0..b8679b80209 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockRequestDispatcher.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockRequestDispatcher.java @@ -55,6 +55,7 @@ public class MockRequestDispatcher implements RequestDispatcher { } + @Override public void forward(ServletRequest request, ServletResponse response) { Assert.notNull(request, "Request must not be null"); Assert.notNull(response, "Response must not be null"); @@ -67,6 +68,7 @@ public class MockRequestDispatcher implements RequestDispatcher { } } + @Override public void include(ServletRequest request, ServletResponse response) { Assert.notNull(request, "Request must not be null"); Assert.notNull(response, "Response must not be null"); diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockServletConfig.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockServletConfig.java index 9447b10d7e2..d7738c95273 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockServletConfig.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockServletConfig.java @@ -78,10 +78,12 @@ public class MockServletConfig implements ServletConfig { } + @Override public String getServletName() { return this.servletName; } + @Override public ServletContext getServletContext() { return this.servletContext; } @@ -91,11 +93,13 @@ public class MockServletConfig implements ServletConfig { this.initParameters.put(name, value); } + @Override public String getInitParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.initParameters.get(name); } + @Override public Enumeration getInitParameterNames() { return Collections.enumeration(this.initParameters.keySet()); } diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockServletContext.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockServletContext.java index 3a0e23e2932..d18678dc4a4 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockServletContext.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockServletContext.java @@ -205,6 +205,7 @@ public class MockServletContext implements ServletContext { } /* This is a Servlet API 2.5 method. */ + @Override public String getContextPath() { return this.contextPath; } @@ -213,6 +214,7 @@ public class MockServletContext implements ServletContext { this.contexts.put(contextPath, context); } + @Override public ServletContext getContext(String contextPath) { if (this.contextPath.equals(contextPath)) { return this; @@ -224,6 +226,7 @@ public class MockServletContext implements ServletContext { this.majorVersion = majorVersion; } + @Override public int getMajorVersion() { return this.majorVersion; } @@ -232,6 +235,7 @@ public class MockServletContext implements ServletContext { this.minorVersion = minorVersion; } + @Override public int getMinorVersion() { return this.minorVersion; } @@ -240,6 +244,7 @@ public class MockServletContext implements ServletContext { this.effectiveMajorVersion = effectiveMajorVersion; } + @Override public int getEffectiveMajorVersion() { return this.effectiveMajorVersion; } @@ -248,14 +253,17 @@ public class MockServletContext implements ServletContext { this.effectiveMinorVersion = effectiveMinorVersion; } + @Override public int getEffectiveMinorVersion() { return this.effectiveMinorVersion; } + @Override public String getMimeType(String filePath) { return MimeTypeResolver.getMimeType(filePath); } + @Override public Set getResourcePaths(String path) { String actualPath = (path.endsWith("/") ? path : path + "/"); Resource resource = this.resourceLoader.getResource(getResourceLocation(actualPath)); @@ -281,6 +289,7 @@ public class MockServletContext implements ServletContext { } } + @Override public URL getResource(String path) throws MalformedURLException { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); if (!resource.exists()) { @@ -298,6 +307,7 @@ public class MockServletContext implements ServletContext { } } + @Override public InputStream getResourceAsStream(String path) { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); if (!resource.exists()) { @@ -312,6 +322,7 @@ public class MockServletContext implements ServletContext { } } + @Override public RequestDispatcher getRequestDispatcher(String path) { if (!path.startsWith("/")) { throw new IllegalArgumentException("RequestDispatcher path at ServletContext level must start with '/'"); @@ -319,6 +330,7 @@ public class MockServletContext implements ServletContext { return new MockRequestDispatcher(path); } + @Override public RequestDispatcher getNamedDispatcher(String path) { return this.namedRequestDispatchers.get(path); } @@ -376,30 +388,37 @@ public class MockServletContext implements ServletContext { registerNamedDispatcher(this.defaultServletName, new MockRequestDispatcher(this.defaultServletName)); } + @Override public Servlet getServlet(String name) { return null; } + @Override public Enumeration getServlets() { return Collections.enumeration(new HashSet()); } + @Override public Enumeration getServletNames() { return Collections.enumeration(new HashSet()); } + @Override public void log(String message) { logger.info(message); } + @Override public void log(Exception ex, String message) { logger.info(message, ex); } + @Override public void log(String message, Throwable ex) { logger.info(message, ex); } + @Override public String getRealPath(String path) { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); try { @@ -411,19 +430,23 @@ public class MockServletContext implements ServletContext { } } + @Override public String getServerInfo() { return "MockServletContext"; } + @Override public String getInitParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.initParameters.get(name); } + @Override public Enumeration getInitParameterNames() { return Collections.enumeration(this.initParameters.keySet()); } + @Override public boolean setInitParameter(String name, String value) { Assert.notNull(name, "Parameter name must not be null"); if (this.initParameters.containsKey(name)) { @@ -438,15 +461,18 @@ public class MockServletContext implements ServletContext { this.initParameters.put(name, value); } + @Override public Object getAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); } + @Override public Enumeration getAttributeNames() { return Collections.enumeration(this.attributes.keySet()); } + @Override public void setAttribute(String name, Object value) { Assert.notNull(name, "Attribute name must not be null"); if (value != null) { @@ -457,6 +483,7 @@ public class MockServletContext implements ServletContext { } } + @Override public void removeAttribute(String name) { Assert.notNull(name, "Attribute name must not be null"); this.attributes.remove(name); @@ -466,14 +493,17 @@ public class MockServletContext implements ServletContext { this.servletContextName = servletContextName; } + @Override public String getServletContextName() { return this.servletContextName; } + @Override public ClassLoader getClassLoader() { return ClassUtils.getDefaultClassLoader(); } + @Override public void declareRoles(String... roleNames) { Assert.notNull(roleNames, "Role names array must not be null"); for (String roleName : roleNames) { @@ -503,90 +533,111 @@ public class MockServletContext implements ServletContext { // Methods introduced in Servlet 3.0 //--------------------------------------------------------------------- + @Override public FilterRegistration.Dynamic addFilter(String filterName, String className) { throw new UnsupportedOperationException(); } + @Override public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) { throw new UnsupportedOperationException(); } + @Override public FilterRegistration.Dynamic addFilter(String filterName, Class filterClass) { throw new UnsupportedOperationException(); } + @Override public void addListener(Class listenerClass) { throw new UnsupportedOperationException(); } + @Override public void addListener(String className) { throw new UnsupportedOperationException(); } + @Override public void addListener(T t) { throw new UnsupportedOperationException(); } + @Override public ServletRegistration.Dynamic addServlet(String servletName, String className) { throw new UnsupportedOperationException(); } + @Override public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) { throw new UnsupportedOperationException(); } + @Override public ServletRegistration.Dynamic addServlet(String servletName, Class servletClass) { throw new UnsupportedOperationException(); } + @Override public T createFilter(Class c) throws ServletException { throw new UnsupportedOperationException(); } + @Override public T createListener(Class c) throws ServletException { throw new UnsupportedOperationException(); } + @Override public T createServlet(Class c) throws ServletException { throw new UnsupportedOperationException(); } + @Override public Set getDefaultSessionTrackingModes() { throw new UnsupportedOperationException(); } + @Override public Set getEffectiveSessionTrackingModes() { throw new UnsupportedOperationException(); } + @Override public FilterRegistration getFilterRegistration(String filterName) { throw new UnsupportedOperationException(); } + @Override public Map getFilterRegistrations() { throw new UnsupportedOperationException(); } + @Override public JspConfigDescriptor getJspConfigDescriptor() { throw new UnsupportedOperationException(); } + @Override public ServletRegistration getServletRegistration(String servletName) { throw new UnsupportedOperationException(); } + @Override public Map getServletRegistrations() { throw new UnsupportedOperationException(); } + @Override public SessionCookieConfig getSessionCookieConfig() { throw new UnsupportedOperationException(); } + @Override public void setSessionTrackingModes(Set sessionTrackingModes) throws IllegalStateException, IllegalArgumentException { throw new UnsupportedOperationException(); diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/PassThroughFilterChain.java b/spring-web/src/test/java/org/springframework/mock/web/test/PassThroughFilterChain.java index 3e3b09b1595..505aa3f6bcd 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/PassThroughFilterChain.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/PassThroughFilterChain.java @@ -73,6 +73,7 @@ public class PassThroughFilterChain implements FilterChain { /** * Pass the call on to the Filter/Servlet. */ + @Override public void doFilter(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (this.filter != null) { this.filter.doFilter(request, response, this.nextFilterChain); diff --git a/spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java b/spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java index b2ca68eb7f6..d26b34565f1 100644 --- a/spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java +++ b/spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -20,8 +20,8 @@ import com.caucho.burlap.client.BurlapProxyFactory; import com.caucho.hessian.client.HessianProxyFactory; import junit.framework.TestCase; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.remoting.RemoteAccessException; /** @@ -219,14 +219,17 @@ public class CauchoRemotingTests extends TestCase { private String password; private boolean overloadEnabled; + @Override public void setUser(String user) { this.user = user; } + @Override public void setPassword(String password) { this.password = password; } + @Override public void setOverloadEnabled(boolean overloadEnabled) { this.overloadEnabled = overloadEnabled; } @@ -239,14 +242,17 @@ public class CauchoRemotingTests extends TestCase { private String password; private boolean overloadEnabled; + @Override public void setUser(String user) { this.user = user; } + @Override public void setPassword(String password) { this.password = password; } + @Override public void setOverloadEnabled(boolean overloadEnabled) { this.overloadEnabled = overloadEnabled; } diff --git a/spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerTests.java b/spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerTests.java index 56569a8e042..b436e306ecd 100644 --- a/spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerTests.java +++ b/spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -35,8 +35,8 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; import org.aopalliance.intercept.MethodInvocation; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; @@ -73,6 +73,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceUrl("http://myurl"); pfb.setHttpInvokerRequestExecutor(new AbstractHttpInvokerRequestExecutor() { + @Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception { assertEquals("http://myurl", config.getServiceUrl()); @@ -138,6 +139,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceUrl("http://myurl"); pfb.setHttpInvokerRequestExecutor(new HttpInvokerRequestExecutor() { + @Override public RemoteInvocationResult executeRequest( HttpInvokerClientConfiguration config, RemoteInvocation invocation) throws IOException { throw new IOException("argh"); @@ -160,6 +162,7 @@ public class HttpInvokerTests extends TestCase { TestBean target = new TestBean("myname", 99); final HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter() { + @Override protected InputStream decorateInputStream(HttpServletRequest request, InputStream is) throws IOException { if ("gzip".equals(request.getHeader("Compression"))) { return new GZIPInputStream(is); @@ -168,6 +171,7 @@ public class HttpInvokerTests extends TestCase { return is; } } + @Override protected OutputStream decorateOutputStream( HttpServletRequest request, HttpServletResponse response, OutputStream os) throws IOException { if ("gzip".equals(request.getHeader("Compression"))) { @@ -187,6 +191,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceUrl("http://myurl"); pfb.setHttpInvokerRequestExecutor(new AbstractHttpInvokerRequestExecutor() { + @Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws IOException, ClassNotFoundException { @@ -204,9 +209,11 @@ public class HttpInvokerTests extends TestCase { return readRemoteInvocationResult( new ByteArrayInputStream(response.getContentAsByteArray()), config.getCodebaseUrl()); } + @Override protected OutputStream decorateOutputStream(OutputStream os) throws IOException { return new GZIPOutputStream(os); } + @Override protected InputStream decorateInputStream(InputStream is) throws IOException { return new GZIPInputStream(is); } @@ -239,6 +246,7 @@ public class HttpInvokerTests extends TestCase { TestBean target = new TestBean("myname", 99); final HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter() { + @Override protected RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois) throws IOException, ClassNotFoundException { Object obj = ois.readObject(); @@ -248,6 +256,7 @@ public class HttpInvokerTests extends TestCase { } return ((TestRemoteInvocationWrapper) obj).remoteInvocation; } + @Override protected void doWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos) throws IOException { oos.writeObject(new TestRemoteInvocationResultWrapper(result)); @@ -262,6 +271,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceUrl("http://myurl"); pfb.setHttpInvokerRequestExecutor(new AbstractHttpInvokerRequestExecutor() { + @Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception { assertEquals("http://myurl", config.getServiceUrl()); @@ -272,9 +282,11 @@ public class HttpInvokerTests extends TestCase { return readRemoteInvocationResult( new ByteArrayInputStream(response.getContentAsByteArray()), config.getCodebaseUrl()); } + @Override protected void doWriteRemoteInvocation(RemoteInvocation invocation, ObjectOutputStream oos) throws IOException { oos.writeObject(new TestRemoteInvocationWrapper(invocation)); } + @Override protected RemoteInvocationResult doReadRemoteInvocationResult(ObjectInputStream ois) throws IOException, ClassNotFoundException { Object obj = ois.readObject(); @@ -316,6 +328,7 @@ public class HttpInvokerTests extends TestCase { exporter.setServiceInterface(ITestBean.class); exporter.setService(target); exporter.setRemoteInvocationExecutor(new DefaultRemoteInvocationExecutor() { + @Override public Object invoke(RemoteInvocation invocation, Object targetObject) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { assertNotNull(invocation.getAttributes()); @@ -331,6 +344,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceInterface(ITestBean.class); pfb.setServiceUrl("http://myurl"); pfb.setRemoteInvocationFactory(new RemoteInvocationFactory() { + @Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation = new RemoteInvocation(methodInvocation); invocation.addAttribute("myKey", "myValue"); @@ -350,6 +364,7 @@ public class HttpInvokerTests extends TestCase { }); pfb.setHttpInvokerRequestExecutor(new AbstractHttpInvokerRequestExecutor() { + @Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception { assertEquals("http://myurl", config.getServiceUrl()); @@ -375,6 +390,7 @@ public class HttpInvokerTests extends TestCase { exporter.setServiceInterface(ITestBean.class); exporter.setService(target); exporter.setRemoteInvocationExecutor(new DefaultRemoteInvocationExecutor() { + @Override public Object invoke(RemoteInvocation invocation, Object targetObject) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { assertTrue(invocation instanceof TestRemoteInvocation); @@ -389,6 +405,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceInterface(ITestBean.class); pfb.setServiceUrl("http://myurl"); pfb.setRemoteInvocationFactory(new RemoteInvocationFactory() { + @Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation = new TestRemoteInvocation(methodInvocation); assertNull(invocation.getAttributes()); @@ -398,6 +415,7 @@ public class HttpInvokerTests extends TestCase { }); pfb.setHttpInvokerRequestExecutor(new AbstractHttpInvokerRequestExecutor() { + @Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception { assertEquals("http://myurl", config.getServiceUrl()); @@ -423,6 +441,7 @@ public class HttpInvokerTests extends TestCase { pfb.setServiceUrl(serviceUrl); pfb.setHttpInvokerRequestExecutor(new HttpInvokerRequestExecutor() { + @Override public RemoteInvocationResult executeRequest( HttpInvokerClientConfiguration config, RemoteInvocation invocation) throws IOException { throw new IOException("argh"); diff --git a/spring-web/src/test/java/org/springframework/remoting/jaxrpc/JaxRpcSupportTests.java b/spring-web/src/test/java/org/springframework/remoting/jaxrpc/JaxRpcSupportTests.java index 1f249589b51..975d9537a30 100644 --- a/spring-web/src/test/java/org/springframework/remoting/jaxrpc/JaxRpcSupportTests.java +++ b/spring-web/src/test/java/org/springframework/remoting/jaxrpc/JaxRpcSupportTests.java @@ -45,6 +45,7 @@ import org.springframework.util.ObjectUtils; * @author Juergen Hoeller * @since 18.12.2003 */ +@Deprecated public class JaxRpcSupportTests extends TestCase { public void testLocalJaxRpcServiceFactoryBeanWithServiceNameAndNamespace() throws Exception { @@ -495,6 +496,7 @@ public class JaxRpcSupportTests extends TestCase { service1Control.setReturnValue(new RemoteBean()); } + @Override public Service createService(QName qName) throws ServiceException { if (!"myNamespace".equals(qName.getNamespaceURI()) || !"myService1".equals(qName.getLocalPart())) { throw new ServiceException("not supported"); @@ -503,6 +505,7 @@ public class JaxRpcSupportTests extends TestCase { return service1; } + @Override public Service createService(URL url, QName qName) throws ServiceException { try { if (!(new URL("http://myUrl1")).equals(url) || !"".equals(qName.getNamespaceURI()) || @@ -516,6 +519,7 @@ public class JaxRpcSupportTests extends TestCase { return service2; } + @Override public Service loadService(URL url, QName qName, Properties props) throws ServiceException { try { if (!(new URL("http://myUrl1")).equals(url) || !"".equals(qName.getNamespaceURI()) || @@ -532,6 +536,7 @@ public class JaxRpcSupportTests extends TestCase { return service1; } + @Override public Service loadService(Class ifc) throws ServiceException { if (!IRemoteBean.class.equals(ifc)) { throw new ServiceException("not supported"); @@ -540,6 +545,7 @@ public class JaxRpcSupportTests extends TestCase { return service2; } + @Override public Service loadService(URL url, Class ifc, Properties props) throws ServiceException { try { if (!(new URL("http://myUrl1")).equals(url) || !IRemoteBean.class.equals(ifc)) { @@ -563,6 +569,7 @@ public class JaxRpcSupportTests extends TestCase { super(); } + @Override protected void initMocks() throws Exception { super.initMocks(); service1.getPort(new QName("myNamespace", "myPort"), IRemoteBean.class); @@ -580,6 +587,7 @@ public class JaxRpcSupportTests extends TestCase { super(); } + @Override protected void initMocks() throws Exception { initStandardCall(1); } @@ -591,9 +599,11 @@ public class JaxRpcSupportTests extends TestCase { service1Control.setReturnValue(call1, count); call1.invoke(new Object[] {"myName"}); call1Control.setMatcher(new ArgumentsMatcher() { + @Override public boolean matches(Object[] objects, Object[] objects1) { return Arrays.equals((Object[]) objects[0], (Object[]) objects1[0]); } + @Override public String toString(Object[] objects) { return ObjectUtils.nullSafeToString(objects[0]); } @@ -616,6 +626,7 @@ public class JaxRpcSupportTests extends TestCase { public ExceptionCallMockServiceFactory() throws Exception { } + @Override protected void initMocks() throws Exception { initExceptionCall(); initStandardCall(2); @@ -628,9 +639,11 @@ public class JaxRpcSupportTests extends TestCase { service1Control.setReturnValue(call2); call2.invoke(new Object[] {"exception"}); call2Control.setMatcher(new ArgumentsMatcher() { + @Override public boolean matches(Object[] objects, Object[] objects1) { return Arrays.equals((Object[]) objects[0], (Object[]) objects1[0]); } + @Override public String toString(Object[] objects) { return ObjectUtils.nullSafeToString(objects[0]); } @@ -646,6 +659,7 @@ public class JaxRpcSupportTests extends TestCase { public CallWithPropertiesMockServiceFactory() throws Exception { } + @Override protected void extendStandardCall() { call1.setProperty(Call.USERNAME_PROPERTY, "user"); call1Control.setVoidCallable(); @@ -682,6 +696,7 @@ public class JaxRpcSupportTests extends TestCase { properties = new HashMap(); } + @Override public void setName(String nam) throws RemoteException { if ("exception".equals(nam)) { throw new RemoteException(); @@ -689,14 +704,17 @@ public class JaxRpcSupportTests extends TestCase { name = nam; } + @Override public void _setProperty(String key, Object o) { properties.put(key, o); } + @Override public Object _getProperty(String key) { return properties.get(key); } + @Override public Iterator _getPropertyNames() { return properties.keySet().iterator(); } diff --git a/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderNotFoundException.java b/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderNotFoundException.java index 6fec403c7e4..de4b1e9f14f 100644 --- a/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderNotFoundException.java +++ b/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderServiceImpl.java b/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderServiceImpl.java index 6c9ba364621..b109cdcd6da 100644 --- a/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderServiceImpl.java +++ b/spring-web/src/test/java/org/springframework/remoting/jaxws/OrderServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -31,6 +31,7 @@ public class OrderServiceImpl implements OrderService { @Resource private WebServiceContext webServiceContext; + @Override public String getOrder(int id) throws OrderNotFoundException { Assert.notNull(this.webServiceContext, "WebServiceContext has not been injected"); if (id == 0) { diff --git a/spring-webmvc/src/test/java/org/springframework/http/client/FreePortScanner.java b/spring-web/src/test/java/org/springframework/tests/web/FreePortScanner.java similarity index 96% rename from spring-webmvc/src/test/java/org/springframework/http/client/FreePortScanner.java rename to spring-web/src/test/java/org/springframework/tests/web/FreePortScanner.java index 113f3d4910a..9f5a3d9c339 100644 --- a/spring-webmvc/src/test/java/org/springframework/http/client/FreePortScanner.java +++ b/spring-web/src/test/java/org/springframework/tests/web/FreePortScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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.http.client; +package org.springframework.tests.web; import java.io.IOException; import java.net.InetSocketAddress; diff --git a/spring-web/src/test/java/org/springframework/util/SerializationTestUtils.java b/spring-web/src/test/java/org/springframework/util/SerializationTestUtils.java deleted file mode 100644 index dbe6421093e..00000000000 --- a/spring-web/src/test/java/org/springframework/util/SerializationTestUtils.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The Spring Framework is published under the terms - * of the Apache Software License. - */ - -package org.springframework.util; - -import java.awt.Point; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; - -import junit.framework.TestCase; - -import org.springframework.beans.TestBean; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * Extends TestCase only to test itself. - * - * @author Rod Johnson - */ -public class SerializationTestUtils extends TestCase { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - - return o2; - } - - public SerializationTestUtils(String s) { - super(s); - } - - public void testWithNonSerializableObject() throws IOException { - TestBean o = new TestBean(); - assertFalse(o instanceof Serializable); - - assertFalse(isSerializable(o)); - - try { - testSerialization(o); - fail(); - } - catch (NotSerializableException ex) { - // Ok - } - } - - public void testWithSerializableObject() throws Exception { - int x = 5; - int y = 10; - Point p = new Point(x, y); - assertTrue(p instanceof Serializable); - - testSerialization(p); - - assertTrue(isSerializable(p)); - - Point p2 = (Point) serializeAndDeserialize(p); - assertNotSame(p, p2); - assertEquals(x, (int) p2.getX()); - assertEquals(y, (int) p2.getY()); - } - -} \ No newline at end of file diff --git a/spring-web/src/test/java/org/springframework/web/bind/EscapedErrorsTests.java b/spring-web/src/test/java/org/springframework/web/bind/EscapedErrorsTests.java index 9f6a1df756f..25d63e8b3a9 100644 --- a/spring-web/src/test/java/org/springframework/web/bind/EscapedErrorsTests.java +++ b/spring-web/src/test/java/org/springframework/web/bind/EscapedErrorsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.web.bind; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.validation.BindException; import org.springframework.validation.Errors; import org.springframework.validation.FieldError; diff --git a/spring-web/src/test/java/org/springframework/web/bind/ServletRequestDataBinderTests.java b/spring-web/src/test/java/org/springframework/web/bind/ServletRequestDataBinderTests.java index a34e3749b95..34340bd3e16 100644 --- a/spring-web/src/test/java/org/springframework/web/bind/ServletRequestDataBinderTests.java +++ b/spring-web/src/test/java/org/springframework/web/bind/ServletRequestDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -24,10 +24,10 @@ import java.util.HashMap; import java.util.Map; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; /** @@ -44,6 +44,7 @@ public class ServletRequestDataBinderTests { ServletRequestDataBinder binder = new ServletRequestDataBinder(tb, "person"); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean()); } @@ -168,6 +169,7 @@ public class ServletRequestDataBinderTests { ServletRequestDataBinder binder = new ServletRequestDataBinder(tb, "person"); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean()); } diff --git a/spring-web/src/test/java/org/springframework/web/bind/ServletRequestUtilsTests.java b/spring-web/src/test/java/org/springframework/web/bind/ServletRequestUtilsTests.java index 51e2f501d80..ada52ec33c2 100644 --- a/spring-web/src/test/java/org/springframework/web/bind/ServletRequestUtilsTests.java +++ b/spring-web/src/test/java/org/springframework/web/bind/ServletRequestUtilsTests.java @@ -20,6 +20,8 @@ import static org.junit.Assert.*; import org.junit.Test; import org.springframework.mock.web.test.MockHttpServletRequest; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.util.StopWatch; /** @@ -399,6 +401,7 @@ public class ServletRequestUtilsTests { @Test public void testGetLongParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockHttpServletRequest request = new MockHttpServletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -412,6 +415,7 @@ public class ServletRequestUtilsTests { @Test public void testGetFloatParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockHttpServletRequest request = new MockHttpServletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -425,6 +429,7 @@ public class ServletRequestUtilsTests { @Test public void testGetDoubleParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockHttpServletRequest request = new MockHttpServletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -438,6 +443,7 @@ public class ServletRequestUtilsTests { @Test public void testGetBooleanParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockHttpServletRequest request = new MockHttpServletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -451,6 +457,7 @@ public class ServletRequestUtilsTests { @Test public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockHttpServletRequest request = new MockHttpServletRequest(); StopWatch sw = new StopWatch(); sw.start(); diff --git a/spring-web/src/test/java/org/springframework/web/bind/support/WebRequestDataBinderTests.java b/spring-web/src/test/java/org/springframework/web/bind/support/WebRequestDataBinderTests.java index 49be202f580..b3e347fd5fb 100644 --- a/spring-web/src/test/java/org/springframework/web/bind/support/WebRequestDataBinderTests.java +++ b/spring-web/src/test/java/org/springframework/web/bind/support/WebRequestDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -24,10 +24,10 @@ import java.util.Map; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockMultipartFile; import org.springframework.mock.web.test.MockMultipartHttpServletRequest; @@ -46,6 +46,7 @@ public class WebRequestDataBinderTests { WebRequestDataBinder binder = new WebRequestDataBinder(tb, "person"); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean()); } @@ -62,7 +63,7 @@ public class WebRequestDataBinderTests { @Test public void testBindingWithNestedObjectCreationThroughAutoGrow() throws Exception { - TestBean tb = new TestBean(); + TestBean tb = new TestBeanWithConcreteSpouse(); WebRequestDataBinder binder = new WebRequestDataBinder(tb, "person"); binder.setIgnoreUnknownFields(false); @@ -304,21 +305,30 @@ public class WebRequestDataBinderTests { public static class EnumHolder { - private MyEnum myEnum; + private MyEnum myEnum; - public MyEnum getMyEnum() { - return myEnum; - } + public MyEnum getMyEnum() { + return myEnum; + } - public void setMyEnum(MyEnum myEnum) { - this.myEnum = myEnum; - } - } + public void setMyEnum(MyEnum myEnum) { + this.myEnum = myEnum; + } + } + public enum MyEnum { + FOO, BAR + } - public enum MyEnum { + static class TestBeanWithConcreteSpouse extends TestBean { + public void setConcreteSpouse(TestBean spouse) { + this.spouses = new ITestBean[] {spouse}; + } + + public TestBean getConcreteSpouse() { + return (spouses != null ? (TestBean) spouses[0] : null); + } + } - FOO, BAR - } } diff --git a/spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java b/spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java index 8c8686df691..ea09d9a3ddf 100644 --- a/spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java +++ b/spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -62,8 +62,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.http.client.FreePortScanner; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.tests.web.FreePortScanner; import org.springframework.util.FileCopyUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/spring-web/src/test/java/org/springframework/web/context/request/RequestAndSessionScopedBeanTests.java b/spring-web/src/test/java/org/springframework/web/context/request/RequestAndSessionScopedBeanTests.java index 5c18203da6b..a4b7d6018ac 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/RequestAndSessionScopedBeanTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/RequestAndSessionScopedBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.mock.web.test.MockHttpServletRequest; diff --git a/spring-web/src/test/java/org/springframework/web/context/request/RequestContextListenerTests.java b/spring-web/src/test/java/org/springframework/web/context/request/RequestContextListenerTests.java index 55a115e2d42..6d9d28e0a7d 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/RequestContextListenerTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/RequestContextListenerTests.java @@ -87,6 +87,7 @@ public class RequestContextListenerTests extends TestCase { // Execute requestDestroyed callback in different thread. Thread thread = new Thread() { + @Override public void run() { listener.requestDestroyed(new ServletRequestEvent(context, request)); } diff --git a/spring-web/src/test/java/org/springframework/web/context/request/RequestScopeTests.java b/spring-web/src/test/java/org/springframework/web/context/request/RequestScopeTests.java index 80a3a1b80c8..6f88b6a9482 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/RequestScopeTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/RequestScopeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -18,8 +18,8 @@ package org.springframework.web.context.request; import junit.framework.TestCase; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCurrentlyInCreationException; import org.springframework.beans.factory.FactoryBean; @@ -38,6 +38,7 @@ public class RequestScopeTests extends TestCase { private DefaultListableBeanFactory beanFactory; + @Override protected void setUp() throws Exception { this.beanFactory = new DefaultListableBeanFactory(); this.beanFactory.registerScope("request", new RequestScope()); diff --git a/spring-web/src/test/java/org/springframework/web/context/request/RequestScopedProxyTests.java b/spring-web/src/test/java/org/springframework/web/context/request/RequestScopedProxyTests.java index 250e50c75c0..4a5703f34a0 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/RequestScopedProxyTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/RequestScopedProxyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,10 +21,10 @@ import org.junit.Before; import org.junit.Test; import org.springframework.aop.support.AopUtils; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.DummyFactory; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; +import org.springframework.tests.sample.beans.factory.DummyFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.support.DefaultListableBeanFactory; diff --git a/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java b/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java index cb45ad363a1..4e540a7d202 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,8 +21,8 @@ import java.io.Serializable; import junit.framework.TestCase; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor; import org.springframework.beans.factory.support.DefaultListableBeanFactory; @@ -40,6 +40,7 @@ public class SessionScopeTests extends TestCase { private DefaultListableBeanFactory beanFactory; + @Override protected void setUp() throws Exception { this.beanFactory = new DefaultListableBeanFactory(); this.beanFactory.registerScope("session", new SessionScope()); @@ -162,14 +163,17 @@ public class SessionScopeTests extends TestCase { private static class CustomDestructionAwareBeanPostProcessor implements DestructionAwareBeanPostProcessor { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { } } @@ -179,14 +183,17 @@ public class SessionScopeTests extends TestCase { private static class CustomSerializableDestructionAwareBeanPostProcessor implements DestructionAwareBeanPostProcessor, Serializable { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { if (bean instanceof BeanNameAware) { ((BeanNameAware) bean).setBeanName(null); diff --git a/spring-web/src/test/java/org/springframework/web/context/request/WebApplicationContextScopeTests.java b/spring-web/src/test/java/org/springframework/web/context/request/WebApplicationContextScopeTests.java index 53e2e0a4583..5c2ef5823c0 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/WebApplicationContextScopeTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/WebApplicationContextScopeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import javax.servlet.ServletContextEvent; import static org.junit.Assert.*; import org.junit.Test; -import org.springframework.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockServletContext; diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/DeferredResultTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/DeferredResultTests.java index bcb780ae9a3..2590481d3d3 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/DeferredResultTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/DeferredResultTests.java @@ -86,6 +86,7 @@ public class DeferredResultTests { DeferredResult result = new DeferredResult(); result.onCompletion(new Runnable() { + @Override public void run() { sb.append("completion event"); } @@ -108,6 +109,7 @@ public class DeferredResultTests { DeferredResult result = new DeferredResult(null, "timeout result"); result.setResultHandler(handler); result.onTimeout(new Runnable() { + @Override public void run() { sb.append("timeout event"); } diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java index 50df5a3a35d..506201f5ba5 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java @@ -432,6 +432,7 @@ public class WebAsyncManagerTests { this.value = value; } + @Override public Object call() throws Exception { if (this.value instanceof Exception) { throw ((Exception) this.value); diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTimeoutTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTimeoutTests.java index 6ffbec1d7a3..936be8d79aa 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTimeoutTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTimeoutTests.java @@ -104,6 +104,7 @@ public class WebAsyncManagerTimeoutTests { StubCallable callable = new StubCallable(); WebAsyncTask webAsyncTask = new WebAsyncTask(callable); webAsyncTask.onTimeout(new Callable() { + @Override public Object call() throws Exception { return 7; } @@ -207,6 +208,7 @@ public class WebAsyncManagerTimeoutTests { final DeferredResult deferredResult = new DeferredResult(); deferredResult.onTimeout(new Runnable() { + @Override public void run() { deferredResult.setResult(23); } @@ -228,6 +230,7 @@ public class WebAsyncManagerTimeoutTests { DeferredResult deferredResult = new DeferredResult(); DeferredResultProcessingInterceptor interceptor = new DeferredResultProcessingInterceptorAdapter() { + @Override public boolean handleTimeout(NativeWebRequest request, DeferredResult result) throws Exception { result.setErrorResult(23); return true; @@ -252,6 +255,7 @@ public class WebAsyncManagerTimeoutTests { final Exception exception = new Exception(); DeferredResultProcessingInterceptor interceptor = new DeferredResultProcessingInterceptorAdapter() { + @Override public boolean handleTimeout(NativeWebRequest request, DeferredResult result) throws Exception { throw exception; } @@ -270,6 +274,7 @@ public class WebAsyncManagerTimeoutTests { private final class StubCallable implements Callable { + @Override public Object call() throws Exception { return 21; } diff --git a/spring-web/src/test/java/org/springframework/web/context/support/SpringBeanAutowiringSupportTests.java b/spring-web/src/test/java/org/springframework/web/context/support/SpringBeanAutowiringSupportTests.java index 1d383013423..8412e2b667c 100644 --- a/spring-web/src/test/java/org/springframework/web/context/support/SpringBeanAutowiringSupportTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/support/SpringBeanAutowiringSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -18,9 +18,9 @@ package org.springframework.web.context.support; import org.junit.Test; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.mock.web.test.MockServletContext; diff --git a/spring-web/src/test/java/org/springframework/web/filter/CompositeFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/CompositeFilterTests.java index 4f7d5451d3e..200546dd020 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/CompositeFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/CompositeFilterTests.java @@ -1,6 +1,6 @@ /* * Copyright 2004, 2005 Acegi Technology Pty Limited - * Copyright 2006-2012 the original author or authors. + * Copyright 2002-2012 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,14 +71,17 @@ public class CompositeFilterTests { public FilterConfig filterConfig; + @Override public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { request.setAttribute("called", Boolean.TRUE); } + @Override public void destroy() { this.filterConfig = null; } diff --git a/spring-web/src/test/java/org/springframework/web/filter/DelegatingFilterProxyTests.java b/spring-web/src/test/java/org/springframework/web/filter/DelegatingFilterProxyTests.java index 0d54f55d485..5af02f2cbe3 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/DelegatingFilterProxyTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/DelegatingFilterProxyTests.java @@ -1,6 +1,6 @@ /* * Copyright 2004, 2005 Acegi Technology Pty Limited - * Copyright 2006-2012 the original author or authors. + * Copyright 2002-2012 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. @@ -272,14 +272,17 @@ public class DelegatingFilterProxyTests { public FilterConfig filterConfig; + @Override public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { request.setAttribute("called", Boolean.TRUE); } + @Override public void destroy() { this.filterConfig = null; } diff --git a/spring-web/src/test/java/org/springframework/web/filter/HiddenHttpMethodFilterTest.java b/spring-web/src/test/java/org/springframework/web/filter/HiddenHttpMethodFilterTest.java index 13f74da0aa1..2793790da6d 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/HiddenHttpMethodFilterTest.java +++ b/spring-web/src/test/java/org/springframework/web/filter/HiddenHttpMethodFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright ${YEAR} the original author or authors. + * Copyright 2002-2012 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. @@ -48,6 +48,7 @@ public class HiddenHttpMethodFilterTest { FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { assertEquals("Invalid method", "DELETE", ((HttpServletRequest) filterRequest).getMethod()); @@ -63,6 +64,7 @@ public class HiddenHttpMethodFilterTest { FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { assertEquals("Invalid method", "POST", ((HttpServletRequest) filterRequest).getMethod()); diff --git a/spring-web/src/test/java/org/springframework/web/filter/RequestContextFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/RequestContextFilterTests.java index 5eed6a55ac7..d8c4128bf44 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/RequestContextFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/RequestContextFilterTests.java @@ -54,6 +54,7 @@ public class RequestContextFilterTests extends TestCase { // Expect one invocation by the filter being tested class DummyFilterChain implements FilterChain { public int invocations = 0; + @Override public void doFilter(ServletRequest req, ServletResponse resp) throws IOException, ServletException { ++invocations; if (invocations == 1) { diff --git a/spring-web/src/test/java/org/springframework/web/filter/RequestLoggingFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/RequestLoggingFilterTests.java index a05f09a2fab..15ab9998a41 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/RequestLoggingFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/RequestLoggingFilterTests.java @@ -97,6 +97,7 @@ public class RequestLoggingFilterTests { request.setContent(requestBody); FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { ((HttpServletResponse) filterResponse).setStatus(HttpServletResponse.SC_OK); @@ -122,6 +123,7 @@ public class RequestLoggingFilterTests { request.setContent(requestBody.getBytes("UTF-8")); FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { ((HttpServletResponse) filterResponse).setStatus(HttpServletResponse.SC_OK); @@ -148,6 +150,7 @@ public class RequestLoggingFilterTests { request.setContent(requestBody); FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { ((HttpServletResponse) filterResponse).setStatus(HttpServletResponse.SC_OK); @@ -182,6 +185,7 @@ public class RequestLoggingFilterTests { private static class NoopFilterChain implements FilterChain { + @Override public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { } } diff --git a/spring-web/src/test/java/org/springframework/web/filter/ShallowEtagHeaderFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/ShallowEtagHeaderFilterTests.java index f5fdf084994..8ff31eb224a 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/ShallowEtagHeaderFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/ShallowEtagHeaderFilterTests.java @@ -58,6 +58,7 @@ public class ShallowEtagHeaderFilterTests { final byte[] responseBody = "Hello World".getBytes("UTF-8"); FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { assertEquals("Invalid request passed", request, filterRequest); @@ -83,6 +84,7 @@ public class ShallowEtagHeaderFilterTests { FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { assertEquals("Invalid request passed", request, filterRequest); @@ -109,6 +111,7 @@ public class ShallowEtagHeaderFilterTests { FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest filterRequest, ServletResponse filterResponse) throws IOException, ServletException { assertEquals("Invalid request passed", request, filterRequest); diff --git a/spring-web/src/test/java/org/springframework/web/jsf/DelegatingPhaseListenerTests.java b/spring-web/src/test/java/org/springframework/web/jsf/DelegatingPhaseListenerTests.java index e106045cf92..d74bf8a6ae9 100644 --- a/spring-web/src/test/java/org/springframework/web/jsf/DelegatingPhaseListenerTests.java +++ b/spring-web/src/test/java/org/springframework/web/jsf/DelegatingPhaseListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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,12 +36,14 @@ public class DelegatingPhaseListenerTests extends TestCase { private StaticListableBeanFactory beanFactory; private DelegatingPhaseListenerMulticaster delPhaseListener; + @Override @SuppressWarnings("serial") protected void setUp() { facesContext = new MockFacesContext(); beanFactory = new StaticListableBeanFactory(); delPhaseListener = new DelegatingPhaseListenerMulticaster() { + @Override protected ListableBeanFactory getBeanFactory(FacesContext facesContext) { return beanFactory; } @@ -87,14 +89,17 @@ public class DelegatingPhaseListenerTests extends TestCase { boolean beforeCalled = false; boolean afterCalled = false; + @Override public PhaseId getPhaseId() { return PhaseId.ANY_PHASE; } + @Override public void beforePhase(PhaseEvent arg0) { beforeCalled = true; } + @Override public void afterPhase(PhaseEvent arg0) { afterCalled = true; } diff --git a/spring-web/src/test/java/org/springframework/web/jsf/DelegatingVariableResolverTests.java b/spring-web/src/test/java/org/springframework/web/jsf/DelegatingVariableResolverTests.java index 76e8c829b14..053a53150ac 100644 --- a/spring-web/src/test/java/org/springframework/web/jsf/DelegatingVariableResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/jsf/DelegatingVariableResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import javax.faces.el.VariableResolver; import junit.framework.TestCase; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.StaticWebApplicationContext; @@ -30,6 +30,7 @@ import org.springframework.web.context.support.StaticWebApplicationContext; * @author Juergen Hoeller * @since 02.08.2004 */ +@Deprecated public class DelegatingVariableResolverTests extends TestCase { public void testDelegatingVariableResolver() { @@ -42,6 +43,7 @@ public class DelegatingVariableResolverTests extends TestCase { // We need to override the getWebApplicationContext method here: // FacesContext and ExternalContext are hard to mock. DelegatingVariableResolver resolver = new DelegatingVariableResolver(new OriginalVariableResolver()) { + @Override protected WebApplicationContext getWebApplicationContext(FacesContext facesContext) { return wac; } @@ -61,6 +63,7 @@ public class DelegatingVariableResolverTests extends TestCase { // We need to override the getWebApplicationContext method here: // FacesContext and ExternalContext are hard to mock. SpringBeanVariableResolver resolver = new SpringBeanVariableResolver(new OriginalVariableResolver()) { + @Override protected WebApplicationContext getWebApplicationContext(FacesContext facesContext) { return wac; } @@ -72,6 +75,7 @@ public class DelegatingVariableResolverTests extends TestCase { private static class OriginalVariableResolver extends VariableResolver { + @Override public Object resolveVariable(FacesContext facesContext, String name) throws EvaluationException { if ("var1".equals(name)) { return "val1"; diff --git a/spring-web/src/test/java/org/springframework/web/jsf/MockFacesContext.java b/spring-web/src/test/java/org/springframework/web/jsf/MockFacesContext.java index 1e6c9d3f9ff..485f1a757ef 100644 --- a/spring-web/src/test/java/org/springframework/web/jsf/MockFacesContext.java +++ b/spring-web/src/test/java/org/springframework/web/jsf/MockFacesContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -44,6 +44,7 @@ public class MockFacesContext extends FacesContext { private UIViewRoot viewRoot; + @Override public Application getApplication() { return application; } @@ -52,10 +53,12 @@ public class MockFacesContext extends FacesContext { this.application = application; } + @Override public Iterator getClientIdsWithMessages() { return null; } + @Override public ExternalContext getExternalContext() { return externalContext; } @@ -64,61 +67,77 @@ public class MockFacesContext extends FacesContext { this.externalContext = externalContext; } + @Override public Severity getMaximumSeverity() { return null; } + @Override public Iterator getMessages() { return null; } + @Override public Iterator getMessages(String arg0) { return null; } + @Override public RenderKit getRenderKit() { return null; } + @Override public boolean getRenderResponse() { return false; } + @Override public boolean getResponseComplete() { return false; } + @Override public ResponseStream getResponseStream() { return null; } + @Override public void setResponseStream(ResponseStream arg0) { } + @Override public ResponseWriter getResponseWriter() { return null; } + @Override public void setResponseWriter(ResponseWriter arg0) { } + @Override public UIViewRoot getViewRoot() { return viewRoot; } + @Override public void setViewRoot(UIViewRoot viewRoot) { this.viewRoot = viewRoot; } + @Override public void addMessage(String arg0, FacesMessage arg1) { } + @Override public void release() { } + @Override public void renderResponse() { } + @Override public void responseComplete() { } diff --git a/spring-web/src/test/java/org/springframework/web/jsf/MockLifecycle.java b/spring-web/src/test/java/org/springframework/web/jsf/MockLifecycle.java index 5cda13aead9..a9e9b97e482 100644 --- a/spring-web/src/test/java/org/springframework/web/jsf/MockLifecycle.java +++ b/spring-web/src/test/java/org/springframework/web/jsf/MockLifecycle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -27,19 +27,24 @@ import javax.faces.lifecycle.Lifecycle; */ public class MockLifecycle extends Lifecycle { + @Override public void addPhaseListener(PhaseListener phaseListener) { } + @Override public void execute(FacesContext facesContext) throws FacesException { } + @Override public PhaseListener[] getPhaseListeners() { return null; } + @Override public void removePhaseListener(PhaseListener phaseListener) { } + @Override public void render(FacesContext facesContext) throws FacesException { } diff --git a/spring-web/src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java b/spring-web/src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java index 4ac6a733487..ba216f20bf8 100644 --- a/spring-web/src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java b/spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java index 573b1c54b30..170e8e2c9b8 100644 --- a/spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import java.lang.reflect.Method; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.MethodParameter; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.validation.BindException; @@ -265,14 +265,17 @@ public class ModelAttributeMethodProcessorTests { return validateInvoked; } + @Override public void bind(WebRequest request) { bindInvoked = true; } + @Override public void validate() { validateInvoked = true; } + @Override public void validate(Object... validationHints) { validateInvoked = true; } diff --git a/spring-web/src/test/java/org/springframework/web/method/annotation/SessionAttributesHandlerTests.java b/spring-web/src/test/java/org/springframework/web/method/annotation/SessionAttributesHandlerTests.java index a9699262e48..1da19343914 100644 --- a/spring-web/src/test/java/org/springframework/web/method/annotation/SessionAttributesHandlerTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/annotation/SessionAttributesHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import java.util.HashSet; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.SessionAttributes; diff --git a/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java b/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java index 4b700225e8e..f93d915ecab 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java b/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java index 9acab34ec60..2fcd856e62d 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java b/spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java index 9eb740031e4..d4e681abe38 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/InvocableHandlerMethodTests.java @@ -226,10 +226,12 @@ public class InvocableHandlerMethodTests { private static class ExceptionRaisingArgumentResolver implements HandlerMethodArgumentResolver { + @Override public boolean supportsParameter(MethodParameter parameter) { return true; } + @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { throw new HttpMessageNotReadableException("oops, can't read"); diff --git a/spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java b/spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java index bd0c80565c3..3e09c5e523f 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/ModelAndViewContainerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/web/method/support/StubArgumentResolver.java b/spring-web/src/test/java/org/springframework/web/method/support/StubArgumentResolver.java index 45c84b353b2..2110548d81a 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/StubArgumentResolver.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/StubArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -46,10 +46,12 @@ public class StubArgumentResolver implements HandlerMethodArgumentResolver { return resolvedParameters; } + @Override public boolean supportsParameter(MethodParameter parameter) { return parameter.getParameterType().equals(this.parameterType); } + @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { this.resolvedParameters.add(parameter); diff --git a/spring-web/src/test/java/org/springframework/web/method/support/StubReturnValueHandler.java b/spring-web/src/test/java/org/springframework/web/method/support/StubReturnValueHandler.java index 7f888093543..ca63af02366 100644 --- a/spring-web/src/test/java/org/springframework/web/method/support/StubReturnValueHandler.java +++ b/spring-web/src/test/java/org/springframework/web/method/support/StubReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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,10 +38,12 @@ public class StubReturnValueHandler implements HandlerMethodReturnValueHandler { return this.returnValue; } + @Override public boolean supportsReturnType(MethodParameter returnType) { return returnType.getParameterType().equals(this.returnType); } + @Override public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception { this.returnValue = returnValue; diff --git a/spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java b/spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java index ae2f318b4ce..29df40fbf33 100644 --- a/spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java @@ -16,6 +16,10 @@ package org.springframework.web.multipart.commons; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; @@ -30,6 +34,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; + import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; @@ -41,9 +46,7 @@ import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.FileUpload; import org.apache.commons.fileupload.servlet.ServletFileUpload; -import static org.junit.Assert.*; import org.junit.Test; - import org.springframework.beans.MutablePropertyValues; import org.springframework.mock.web.test.MockFilterConfig; import org.springframework.mock.web.test.MockHttpServletRequest; @@ -220,7 +223,7 @@ public class CommonsMultipartResolverTests { MultipartHttpServletRequest request) throws UnsupportedEncodingException { MultipartTestBean1 mtb1 = new MultipartTestBean1(); - assertEquals(null, mtb1.getField1()); + assertArrayEquals(null, mtb1.getField1()); assertEquals(null, mtb1.getField2()); ServletRequestDataBinder binder = new ServletRequestDataBinder(mtb1, "mybean"); binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor()); @@ -234,7 +237,7 @@ public class CommonsMultipartResolverTests { assertEquals(new String(file2.getBytes()), new String(mtb1.getField2())); MultipartTestBean2 mtb2 = new MultipartTestBean2(); - assertEquals(null, mtb2.getField1()); + assertArrayEquals(null, mtb2.getField1()); assertEquals(null, mtb2.getField2()); binder = new ServletRequestDataBinder(mtb2, "mybean"); binder.registerCustomEditor(String.class, "field1", new StringMultipartFileEditor()); @@ -282,6 +285,7 @@ public class CommonsMultipartResolverTests { final List files = new ArrayList(); final FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse) { MultipartHttpServletRequest request = (MultipartHttpServletRequest) servletRequest; files.addAll(request.getFileMap().values()); @@ -319,6 +323,7 @@ public class CommonsMultipartResolverTests { final List files = new ArrayList(); FilterChain filterChain = new FilterChain() { + @Override public void doFilter(ServletRequest originalRequest, ServletResponse response) { if (originalRequest instanceof MultipartHttpServletRequest) { MultipartHttpServletRequest request = (MultipartHttpServletRequest) originalRequest; @@ -415,38 +420,47 @@ public class CommonsMultipartResolverTests { this.value = value; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(value.getBytes()); } + @Override public String getContentType() { return contentType; } + @Override public String getName() { return name; } + @Override public boolean isInMemory() { return true; } + @Override public long getSize() { return value.length(); } + @Override public byte[] get() { return value.getBytes(); } + @Override public String getString(String encoding) throws UnsupportedEncodingException { return new String(get(), encoding); } + @Override public String getString() { return value; } + @Override public void write(File file) throws Exception { this.writtenFile = file; } @@ -455,6 +469,7 @@ public class CommonsMultipartResolverTests { return writtenFile; } + @Override public void delete() { this.deleted = true; } @@ -463,22 +478,27 @@ public class CommonsMultipartResolverTests { return deleted; } + @Override public String getFieldName() { return fieldName; } + @Override public void setFieldName(String s) { this.fieldName = s; } + @Override public boolean isFormField() { return (this.name == null); } + @Override public void setFormField(boolean b) { throw new UnsupportedOperationException(); } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException(); } diff --git a/spring-web/src/test/java/org/springframework/web/util/ExpressionEvaluationUtilsTests.java b/spring-web/src/test/java/org/springframework/web/util/ExpressionEvaluationUtilsTests.java index 72f1019cdc3..8da5c1adb3a 100644 --- a/spring-web/src/test/java/org/springframework/web/util/ExpressionEvaluationUtilsTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/ExpressionEvaluationUtilsTests.java @@ -38,6 +38,7 @@ import static org.junit.Assert.*; * @author Juergen Hoeller * @since 16.09.2003 */ +@Deprecated public class ExpressionEvaluationUtilsTests { @Test @@ -270,6 +271,7 @@ public class ExpressionEvaluationUtilsTests { private ExpressionEvaluator eval = new CountingMockExpressionEvaluator(this); + @Override public ExpressionEvaluator getExpressionEvaluator() { return eval; } @@ -286,11 +288,13 @@ public class ExpressionEvaluationUtilsTests { super(pageContext); } + @Override public Expression parseExpression(String expression, Class expectedType, FunctionMapper functionMapper) throws ELException { this.parseExpressionCount++; return super.parseExpression(expression, expectedType, functionMapper); } + @Override public Object evaluate(String expression, Class expectedType, VariableResolver variableResolver, FunctionMapper functionMapper) throws ELException { this.evaluateCount++; return super.evaluate(expression, expectedType, variableResolver, functionMapper); diff --git a/spring-web/src/test/java/org/springframework/web/util/MockLog4jAppender.java b/spring-web/src/test/java/org/springframework/web/util/MockLog4jAppender.java index bb078da54c4..1baf35219cd 100644 --- a/spring-web/src/test/java/org/springframework/web/util/MockLog4jAppender.java +++ b/spring-web/src/test/java/org/springframework/web/util/MockLog4jAppender.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ public class MockLog4jAppender extends AppenderSkeleton { /* (non-Javadoc) * @see org.apache.log4j.AppenderSkeleton#append(org.apache.log4j.spi.LoggingEvent) */ + @Override protected void append(LoggingEvent evt) { //System.out.println("Adding " + evt.getMessage()); loggingStrings.add(evt.getMessage()); @@ -42,6 +43,7 @@ public class MockLog4jAppender extends AppenderSkeleton { /* (non-Javadoc) * @see org.apache.log4j.Appender#close() */ + @Override public void close() { closeCalled = true; } @@ -49,6 +51,7 @@ public class MockLog4jAppender extends AppenderSkeleton { /* (non-Javadoc) * @see org.apache.log4j.Appender#requiresLayout() */ + @Override public boolean requiresLayout() { return false; } diff --git a/spring-web/src/test/java/org/springframework/web/util/TagUtilsTests.java b/spring-web/src/test/java/org/springframework/web/util/TagUtilsTests.java index 3803551a63e..9fb45c609a5 100644 --- a/spring-web/src/test/java/org/springframework/web/util/TagUtilsTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/TagUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-web/src/test/java/org/springframework/web/util/UriUtilsTests.java b/spring-web/src/test/java/org/springframework/web/util/UriUtilsTests.java index 0439504c8c5..f3ffc519c17 100644 --- a/spring-web/src/test/java/org/springframework/web/util/UriUtilsTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/UriUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -106,6 +106,7 @@ public class UriUtilsTests { } @Test + @Deprecated public void encodeUri() throws UnsupportedEncodingException { assertEquals("Invalid encoded URI", "http://www.ietf.org/rfc/rfc3986.txt", UriUtils.encodeUri("http://www.ietf.org/rfc/rfc3986.txt", ENC)); @@ -134,6 +135,7 @@ public class UriUtilsTests { } @Test + @Deprecated public void encodeHttpUrl() throws UnsupportedEncodingException { assertEquals("Invalid encoded HTTP URL", "http://www.ietf.org/rfc/rfc3986.txt", UriUtils.encodeHttpUrl("http://www.ietf.org/rfc/rfc3986.txt", ENC)); @@ -156,6 +158,7 @@ public class UriUtilsTests { } @Test(expected = IllegalArgumentException.class) + @Deprecated public void encodeHttpUrlMail() throws UnsupportedEncodingException { UriUtils.encodeHttpUrl("mailto:java-net@java.sun.com", ENC); } diff --git a/spring-web/src/test/resources/org/springframework/web/context/request/requestScopeTests.xml b/spring-web/src/test/resources/org/springframework/web/context/request/requestScopeTests.xml index f2d06c527f4..3ed39dfd7aa 100644 --- a/spring-web/src/test/resources/org/springframework/web/context/request/requestScopeTests.xml +++ b/spring-web/src/test/resources/org/springframework/web/context/request/requestScopeTests.xml @@ -4,35 +4,35 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> - + - + - + - + - + - + - + - + - + diff --git a/spring-web/src/test/resources/org/springframework/web/context/request/requestScopedProxyTests.xml b/spring-web/src/test/resources/org/springframework/web/context/request/requestScopedProxyTests.xml index ee1313d4dc1..92759852b5b 100644 --- a/spring-web/src/test/resources/org/springframework/web/context/request/requestScopedProxyTests.xml +++ b/spring-web/src/test/resources/org/springframework/web/context/request/requestScopedProxyTests.xml @@ -5,47 +5,47 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - + - + - + - + - + - + - + - + - + - + diff --git a/spring-web/src/test/resources/org/springframework/web/context/request/sessionScopeTests.xml b/spring-web/src/test/resources/org/springframework/web/context/request/sessionScopeTests.xml index e4f05b9abe5..e92f639f8ca 100644 --- a/spring-web/src/test/resources/org/springframework/web/context/request/sessionScopeTests.xml +++ b/spring-web/src/test/resources/org/springframework/web/context/request/sessionScopeTests.xml @@ -3,8 +3,8 @@ - + - + diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/GenericPortletBean.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/GenericPortletBean.java index a7763c7a350..13b981b9415 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/GenericPortletBean.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/GenericPortletBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerAdapter.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerAdapter.java index e1aa117b1c7..9785904d11f 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerAdapter.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExceptionResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExceptionResolver.java index b3a1a4ecc1f..c43b8892156 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExceptionResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExecutionChain.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExecutionChain.java index 74e7157d455..80c64e29545 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExecutionChain.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerExecutionChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerInterceptor.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerInterceptor.java index ee051a334ea..d741971ca52 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerInterceptor.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerMapping.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerMapping.java index e41af64b5cd..388d0ec21d9 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerMapping.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/HandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndView.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndView.java index 74478d33761..fb6f8521b40 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndView.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndViewDefiningException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndViewDefiningException.java index 0893d4be7f9..5ff78ab1e59 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndViewDefiningException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/ModelAndViewDefiningException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/NoHandlerFoundException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/NoHandlerFoundException.java index 64fefc1f733..758794d754d 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/NoHandlerFoundException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/NoHandlerFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/MissingPortletRequestParameterException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/MissingPortletRequestParameterException.java index 693c33643b6..630f2e89b7e 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/MissingPortletRequestParameterException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/MissingPortletRequestParameterException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestBindingException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestBindingException.java index 3ac235dcaf2..69cc5ff3d32 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestBindingException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestBindingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestDataBinder.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestDataBinder.java index 776731753d6..88a495abf50 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestDataBinder.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestDataBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValues.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValues.java index 32420d02e41..358fc9370e4 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValues.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestUtils.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestUtils.java index 269b7ce0459..43eef92bef1 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestUtils.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/annotation/ActionMapping.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/annotation/ActionMapping.java index f8dbdbdc3e7..12c490b7775 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/annotation/ActionMapping.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/annotation/ActionMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/ConfigurablePortletApplicationContext.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/ConfigurablePortletApplicationContext.java index bd56e6bda26..a6572e537fb 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/ConfigurablePortletApplicationContext.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/ConfigurablePortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationObjectSupport.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationObjectSupport.java index 2f074204e9e..0007c187e41 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationObjectSupport.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletApplicationObjectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletConfigAware.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletConfigAware.java index 7e64034a49c..d3fcbb4ce36 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletConfigAware.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletConfigAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAware.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAware.java index 5b0b1e40aef..b11a4707e45 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAware.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAwareProcessor.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAwareProcessor.java index 07e60b45ad8..b9df018158f 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAwareProcessor.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextAwareProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextResourcePatternResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextResourcePatternResolver.java index 100b3fb0a76..dd2bb549092 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextResourcePatternResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextResourcePatternResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextScope.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextScope.java index 6564db90d13..5dd52cfd49f 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextScope.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletContextScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestAttributes.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestAttributes.java index e0a6eb783df..6a7e1c83db5 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestAttributes.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestHandledEvent.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestHandledEvent.java index 4d3c6e5277a..cf52db05c3d 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestHandledEvent.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletRequestHandledEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletWebRequest.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletWebRequest.java index e1dfa25f9a2..fe6348dd6d0 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletWebRequest.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/PortletWebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/StaticPortletApplicationContext.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/StaticPortletApplicationContext.java index ce44602bb6d..d1c1b2ad2a3 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/StaticPortletApplicationContext.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/context/StaticPortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/AbstractHandlerExceptionResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/AbstractHandlerExceptionResolver.java index db031e1717a..64365dfa480 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/AbstractHandlerExceptionResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/AbstractHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/HandlerInterceptorAdapter.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/HandlerInterceptorAdapter.java index e5ae5a0095d..9c3bff5f2a1 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/HandlerInterceptorAdapter.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/HandlerInterceptorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterHandlerMapping.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterHandlerMapping.java index 235a25f8fbf..ae24f492088 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterHandlerMapping.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterMappingInterceptor.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterMappingInterceptor.java index 5d9f1c4b151..dc7166db01a 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterMappingInterceptor.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/ParameterMappingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletContentGenerator.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletContentGenerator.java index b23756f87c4..4ac0d32e417 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletContentGenerator.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletContentGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeHandlerMapping.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeHandlerMapping.java index 9c9391c4989..2957d73aed6 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeHandlerMapping.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMapping.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMapping.java index 5b2f7745d0c..e53dcb0b6dd 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMapping.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletRequestMethodNotSupportedException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletRequestMethodNotSupportedException.java index 53ead92e54f..7037f831263 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletRequestMethodNotSupportedException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletRequestMethodNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletSessionRequiredException.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletSessionRequiredException.java index 7c4b8687e3a..0911834e612 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletSessionRequiredException.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/PortletSessionRequiredException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolver.java index 2be0716c961..5025a024e0e 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletHandlerAdapter.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletHandlerAdapter.java index f727716bb37..5ef81bb0aea 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletHandlerAdapter.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletHandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java index bdab9c3380a..c9cde4b1b01 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/WebRequestHandlerInterceptorAdapter.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/WebRequestHandlerInterceptorAdapter.java index 9fb40675df6..6026dd17b47 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/WebRequestHandlerInterceptorAdapter.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/WebRequestHandlerInterceptorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java index c8b8b268f79..04897215097 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/DefaultMultipartActionRequest.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/DefaultMultipartActionRequest.java index a2b8184f9aa..a46f14b9b14 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/DefaultMultipartActionRequest.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/DefaultMultipartActionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/PortletMultipartResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/PortletMultipartResolver.java index b2a607f4e23..2cb58beffd7 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/PortletMultipartResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/PortletMultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractCommandController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractCommandController.java index 233ba4fb86f..dca2fd1717c 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractCommandController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractCommandController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractController.java index dc4b3c2288e..271906d4a21 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractFormController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractFormController.java index edf58821fc5..b901b5314e3 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractFormController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractWizardFormController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractWizardFormController.java index bd7971d5bbc..e9f98b1cac8 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractWizardFormController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/AbstractWizardFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/BaseCommandController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/BaseCommandController.java index ebb1bcc83f4..d1d1451e596 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/BaseCommandController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/BaseCommandController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/Controller.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/Controller.java index 8f93ba48af9..38bfb5075ec 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/Controller.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/Controller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ParameterizableViewController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ParameterizableViewController.java index fa2dcb26068..ab4818effa1 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ParameterizableViewController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ParameterizableViewController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/PortletWrappingController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/PortletWrappingController.java index db95e9edeae..f8a1df3d204 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/PortletWrappingController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/PortletWrappingController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ResourceAwareController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ResourceAwareController.java index 2839a209c37..3d679dccff2 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ResourceAwareController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/ResourceAwareController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/SimpleFormController.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/SimpleFormController.java index 47e5f5e3457..980afcd3e92 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/SimpleFormController.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/SimpleFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/util/PortletUtils.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/util/PortletUtils.java index 61950386903..d9dae6dcdb0 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/util/PortletUtils.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/util/PortletUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/Colour.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/IOther.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/ITestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/TestBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeacf..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see org.springframework.beans.ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see org.springframework.beans.IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java deleted file mode 100644 index a04d1796443..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractBeanFactoryTests.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans.factory; - -import java.beans.PropertyEditorSupport; -import java.util.StringTokenizer; - -import junit.framework.TestCase; -import junit.framework.Assert; - -import org.springframework.beans.BeansException; -import org.springframework.beans.PropertyBatchUpdateException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; - -/** - * Subclasses must implement setUp() to initialize bean factory - * and any other variables they need. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractBeanFactoryTests extends TestCase { - - protected abstract BeanFactory getBeanFactory(); - - /** - * Roderick beans inherits from rod, overriding name only. - */ - public void testInheritance() { - assertTrue(getBeanFactory().containsBean("rod")); - assertTrue(getBeanFactory().containsBean("roderick")); - TestBean rod = (TestBean) getBeanFactory().getBean("rod"); - TestBean roderick = (TestBean) getBeanFactory().getBean("roderick"); - assertTrue("not == ", rod != roderick); - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - assertTrue("roderick.name is Roderick", roderick.getName().equals("Roderick")); - assertTrue("roderick.age was inherited", roderick.getAge() == rod.getAge()); - } - - public void testGetBeanWithNullArg() { - try { - getBeanFactory().getBean((String) null); - fail("Can't get null bean"); - } - catch (IllegalArgumentException ex) { - // OK - } - } - - /** - * Test that InitializingBean objects receive the afterPropertiesSet() callback - */ - public void testInitializingBeanCallback() { - MustBeInitialized mbi = (MustBeInitialized) getBeanFactory().getBean("mustBeInitialized"); - // The dummy business method will throw an exception if the - // afterPropertiesSet() callback wasn't invoked - mbi.businessMethod(); - } - - /** - * Test that InitializingBean/BeanFactoryAware/DisposableBean objects receive the - * afterPropertiesSet() callback before BeanFactoryAware callbacks - */ - public void testLifecycleCallbacks() { - LifecycleBean lb = (LifecycleBean) getBeanFactory().getBean("lifecycle"); - Assert.assertEquals("lifecycle", lb.getBeanName()); - // The dummy business method will throw an exception if the - // necessary callbacks weren't invoked in the right order. - lb.businessMethod(); - assertTrue("Not destroyed", !lb.isDestroyed()); - } - - public void testFindsValidInstance() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - TestBean rod = (TestBean) o; - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - assertTrue("Actual type is correct", ex.getActualType() == getBeanFactory().getBean("rod").getClass()); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetSharedInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetSharedInstanceByMatchingClassNoCatch() { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - - public void testGetSharedInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testSharedInstancesAreEqual() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean1 is a TestBean", o instanceof TestBean); - Object o1 = getBeanFactory().getBean("rod"); - assertTrue("Rod bean2 is a TestBean", o1 instanceof TestBean); - assertTrue("Object equals applies", o == o1); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testPrototypeInstancesAreIndependent() { - TestBean tb1 = (TestBean) getBeanFactory().getBean("kathy"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("kathy"); - assertTrue("ref equal DOES NOT apply", tb1 != tb2); - assertTrue("object equal true", tb1.equals(tb2)); - tb1.setAge(1); - tb2.setAge(2); - assertTrue("1 age independent = 1", tb1.getAge() == 1); - assertTrue("2 age independent = 2", tb2.getAge() == 2); - assertTrue("object equal now false", !tb1.equals(tb2)); - } - - public void testNotThere() { - assertFalse(getBeanFactory().containsBean("Mr Squiggle")); - try { - Object o = getBeanFactory().getBean("Mr Squiggle"); - fail("Can't find missing bean"); - } - catch (BeansException ex) { - //ex.printStackTrace(); - //fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testValidEmpty() { - try { - Object o = getBeanFactory().getBean("validEmpty"); - assertTrue("validEmpty bean is a TestBean", o instanceof TestBean); - TestBean ve = (TestBean) o; - assertTrue("Valid empty has defaults", ve.getName() == null && ve.getAge() == 0 && ve.getSpouse() == null); - } - catch (BeansException ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on valid empty"); - } - } - - public void xtestTypeMismatch() { - try { - Object o = getBeanFactory().getBean("typeMismatch"); - fail("Shouldn't succeed with type mismatch"); - } - catch (BeanCreationException wex) { - assertEquals("typeMismatch", wex.getBeanName()); - assertTrue(wex.getCause() instanceof PropertyBatchUpdateException); - PropertyBatchUpdateException ex = (PropertyBatchUpdateException) wex.getCause(); - // Further tests - assertTrue("Has one error ", ex.getExceptionCount() == 1); - assertTrue("Error is for field age", ex.getPropertyAccessException("age") != null); - assertTrue("We have rejected age in exception", ex.getPropertyAccessException("age").getPropertyChangeEvent().getNewValue().equals("34x")); - } - } - - public void testGrandparentDefinitionFoundInBeanFactory() throws Exception { - TestBean dad = (TestBean) getBeanFactory().getBean("father"); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testFactorySingleton() throws Exception { - assertTrue(getBeanFactory().isSingleton("&singletonFactory")); - assertTrue(getBeanFactory().isSingleton("singletonFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton from factory has correct name, not " + tb.getName(), tb.getName().equals(DummyFactory.SINGLETON_NAME)); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton references ==", tb == tb2); - assertTrue("FactoryBean is BeanFactoryAware", factory.getBeanFactory() != null); - } - - public void testFactoryPrototype() throws Exception { - assertTrue(getBeanFactory().isSingleton("&prototypeFactory")); - assertFalse(getBeanFactory().isSingleton("prototypeFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue(!tb.getName().equals(DummyFactory.SINGLETON_NAME)); - TestBean tb2 = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue("Prototype references !=", tb != tb2); - } - - /** - * Check that we can get the factory bean itself. - * This is only possible if we're dealing with a factory - * @throws Exception - */ - public void testGetFactoryItself() throws Exception { - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue(factory != null); - } - - /** - * Check that afterPropertiesSet gets called on factory - * @throws Exception - */ - public void testFactoryIsInitialized() throws Exception { - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized()); - } - - /** - * It should be illegal to dereference a normal bean - * as a factory - */ - public void testRejectsFactoryGetOnNormalBean() { - try { - getBeanFactory().getBean("&rod"); - fail("Shouldn't permit factory get on normal bean"); - } - catch (BeanIsNotAFactoryException ex) { - // Ok - } - } - - // TODO: refactor in AbstractBeanFactory (tests for AbstractBeanFactory) - // and rename this class - public void testAliasing() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ConfigurableBeanFactory)) { - return; - } - ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) bf; - - String alias = "rods alias"; - try { - cbf.getBean(alias); - fail("Shouldn't permit factory get on normal bean"); - } - catch (NoSuchBeanDefinitionException ex) { - // Ok - assertTrue(alias.equals(ex.getBeanName())); - } - - // Create alias - cbf.registerAlias("rod", alias); - Object rod = getBeanFactory().getBean("rod"); - Object aliasRod = getBeanFactory().getBean(alias); - assertTrue(rod == aliasRod); - } - - - public static class TestBeanEditor extends PropertyEditorSupport { - - public void setAsText(String text) { - TestBean tb = new TestBean(); - StringTokenizer st = new StringTokenizer(text, "_"); - tb.setName(st.nextToken()); - tb.setAge(Integer.parseInt(st.nextToken())); - setValue(tb); - } - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java deleted file mode 100644 index d683491a1f6..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/AbstractListableBeanFactoryTests.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import junit.framework.Assert; - -import org.springframework.beans.TestBean; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFactoryTests { - - /** Subclasses must initialize this */ - protected ListableBeanFactory getListableBeanFactory() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ListableBeanFactory)) { - throw new IllegalStateException("ListableBeanFactory required"); - } - return (ListableBeanFactory) bf; - } - - /** - * Subclasses can override this. - */ - public void testCount() { - assertCount(13); - } - - protected final void assertCount(int count) { - String[] defnames = getListableBeanFactory().getBeanDefinitionNames(); - Assert.assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count); - } - - public void assertTestBeanCount(int count) { - String[] defNames = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, false); - Assert.assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " + - defNames.length, defNames.length == count); - - int countIncludingFactoryBeans = count + 2; - String[] names = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, true); - Assert.assertTrue("We should have " + countIncludingFactoryBeans + - " beans for class org.springframework.beans.TestBean, not " + names.length, - names.length == countIncludingFactoryBeans); - } - - public void testGetDefinitionsForNoSuchClass() { - String[] defnames = getListableBeanFactory().getBeanNamesForType(String.class); - Assert.assertTrue("No string definitions", defnames.length == 0); - } - - /** - * Check that count refers to factory class, not bean class. (We don't know - * what type factories may return, and it may even change over time.) - */ - public void testGetCountForFactoryClass() { - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - } - - public void testContainsBeanDefinition() { - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("rod")); - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("roderick")); - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/DummyFactory.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/DummyFactory.java deleted file mode 100644 index 006228975a7..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/DummyFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; - -/** - * Simple factory to allow testing of FactoryBean support in AbstractBeanFactory. - * Depending on whether its singleton property is set, it will return a singleton - * or a prototype instance. - * - *

Implements InitializingBean interface, so we can check that - * factories get this lifecycle callback if they want. - * - * @author Rod Johnson - * @since 10.03.2003 - */ -public class DummyFactory - implements FactoryBean, BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - public static final String SINGLETON_NAME = "Factory singleton"; - - private static boolean prototypeCreated; - - /** - * Clear static state. - */ - public static void reset() { - prototypeCreated = false; - } - - - /** - * Default is for factories to return a singleton instance. - */ - private boolean singleton = true; - - private String beanName; - - private AutowireCapableBeanFactory beanFactory; - - private boolean postProcessed; - - private boolean initialized; - - private TestBean testBean; - - private TestBean otherTestBean; - - - public DummyFactory() { - this.testBean = new TestBean(); - this.testBean.setName(SINGLETON_NAME); - this.testBean.setAge(25); - } - - /** - * Return if the bean managed by this factory is a singleton. - * @see FactoryBean#isSingleton() - */ - public boolean isSingleton() { - return this.singleton; - } - - /** - * Set if the bean managed by this factory is a singleton. - */ - public void setSingleton(boolean singleton) { - this.singleton = singleton; - } - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = (AutowireCapableBeanFactory) beanFactory; - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public void setOtherTestBean(TestBean otherTestBean) { - this.otherTestBean = otherTestBean; - this.testBean.setSpouse(otherTestBean); - } - - public TestBean getOtherTestBean() { - return otherTestBean; - } - - public void afterPropertiesSet() { - if (initialized) { - throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); - } - this.initialized = true; - } - - /** - * Was this initialized by invocation of the - * afterPropertiesSet() method from the InitializingBean interface? - */ - public boolean wasInitialized() { - return initialized; - } - - public static boolean wasPrototypeCreated() { - return prototypeCreated; - } - - - /** - * Return the managed object, supporting both singleton - * and prototype mode. - * @see FactoryBean#getObject() - */ - public Object getObject() throws BeansException { - if (isSingleton()) { - return this.testBean; - } - else { - TestBean prototype = new TestBean("prototype created at " + System.currentTimeMillis(), 11); - if (this.beanFactory != null) { - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(prototype, this.beanName); - } - prototypeCreated = true; - return prototype; - } - } - - public Class getObjectType() { - return TestBean.class; - } - - - public void destroy() { - if (this.testBean != null) { - this.testBean.setName(null); - } - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/LifecycleBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/LifecycleBean.java deleted file mode 100644 index 19b7da62f8d..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/LifecycleBean.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; - -/** - * Simple test of BeanFactory initialization and lifecycle callbacks. - * - * @author Rod Johnson - * @author Colin Sampaleanu - * @since 12.03.2003 - */ -public class LifecycleBean implements BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - protected boolean initMethodDeclared = false; - - protected String beanName; - - protected BeanFactory owningFactory; - - protected boolean postProcessedBeforeInit; - - protected boolean inited; - - protected boolean initedViaDeclaredInitMethod; - - protected boolean postProcessedAfterInit; - - protected boolean destroyed; - - - public void setInitMethodDeclared(boolean initMethodDeclared) { - this.initMethodDeclared = initMethodDeclared; - } - - public boolean isInitMethodDeclared() { - return initMethodDeclared; - } - - public void setBeanName(String name) { - this.beanName = name; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.owningFactory = beanFactory; - } - - public void postProcessBeforeInit() { - if (this.inited || this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessBeforeInit after afterPropertiesSet"); - } - if (this.postProcessedBeforeInit) { - throw new RuntimeException("Factory called postProcessBeforeInit twice"); - } - this.postProcessedBeforeInit = true; - } - - public void afterPropertiesSet() { - if (this.owningFactory == null) { - throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); - } - if (!this.postProcessedBeforeInit) { - throw new RuntimeException("Factory didn't call postProcessBeforeInit before afterPropertiesSet on lifecycle bean"); - } - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory initialized via declared init method before initializing via afterPropertiesSet"); - } - if (this.inited) { - throw new RuntimeException("Factory called afterPropertiesSet twice"); - } - this.inited = true; - } - - public void declaredInitMethod() { - if (!this.inited) { - throw new RuntimeException("Factory didn't call afterPropertiesSet before declared init method"); - } - - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called declared init method twice"); - } - this.initedViaDeclaredInitMethod = true; - } - - public void postProcessAfterInit() { - if (!this.inited) { - throw new RuntimeException("Factory called postProcessAfterInit before afterPropertiesSet"); - } - if (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessAfterInit before calling declared init method"); - } - if (this.postProcessedAfterInit) { - throw new RuntimeException("Factory called postProcessAfterInit twice"); - } - this.postProcessedAfterInit = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited || (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) || - !this.postProcessedAfterInit) { - throw new RuntimeException("Factory didn't initialize lifecycle object correctly"); - } - } - - public void destroy() { - if (this.destroyed) { - throw new IllegalStateException("Already destroyed"); - } - this.destroyed = true; - } - - public boolean isDestroyed() { - return destroyed; - } - - - public static class PostProcessor implements BeanPostProcessor { - - public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessBeforeInit(); - } - return bean; - } - - public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessAfterInit(); - } - return bean; - } - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/MustBeInitialized.java b/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/MustBeInitialized.java deleted file mode 100644 index 4715fe448f6..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/beans/factory/MustBeInitialized.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans.factory; - -import org.springframework.beans.factory.InitializingBean; - -/** - * Simple test of BeanFactory initialization - * @author Rod Johnson - * @since 12.03.2003 - */ -public class MustBeInitialized implements InitializingBean { - - private boolean inited; - - /** - * @see InitializingBean#afterPropertiesSet() - */ - public void afterPropertiesSet() throws Exception { - this.inited = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited) - throw new RuntimeException("Factory didn't call afterPropertiesSet() on MustBeInitialized object"); - } - -} \ No newline at end of file diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/ACATester.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/ACATester.java index 72c129ca4e3..7fa8a8263d8 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/ACATester.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/ACATester.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -27,6 +27,7 @@ public class ACATester implements ApplicationContextAware { private ApplicationContext ac; + @Override public void setApplicationContext(ApplicationContext ctx) throws ApplicationContextException { // check reinitialization if (this.ac != null) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/AbstractApplicationContextTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/AbstractApplicationContextTests.java deleted file mode 100644 index a0493b62ec2..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/AbstractApplicationContextTests.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.context; - -import java.util.Locale; - -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.AbstractListableBeanFactoryTests; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractApplicationContextTests extends AbstractListableBeanFactoryTests { - - /** Must be supplied as XML */ - public static final String TEST_NAMESPACE = "testNamespace"; - - protected ConfigurableApplicationContext applicationContext; - - /** Subclass must register this */ - protected TestListener listener = new TestListener(); - - protected TestListener parentListener = new TestListener(); - - protected void setUp() throws Exception { - this.applicationContext = createContext(); - } - - protected BeanFactory getBeanFactory() { - return applicationContext; - } - - protected ApplicationContext getApplicationContext() { - return applicationContext; - } - - /** - * Must register a TestListener. - * Must register standard beans. - * Parent must register rod with name Roderick - * and father with name Albert. - */ - protected abstract ConfigurableApplicationContext createContext() throws Exception; - - public void testContextAwareSingletonWasCalledBack() throws Exception { - ACATester aca = (ACATester) applicationContext.getBean("aca"); - assertTrue("has had context set", aca.getApplicationContext() == applicationContext); - Object aca2 = applicationContext.getBean("aca"); - assertTrue("Same instance", aca == aca2); - assertTrue("Says is singleton", applicationContext.isSingleton("aca")); - } - - public void testContextAwarePrototypeWasCalledBack() throws Exception { - ACATester aca = (ACATester) applicationContext.getBean("aca-prototype"); - assertTrue("has had context set", aca.getApplicationContext() == applicationContext); - Object aca2 = applicationContext.getBean("aca-prototype"); - assertTrue("NOT Same instance", aca != aca2); - assertTrue("Says is prototype", !applicationContext.isSingleton("aca-prototype")); - } - - public void testParentNonNull() { - assertTrue("parent isn't null", applicationContext.getParent() != null); - } - - public void testGrandparentNull() { - assertTrue("grandparent is null", applicationContext.getParent().getParent() == null); - } - - public void testOverrideWorked() throws Exception { - TestBean rod = (TestBean) applicationContext.getParent().getBean("rod"); - assertTrue("Parent's name differs", rod.getName().equals("Roderick")); - } - - public void testGrandparentDefinitionFound() throws Exception { - TestBean dad = (TestBean) applicationContext.getBean("father"); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testGrandparentTypedDefinitionFound() throws Exception { - TestBean dad = applicationContext.getBean("father", TestBean.class); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testCloseTriggersDestroy() { - LifecycleBean lb = (LifecycleBean) applicationContext.getBean("lifecycle"); - assertTrue("Not destroyed", !lb.isDestroyed()); - applicationContext.close(); - if (applicationContext.getParent() != null) { - ((ConfigurableApplicationContext) applicationContext.getParent()).close(); - } - assertTrue("Destroyed", lb.isDestroyed()); - applicationContext.close(); - if (applicationContext.getParent() != null) { - ((ConfigurableApplicationContext) applicationContext.getParent()).close(); - } - assertTrue("Destroyed", lb.isDestroyed()); - } - - public void testMessageSource() throws NoSuchMessageException { - assertEquals("message1", applicationContext.getMessage("code1", null, Locale.getDefault())); - assertEquals("message2", applicationContext.getMessage("code2", null, Locale.getDefault())); - - try { - applicationContext.getMessage("code0", null, Locale.getDefault()); - fail("looking for code0 should throw a NoSuchMessageException"); - } - catch (NoSuchMessageException ex) { - // that's how it should be - } - } - - public void testEvents() throws Exception { - listener.zeroCounter(); - parentListener.zeroCounter(); - assertTrue("0 events before publication", listener.getEventCount() == 0); - assertTrue("0 parent events before publication", parentListener.getEventCount() == 0); - this.applicationContext.publishEvent(new MyEvent(this)); - assertTrue("1 events after publication, not " + listener.getEventCount(), listener.getEventCount() == 1); - assertTrue("1 parent events after publication", parentListener.getEventCount() == 1); - } - - public void testBeanAutomaticallyHearsEvents() throws Exception { - //String[] listenerNames = ((ListableBeanFactory) applicationContext).getBeanDefinitionNames(ApplicationListener.class); - //assertTrue("listeners include beanThatListens", Arrays.asList(listenerNames).contains("beanThatListens")); - BeanThatListens b = (BeanThatListens) applicationContext.getBean("beanThatListens"); - b.zero(); - assertTrue("0 events before publication", b.getEventCount() == 0); - this.applicationContext.publishEvent(new MyEvent(this)); - assertTrue("1 events after publication, not " + b.getEventCount(), b.getEventCount() == 1); - } - - - @SuppressWarnings("serial") - public static class MyEvent extends ApplicationEvent { - - public MyEvent(Object source) { - super(source); - } - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatBroadcasts.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatBroadcasts.java index 8137de62f61..f3163636829 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatBroadcasts.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatBroadcasts.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -29,6 +29,7 @@ public class BeanThatBroadcasts implements ApplicationContextAware { public int receivedCount; + @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; if (applicationContext.getDisplayName().indexOf("listener") != -1) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java index 9ab3f8ea40d..ab40da4b896 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -43,6 +43,7 @@ public class BeanThatListens implements ApplicationListener { } + @Override public void onApplicationEvent(ApplicationEvent event) { eventCount++; if (beanThatBroadcasts != null) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/LifecycleContextBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/LifecycleContextBean.java index 50c9936c444..37d4c9715fb 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/LifecycleContextBean.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/LifecycleContextBean.java @@ -3,7 +3,7 @@ package org.springframework.context; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; +import org.springframework.tests.sample.beans.LifecycleBean; /** * Simple bean to test ApplicationContext lifecycle methods for beans @@ -15,18 +15,21 @@ public class LifecycleContextBean extends LifecycleBean implements ApplicationCo protected ApplicationContext owningContext; + @Override public void setBeanFactory(BeanFactory beanFactory) { super.setBeanFactory(beanFactory); if (this.owningContext != null) throw new RuntimeException("Factory called setBeanFactory after setApplicationContext"); } + @Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (this.owningContext == null) throw new RuntimeException("Factory didn't call setAppliationContext before afterPropertiesSet on lifecycle bean"); } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if (this.owningFactory == null) throw new RuntimeException("Factory called setApplicationContext before setBeanFactory"); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java index 29f375105ff..739222190fa 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java @@ -21,6 +21,7 @@ public class TestListener implements ApplicationListener { eventCount = 0; } + @Override public void onApplicationEvent(ApplicationEvent e) { ++eventCount; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/DelegatingServletOutputStream.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/DelegatingServletOutputStream.java deleted file mode 100644 index 784e160483a..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/DelegatingServletOutputStream.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.mock.web; - -import java.io.IOException; -import java.io.OutputStream; -import javax.servlet.ServletOutputStream; - -import org.springframework.util.Assert; - -/** - * Delegating implementation of {@link javax.servlet.ServletOutputStream}. - * - *

Used by {@link MockHttpServletResponse}; typically not directly - * used for testing application controllers. - * - * @author Juergen Hoeller - * @since 1.0.2 - * @see MockHttpServletResponse - */ -public class DelegatingServletOutputStream extends ServletOutputStream { - - private final OutputStream targetStream; - - - /** - * Create a DelegatingServletOutputStream for the given target stream. - * @param targetStream the target stream (never {@code null}) - */ - public DelegatingServletOutputStream(OutputStream targetStream) { - Assert.notNull(targetStream, "Target OutputStream must not be null"); - this.targetStream = targetStream; - } - - /** - * Return the underlying target stream (never {@code null}). - */ - public final OutputStream getTargetStream() { - return this.targetStream; - } - - - public void write(int b) throws IOException { - this.targetStream.write(b); - } - - public void flush() throws IOException { - super.flush(); - this.targetStream.flush(); - } - - public void close() throws IOException { - super.close(); - this.targetStream.close(); - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/HeaderValueHolder.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/HeaderValueHolder.java deleted file mode 100644 index a6381e92baa..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/HeaderValueHolder.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2002-2011 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 - * - * http://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.mock.web; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; - -/** - * Internal helper class that serves as value holder for request headers. - * - * @author Juergen Hoeller - * @author Rick Evans - * @since 2.0.1 - */ -class HeaderValueHolder { - - private final List values = new LinkedList(); - - - public void setValue(Object value) { - this.values.clear(); - this.values.add(value); - } - - public void addValue(Object value) { - this.values.add(value); - } - - public void addValues(Collection values) { - this.values.addAll(values); - } - - public void addValueArray(Object values) { - CollectionUtils.mergeArrayIntoCollection(values, this.values); - } - - public List getValues() { - return Collections.unmodifiableList(this.values); - } - - public List getStringValues() { - List stringList = new ArrayList(this.values.size()); - for (Object value : this.values) { - stringList.add(value.toString()); - } - return Collections.unmodifiableList(stringList); - } - - public Object getValue() { - return (!this.values.isEmpty() ? this.values.get(0) : null); - } - - public String getStringValue() { - return (!this.values.isEmpty() ? this.values.get(0).toString() : null); - } - - - /** - * Find a HeaderValueHolder by name, ignoring casing. - * @param headers the Map of header names to HeaderValueHolders - * @param name the name of the desired header - * @return the corresponding HeaderValueHolder, - * or {@code null} if none found - */ - public static HeaderValueHolder getByName(Map headers, String name) { - Assert.notNull(name, "Header name must not be null"); - for (String headerName : headers.keySet()) { - if (headerName.equalsIgnoreCase(name)) { - return headers.get(headerName); - } - } - return null; - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java deleted file mode 100644 index c86e95a93a7..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java +++ /dev/null @@ -1,603 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.mock.web; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.util.Assert; -import org.springframework.util.LinkedCaseInsensitiveMap; -import org.springframework.web.util.WebUtils; - -/** - * Mock implementation of the {@link javax.servlet.http.HttpServletResponse} interface. - * - *

Compatible with Servlet 2.5 as well as Servlet 3.0. - * - * @author Juergen Hoeller - * @author Rod Johnson - * @since 1.0.2 - */ -public class MockHttpServletResponse implements HttpServletResponse { - - private static final String CHARSET_PREFIX = "charset="; - - private static final String CONTENT_TYPE_HEADER = "Content-Type"; - - private static final String CONTENT_LENGTH_HEADER = "Content-Length"; - - private static final String LOCATION_HEADER = "Location"; - - //--------------------------------------------------------------------- - // ServletResponse properties - //--------------------------------------------------------------------- - - private boolean outputStreamAccessAllowed = true; - - private boolean writerAccessAllowed = true; - - private String characterEncoding = WebUtils.DEFAULT_CHARACTER_ENCODING; - - private boolean charset = false; - - private final ByteArrayOutputStream content = new ByteArrayOutputStream(); - - private final ServletOutputStream outputStream = new ResponseServletOutputStream(this.content); - - private PrintWriter writer; - - private int contentLength = 0; - - private String contentType; - - private int bufferSize = 4096; - - private boolean committed; - - private Locale locale = Locale.getDefault(); - - - //--------------------------------------------------------------------- - // HttpServletResponse properties - //--------------------------------------------------------------------- - - private final List cookies = new ArrayList(); - - private final Map headers = new LinkedCaseInsensitiveMap(); - - private int status = HttpServletResponse.SC_OK; - - private String errorMessage; - - private String forwardedUrl; - - private final List includedUrls = new ArrayList(); - - - //--------------------------------------------------------------------- - // ServletResponse interface - //--------------------------------------------------------------------- - - /** - * Set whether {@link #getOutputStream()} access is allowed. - *

Default is {@code true}. - */ - public void setOutputStreamAccessAllowed(boolean outputStreamAccessAllowed) { - this.outputStreamAccessAllowed = outputStreamAccessAllowed; - } - - /** - * Return whether {@link #getOutputStream()} access is allowed. - */ - public boolean isOutputStreamAccessAllowed() { - return this.outputStreamAccessAllowed; - } - - /** - * Set whether {@link #getWriter()} access is allowed. - *

Default is {@code true}. - */ - public void setWriterAccessAllowed(boolean writerAccessAllowed) { - this.writerAccessAllowed = writerAccessAllowed; - } - - /** - * Return whether {@link #getOutputStream()} access is allowed. - */ - public boolean isWriterAccessAllowed() { - return this.writerAccessAllowed; - } - - public void setCharacterEncoding(String characterEncoding) { - this.characterEncoding = characterEncoding; - this.charset = true; - updateContentTypeHeader(); - } - - private void updateContentTypeHeader() { - if (this.contentType != null) { - StringBuilder sb = new StringBuilder(this.contentType); - if (this.contentType.toLowerCase().indexOf(CHARSET_PREFIX) == -1 && this.charset) { - sb.append(";").append(CHARSET_PREFIX).append(this.characterEncoding); - } - doAddHeaderValue(CONTENT_TYPE_HEADER, sb.toString(), true); - } - } - - public String getCharacterEncoding() { - return this.characterEncoding; - } - - public ServletOutputStream getOutputStream() { - if (!this.outputStreamAccessAllowed) { - throw new IllegalStateException("OutputStream access not allowed"); - } - return this.outputStream; - } - - public PrintWriter getWriter() throws UnsupportedEncodingException { - if (!this.writerAccessAllowed) { - throw new IllegalStateException("Writer access not allowed"); - } - if (this.writer == null) { - Writer targetWriter = (this.characterEncoding != null ? - new OutputStreamWriter(this.content, this.characterEncoding) : new OutputStreamWriter(this.content)); - this.writer = new ResponsePrintWriter(targetWriter); - } - return this.writer; - } - - public byte[] getContentAsByteArray() { - flushBuffer(); - return this.content.toByteArray(); - } - - public String getContentAsString() throws UnsupportedEncodingException { - flushBuffer(); - return (this.characterEncoding != null) ? - this.content.toString(this.characterEncoding) : this.content.toString(); - } - - public void setContentLength(int contentLength) { - this.contentLength = contentLength; - doAddHeaderValue(CONTENT_LENGTH_HEADER, contentLength, true); - } - - public int getContentLength() { - return this.contentLength; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - if (contentType != null) { - int charsetIndex = contentType.toLowerCase().indexOf(CHARSET_PREFIX); - if (charsetIndex != -1) { - String encoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length()); - this.characterEncoding = encoding; - this.charset = true; - } - updateContentTypeHeader(); - } - } - - public String getContentType() { - return this.contentType; - } - - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - - public int getBufferSize() { - return this.bufferSize; - } - - public void flushBuffer() { - setCommitted(true); - } - - public void resetBuffer() { - if (isCommitted()) { - throw new IllegalStateException("Cannot reset buffer - response is already committed"); - } - this.content.reset(); - } - - private void setCommittedIfBufferSizeExceeded() { - int bufSize = getBufferSize(); - if (bufSize > 0 && this.content.size() > bufSize) { - setCommitted(true); - } - } - - public void setCommitted(boolean committed) { - this.committed = committed; - } - - public boolean isCommitted() { - return this.committed; - } - - public void reset() { - resetBuffer(); - this.characterEncoding = null; - this.contentLength = 0; - this.contentType = null; - this.locale = null; - this.cookies.clear(); - this.headers.clear(); - this.status = HttpServletResponse.SC_OK; - this.errorMessage = null; - } - - public void setLocale(Locale locale) { - this.locale = locale; - } - - public Locale getLocale() { - return this.locale; - } - - - //--------------------------------------------------------------------- - // HttpServletResponse interface - //--------------------------------------------------------------------- - - public void addCookie(Cookie cookie) { - Assert.notNull(cookie, "Cookie must not be null"); - this.cookies.add(cookie); - } - - public Cookie[] getCookies() { - return this.cookies.toArray(new Cookie[this.cookies.size()]); - } - - public Cookie getCookie(String name) { - Assert.notNull(name, "Cookie name must not be null"); - for (Cookie cookie : this.cookies) { - if (name.equals(cookie.getName())) { - return cookie; - } - } - return null; - } - - public boolean containsHeader(String name) { - return (HeaderValueHolder.getByName(this.headers, name) != null); - } - - /** - * Return the names of all specified headers as a Set of Strings. - *

As of Servlet 3.0, this method is also defined HttpServletResponse. - * @return the {@code Set} of header name {@code Strings}, or an empty {@code Set} if none - */ - public Set getHeaderNames() { - return this.headers.keySet(); - } - - /** - * Return the primary value for the given header as a String, if any. - * Will return the first value in case of multiple values. - *

As of Servlet 3.0, this method is also defined in HttpServletResponse. - * As of Spring 3.1, it returns a stringified value for Servlet 3.0 compatibility. - * Consider using {@link #getHeaderValue(String)} for raw Object access. - * @param name the name of the header - * @return the associated header value, or {@code null} if none - */ - public String getHeader(String name) { - HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); - return (header != null ? header.getStringValue() : null); - } - - /** - * Return all values for the given header as a List of Strings. - *

As of Servlet 3.0, this method is also defined in HttpServletResponse. - * As of Spring 3.1, it returns a List of stringified values for Servlet 3.0 compatibility. - * Consider using {@link #getHeaderValues(String)} for raw Object access. - * @param name the name of the header - * @return the associated header values, or an empty List if none - */ - public List getHeaders(String name) { - HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); - if (header != null) { - return header.getStringValues(); - } - else { - return Collections.emptyList(); - } - } - - /** - * Return the primary value for the given header, if any. - *

Will return the first value in case of multiple values. - * @param name the name of the header - * @return the associated header value, or {@code null} if none - */ - public Object getHeaderValue(String name) { - HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); - return (header != null ? header.getValue() : null); - } - - /** - * Return all values for the given header as a List of value objects. - * @param name the name of the header - * @return the associated header values, or an empty List if none - */ - public List getHeaderValues(String name) { - HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); - if (header != null) { - return header.getValues(); - } - else { - return Collections.emptyList(); - } - } - - /** - * The default implementation returns the given URL String as-is. - *

Can be overridden in subclasses, appending a session id or the like. - */ - public String encodeURL(String url) { - return url; - } - - /** - * The default implementation delegates to {@link #encodeURL}, - * returning the given URL String as-is. - *

Can be overridden in subclasses, appending a session id or the like - * in a redirect-specific fashion. For general URL encoding rules, - * override the common {@link #encodeURL} method instead, applying - * to redirect URLs as well as to general URLs. - */ - public String encodeRedirectURL(String url) { - return encodeURL(url); - } - - public String encodeUrl(String url) { - return encodeURL(url); - } - - public String encodeRedirectUrl(String url) { - return encodeRedirectURL(url); - } - - public void sendError(int status, String errorMessage) throws IOException { - if (isCommitted()) { - throw new IllegalStateException("Cannot set error status - response is already committed"); - } - this.status = status; - this.errorMessage = errorMessage; - setCommitted(true); - } - - public void sendError(int status) throws IOException { - if (isCommitted()) { - throw new IllegalStateException("Cannot set error status - response is already committed"); - } - this.status = status; - setCommitted(true); - } - - public void sendRedirect(String url) throws IOException { - if (isCommitted()) { - throw new IllegalStateException("Cannot send redirect - response is already committed"); - } - Assert.notNull(url, "Redirect URL must not be null"); - setHeader(LOCATION_HEADER, url); - setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); - setCommitted(true); - } - - public String getRedirectedUrl() { - return getHeader(LOCATION_HEADER); - } - - public void setDateHeader(String name, long value) { - setHeaderValue(name, value); - } - - public void addDateHeader(String name, long value) { - addHeaderValue(name, value); - } - - public void setHeader(String name, String value) { - setHeaderValue(name, value); - } - - public void addHeader(String name, String value) { - addHeaderValue(name, value); - } - - public void setIntHeader(String name, int value) { - setHeaderValue(name, value); - } - - public void addIntHeader(String name, int value) { - addHeaderValue(name, value); - } - - private void setHeaderValue(String name, Object value) { - if (setSpecialHeader(name, value)) { - return; - } - doAddHeaderValue(name, value, true); - } - - private void addHeaderValue(String name, Object value) { - if (setSpecialHeader(name, value)) { - return; - } - doAddHeaderValue(name, value, false); - } - - private boolean setSpecialHeader(String name, Object value) { - if (CONTENT_TYPE_HEADER.equalsIgnoreCase(name)) { - setContentType((String) value); - return true; - } - else if (CONTENT_LENGTH_HEADER.equalsIgnoreCase(name)) { - setContentLength(Integer.parseInt((String) value)); - return true; - } - else { - return false; - } - } - - private void doAddHeaderValue(String name, Object value, boolean replace) { - HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name); - Assert.notNull(value, "Header value must not be null"); - if (header == null) { - header = new HeaderValueHolder(); - this.headers.put(name, header); - } - if (replace) { - header.setValue(value); - } - else { - header.addValue(value); - } - } - - public void setStatus(int status) { - this.status = status; - } - - public void setStatus(int status, String errorMessage) { - this.status = status; - this.errorMessage = errorMessage; - } - - public int getStatus() { - return this.status; - } - - public String getErrorMessage() { - return this.errorMessage; - } - - - //--------------------------------------------------------------------- - // Methods for MockRequestDispatcher - //--------------------------------------------------------------------- - - public void setForwardedUrl(String forwardedUrl) { - this.forwardedUrl = forwardedUrl; - } - - public String getForwardedUrl() { - return this.forwardedUrl; - } - - public void setIncludedUrl(String includedUrl) { - this.includedUrls.clear(); - if (includedUrl != null) { - this.includedUrls.add(includedUrl); - } - } - - public String getIncludedUrl() { - int count = this.includedUrls.size(); - if (count > 1) { - throw new IllegalStateException( - "More than 1 URL included - check getIncludedUrls instead: " + this.includedUrls); - } - return (count == 1 ? this.includedUrls.get(0) : null); - } - - public void addIncludedUrl(String includedUrl) { - Assert.notNull(includedUrl, "Included URL must not be null"); - this.includedUrls.add(includedUrl); - } - - public List getIncludedUrls() { - return this.includedUrls; - } - - - /** - * Inner class that adapts the ServletOutputStream to mark the - * response as committed once the buffer size is exceeded. - */ - private class ResponseServletOutputStream extends DelegatingServletOutputStream { - - public ResponseServletOutputStream(OutputStream out) { - super(out); - } - - public void write(int b) throws IOException { - super.write(b); - super.flush(); - setCommittedIfBufferSizeExceeded(); - } - - public void flush() throws IOException { - super.flush(); - setCommitted(true); - } - } - - - /** - * Inner class that adapts the PrintWriter to mark the - * response as committed once the buffer size is exceeded. - */ - private class ResponsePrintWriter extends PrintWriter { - - public ResponsePrintWriter(Writer out) { - super(out, true); - } - - public void write(char buf[], int off, int len) { - super.write(buf, off, len); - super.flush(); - setCommittedIfBufferSizeExceeded(); - } - - public void write(String s, int off, int len) { - super.write(s, off, len); - super.flush(); - setCommittedIfBufferSizeExceeded(); - } - - public void write(int c) { - super.write(c); - super.flush(); - setCommittedIfBufferSizeExceeded(); - } - - public void flush() { - super.flush(); - setCommitted(true); - } - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpSession.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpSession.java deleted file mode 100644 index 1855230d2c5..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockHttpSession.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.mock.web; - -import java.io.Serializable; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionBindingEvent; -import javax.servlet.http.HttpSessionBindingListener; -import javax.servlet.http.HttpSessionContext; - -import org.springframework.util.Assert; - -/** - * Mock implementation of the {@link javax.servlet.http.HttpSession} interface. - * - *

Compatible with Servlet 2.5 as well as Servlet 3.0. - * - *

Used for testing the web framework; also useful for testing application - * controllers. - * - * @author Juergen Hoeller - * @author Rod Johnson - * @author Mark Fisher - * @author Sam Brannen - * @since 1.0.2 - */ -@SuppressWarnings("deprecation") -public class MockHttpSession implements HttpSession { - - public static final String SESSION_COOKIE_NAME = "JSESSION"; - - private static int nextId = 1; - - private final String id; - - private final long creationTime = System.currentTimeMillis(); - - private int maxInactiveInterval; - - private long lastAccessedTime = System.currentTimeMillis(); - - private final ServletContext servletContext; - - private final Map attributes = new LinkedHashMap(); - - private boolean invalid = false; - - private boolean isNew = true; - - - /** - * Create a new MockHttpSession with a default {@link MockServletContext}. - * - * @see MockServletContext - */ - public MockHttpSession() { - this(null); - } - - /** - * Create a new MockHttpSession. - * - * @param servletContext the ServletContext that the session runs in - */ - public MockHttpSession(ServletContext servletContext) { - this(servletContext, null); - } - - /** - * Create a new MockHttpSession. - * - * @param servletContext the ServletContext that the session runs in - * @param id a unique identifier for this session - */ - public MockHttpSession(ServletContext servletContext, String id) { - this.servletContext = (servletContext != null ? servletContext : new MockServletContext()); - this.id = (id != null ? id : Integer.toString(nextId++)); - } - - public long getCreationTime() { - return this.creationTime; - } - - public String getId() { - return this.id; - } - - public void access() { - this.lastAccessedTime = System.currentTimeMillis(); - this.isNew = false; - } - - public long getLastAccessedTime() { - return this.lastAccessedTime; - } - - public ServletContext getServletContext() { - return this.servletContext; - } - - public void setMaxInactiveInterval(int interval) { - this.maxInactiveInterval = interval; - } - - public int getMaxInactiveInterval() { - return this.maxInactiveInterval; - } - - public HttpSessionContext getSessionContext() { - throw new UnsupportedOperationException("getSessionContext"); - } - - public Object getAttribute(String name) { - Assert.notNull(name, "Attribute name must not be null"); - return this.attributes.get(name); - } - - public Object getValue(String name) { - return getAttribute(name); - } - - public Enumeration getAttributeNames() { - return Collections.enumeration(this.attributes.keySet()); - } - - public String[] getValueNames() { - return this.attributes.keySet().toArray(new String[this.attributes.size()]); - } - - public void setAttribute(String name, Object value) { - Assert.notNull(name, "Attribute name must not be null"); - if (value != null) { - this.attributes.put(name, value); - if (value instanceof HttpSessionBindingListener) { - ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); - } - } - else { - removeAttribute(name); - } - } - - public void putValue(String name, Object value) { - setAttribute(name, value); - } - - public void removeAttribute(String name) { - Assert.notNull(name, "Attribute name must not be null"); - Object value = this.attributes.remove(name); - if (value instanceof HttpSessionBindingListener) { - ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); - } - } - - public void removeValue(String name) { - removeAttribute(name); - } - - /** - * Clear all of this session's attributes. - */ - public void clearAttributes() { - for (Iterator> it = this.attributes.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = it.next(); - String name = entry.getKey(); - Object value = entry.getValue(); - it.remove(); - if (value instanceof HttpSessionBindingListener) { - ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); - } - } - } - - /** - * Invalidates this session then unbinds any objects bound to it. - * - * @throws IllegalStateException if this method is called on an already invalidated session - */ - public void invalidate() { - if (this.invalid) { - throw new IllegalStateException("The session has already been invalidated"); - } - - // else - this.invalid = true; - clearAttributes(); - } - - public boolean isInvalid() { - return this.invalid; - } - - public void setNew(boolean value) { - this.isNew = value; - } - - public boolean isNew() { - return this.isNew; - } - - /** - * Serialize the attributes of this session into an object that can be - * turned into a byte array with standard Java serialization. - * - * @return a representation of this session's serialized state - */ - public Serializable serializeState() { - HashMap state = new HashMap(); - for (Iterator> it = this.attributes.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = it.next(); - String name = entry.getKey(); - Object value = entry.getValue(); - it.remove(); - if (value instanceof Serializable) { - state.put(name, (Serializable) value); - } - else { - // Not serializable... Servlet containers usually automatically - // unbind the attribute in this case. - if (value instanceof HttpSessionBindingListener) { - ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); - } - } - } - return state; - } - - /** - * Deserialize the attributes of this session from a state object created by - * {@link #serializeState()}. - * - * @param state a representation of this session's serialized state - */ - @SuppressWarnings("unchecked") - public void deserializeState(Serializable state) { - Assert.isTrue(state instanceof Map, "Serialized state needs to be of type [java.util.Map]"); - this.attributes.putAll((Map) state); - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockMultipartFile.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockMultipartFile.java deleted file mode 100644 index f71992aed7e..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockMultipartFile.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2002-2011 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 - * - * http://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.mock.web; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import org.springframework.util.Assert; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; - -/** - * Mock implementation of the {@link org.springframework.web.multipart.MultipartFile} - * interface. - * - *

Useful in conjunction with a {@link MockMultipartHttpServletRequest} - * for testing application controllers that access multipart uploads. - * - * @author Juergen Hoeller - * @author Eric Crampton - * @since 2.0 - * @see MockMultipartHttpServletRequest - */ -public class MockMultipartFile implements MultipartFile { - - private final String name; - - private String originalFilename; - - private String contentType; - - private final byte[] content; - - - /** - * Create a new MockMultipartFile with the given content. - * @param name the name of the file - * @param content the content of the file - */ - public MockMultipartFile(String name, byte[] content) { - this(name, "", null, content); - } - - /** - * Create a new MockMultipartFile with the given content. - * @param name the name of the file - * @param contentStream the content of the file as stream - * @throws IOException if reading from the stream failed - */ - public MockMultipartFile(String name, InputStream contentStream) throws IOException { - this(name, "", null, FileCopyUtils.copyToByteArray(contentStream)); - } - - /** - * Create a new MockMultipartFile with the given content. - * @param name the name of the file - * @param originalFilename the original filename (as on the client's machine) - * @param contentType the content type (if known) - * @param content the content of the file - */ - public MockMultipartFile(String name, String originalFilename, String contentType, byte[] content) { - Assert.hasLength(name, "Name must not be null"); - this.name = name; - this.originalFilename = (originalFilename != null ? originalFilename : ""); - this.contentType = contentType; - this.content = (content != null ? content : new byte[0]); - } - - /** - * Create a new MockMultipartFile with the given content. - * @param name the name of the file - * @param originalFilename the original filename (as on the client's machine) - * @param contentType the content type (if known) - * @param contentStream the content of the file as stream - * @throws IOException if reading from the stream failed - */ - public MockMultipartFile(String name, String originalFilename, String contentType, InputStream contentStream) - throws IOException { - - this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream)); - } - - - public String getName() { - return this.name; - } - - public String getOriginalFilename() { - return this.originalFilename; - } - - public String getContentType() { - return this.contentType; - } - - public boolean isEmpty() { - return (this.content.length == 0); - } - - public long getSize() { - return this.content.length; - } - - public byte[] getBytes() throws IOException { - return this.content; - } - - public InputStream getInputStream() throws IOException { - return new ByteArrayInputStream(this.content); - } - - public void transferTo(File dest) throws IOException, IllegalStateException { - FileCopyUtils.copy(this.content, dest); - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockRequestDispatcher.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockRequestDispatcher.java deleted file mode 100644 index 88660bb3aed..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockRequestDispatcher.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.mock.web; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.util.Assert; - -/** - * Mock implementation of the {@link javax.servlet.RequestDispatcher} interface. - * - *

Used for testing the web framework; typically not necessary for - * testing application controllers. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @author Sam Brannen - * @since 1.0.2 - */ -public class MockRequestDispatcher implements RequestDispatcher { - - private final Log logger = LogFactory.getLog(getClass()); - - private final String resource; - - - /** - * Create a new MockRequestDispatcher for the given resource. - * @param resource the server resource to dispatch to, located at a - * particular path or given by a particular name - */ - public MockRequestDispatcher(String resource) { - Assert.notNull(resource, "resource must not be null"); - this.resource = resource; - } - - - public void forward(ServletRequest request, ServletResponse response) { - Assert.notNull(request, "Request must not be null"); - Assert.notNull(response, "Response must not be null"); - if (response.isCommitted()) { - throw new IllegalStateException("Cannot perform forward - response is already committed"); - } - getMockHttpServletResponse(response).setForwardedUrl(this.resource); - if (logger.isDebugEnabled()) { - logger.debug("MockRequestDispatcher: forwarding to [" + this.resource + "]"); - } - } - - public void include(ServletRequest request, ServletResponse response) { - Assert.notNull(request, "Request must not be null"); - Assert.notNull(response, "Response must not be null"); - getMockHttpServletResponse(response).addIncludedUrl(this.resource); - if (logger.isDebugEnabled()) { - logger.debug("MockRequestDispatcher: including [" + this.resource + "]"); - } - } - - /** - * Obtain the underlying {@link MockHttpServletResponse}, unwrapping - * {@link HttpServletResponseWrapper} decorators if necessary. - */ - protected MockHttpServletResponse getMockHttpServletResponse(ServletResponse response) { - if (response instanceof MockHttpServletResponse) { - return (MockHttpServletResponse) response; - } - if (response instanceof HttpServletResponseWrapper) { - return getMockHttpServletResponse(((HttpServletResponseWrapper) response).getResponse()); - } - throw new IllegalArgumentException("MockRequestDispatcher requires MockHttpServletResponse"); - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockServletContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockServletContext.java deleted file mode 100644 index e3fa23eff3e..00000000000 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/MockServletContext.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.mock.web; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; -import java.util.Vector; -import javax.activation.FileTypeMap; -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.io.Resource; -import org.springframework.core.io.ResourceLoader; -import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; -import org.springframework.util.ObjectUtils; -import org.springframework.web.util.WebUtils; - -/** - * Mock implementation of the {@link javax.servlet.ServletContext} interface. - * - *

Compatible with Servlet 2.5 and partially with Servlet 3.0. Can be configured to - * expose a specific version through {@link #setMajorVersion}/{@link #setMinorVersion}; - * default is 2.5. Note that Servlet 3.0 support is limited: servlet, filter and listener - * registration methods are not supported; neither is cookie or JSP configuration. - * We generally do not recommend to unit-test your ServletContainerInitializers and - * WebApplicationInitializers which is where those registration methods would be used. - * - *

Used for testing the Spring web framework; only rarely necessary for testing - * application controllers. As long as application components don't explicitly - * access the {@code ServletContext}, {@code ClassPathXmlApplicationContext} or - * {@code FileSystemXmlApplicationContext} can be used to load the context files - * for testing, even for {@code DispatcherServlet} context definitions. - * - *

For setting up a full {@code WebApplicationContext} in a test environment, - * you can use {@code AnnotationConfigWebApplicationContext}, - * {@code XmlWebApplicationContext}, or {@code GenericWebApplicationContext}, - * passing in an appropriate {@code MockServletContext} instance. You might want - * to configure your {@code MockServletContext} with a {@code FileSystemResourceLoader} - * in that case to ensure that resource paths are interpreted as relative filesystem - * locations. - * - *

A common setup is to point your JVM working directory to the root of your - * web application directory, in combination with filesystem-based resource loading. - * This allows to load the context files as used in the web application, with - * relative paths getting interpreted correctly. Such a setup will work with both - * {@code FileSystemXmlApplicationContext} (which will load straight from the - * filesystem) and {@code XmlWebApplicationContext} with an underlying - * {@code MockServletContext} (as long as the {@code MockServletContext} has been - * configured with a {@code FileSystemResourceLoader}). - * - * @author Rod Johnson - * @author Juergen Hoeller - * @author Sam Brannen - * @since 1.0.2 - * @see #MockServletContext(org.springframework.core.io.ResourceLoader) - * @see org.springframework.web.context.support.AnnotationConfigWebApplicationContext - * @see org.springframework.web.context.support.XmlWebApplicationContext - * @see org.springframework.web.context.support.GenericWebApplicationContext - * @see org.springframework.context.support.ClassPathXmlApplicationContext - * @see org.springframework.context.support.FileSystemXmlApplicationContext - */ -public class MockServletContext implements ServletContext { - - /** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish: {@value}. */ - private static final String COMMON_DEFAULT_SERVLET_NAME = "default"; - - private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir"; - - private final Log logger = LogFactory.getLog(getClass()); - - private final Map contexts = new HashMap(); - - private final Map initParameters = new LinkedHashMap(); - - private final Map attributes = new LinkedHashMap(); - - private final Set declaredRoles = new HashSet(); - - private final Map namedRequestDispatchers = new HashMap(); - - private final ResourceLoader resourceLoader; - - private final String resourceBasePath; - - private String contextPath = ""; - - private int majorVersion = 2; - - private int minorVersion = 5; - - private int effectiveMajorVersion = 2; - - private int effectiveMinorVersion = 5; - - private String servletContextName = "MockServletContext"; - - private String defaultServletName = COMMON_DEFAULT_SERVLET_NAME; - - - /** - * Create a new MockServletContext, using no base path and a - * DefaultResourceLoader (i.e. the classpath root as WAR root). - * @see org.springframework.core.io.DefaultResourceLoader - */ - public MockServletContext() { - this("", null); - } - - /** - * Create a new MockServletContext, using a DefaultResourceLoader. - * @param resourceBasePath the root directory of the WAR (should not end with a slash) - * @see org.springframework.core.io.DefaultResourceLoader - */ - public MockServletContext(String resourceBasePath) { - this(resourceBasePath, null); - } - - /** - * Create a new MockServletContext, using the specified ResourceLoader - * and no base path. - * @param resourceLoader the ResourceLoader to use (or null for the default) - */ - public MockServletContext(ResourceLoader resourceLoader) { - this("", resourceLoader); - } - - /** - * Create a new MockServletContext using the supplied resource base path and - * resource loader. - *

Registers a {@link MockRequestDispatcher} for the Servlet named - * {@value #COMMON_DEFAULT_SERVLET_NAME}. - * @param resourceBasePath the root directory of the WAR (should not end with a slash) - * @param resourceLoader the ResourceLoader to use (or null for the default) - * @see #registerNamedDispatcher - */ - public MockServletContext(String resourceBasePath, ResourceLoader resourceLoader) { - this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader()); - this.resourceBasePath = (resourceBasePath != null ? resourceBasePath : ""); - - // Use JVM temp dir as ServletContext temp dir. - String tempDir = System.getProperty(TEMP_DIR_SYSTEM_PROPERTY); - if (tempDir != null) { - this.attributes.put(WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE, new File(tempDir)); - } - - registerNamedDispatcher(this.defaultServletName, new MockRequestDispatcher(this.defaultServletName)); - } - - /** - * Build a full resource location for the given path, - * prepending the resource base path of this MockServletContext. - * @param path the path as specified - * @return the full resource path - */ - protected String getResourceLocation(String path) { - if (!path.startsWith("/")) { - path = "/" + path; - } - return this.resourceBasePath + path; - } - - public void setContextPath(String contextPath) { - this.contextPath = (contextPath != null ? contextPath : ""); - } - - /* This is a Servlet API 2.5 method. */ - public String getContextPath() { - return this.contextPath; - } - - public void registerContext(String contextPath, ServletContext context) { - this.contexts.put(contextPath, context); - } - - public ServletContext getContext(String contextPath) { - if (this.contextPath.equals(contextPath)) { - return this; - } - return this.contexts.get(contextPath); - } - - public void setMajorVersion(int majorVersion) { - this.majorVersion = majorVersion; - } - - public int getMajorVersion() { - return this.majorVersion; - } - - public void setMinorVersion(int minorVersion) { - this.minorVersion = minorVersion; - } - - public int getMinorVersion() { - return this.minorVersion; - } - - public void setEffectiveMajorVersion(int effectiveMajorVersion) { - this.effectiveMajorVersion = effectiveMajorVersion; - } - - public int getEffectiveMajorVersion() { - return this.effectiveMajorVersion; - } - - public void setEffectiveMinorVersion(int effectiveMinorVersion) { - this.effectiveMinorVersion = effectiveMinorVersion; - } - - public int getEffectiveMinorVersion() { - return this.effectiveMinorVersion; - } - - public String getMimeType(String filePath) { - return MimeTypeResolver.getMimeType(filePath); - } - - public Set getResourcePaths(String path) { - String actualPath = (path.endsWith("/") ? path : path + "/"); - Resource resource = this.resourceLoader.getResource(getResourceLocation(actualPath)); - try { - File file = resource.getFile(); - String[] fileList = file.list(); - if (ObjectUtils.isEmpty(fileList)) { - return null; - } - Set resourcePaths = new LinkedHashSet(fileList.length); - for (String fileEntry : fileList) { - String resultPath = actualPath + fileEntry; - if (resource.createRelative(fileEntry).getFile().isDirectory()) { - resultPath += "/"; - } - resourcePaths.add(resultPath); - } - return resourcePaths; - } - catch (IOException ex) { - logger.warn("Couldn't get resource paths for " + resource, ex); - return null; - } - } - - public URL getResource(String path) throws MalformedURLException { - Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); - if (!resource.exists()) { - return null; - } - try { - return resource.getURL(); - } - catch (MalformedURLException ex) { - throw ex; - } - catch (IOException ex) { - logger.warn("Couldn't get URL for " + resource, ex); - return null; - } - } - - public InputStream getResourceAsStream(String path) { - Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); - if (!resource.exists()) { - return null; - } - try { - return resource.getInputStream(); - } - catch (IOException ex) { - logger.warn("Couldn't open InputStream for " + resource, ex); - return null; - } - } - - public RequestDispatcher getRequestDispatcher(String path) { - if (!path.startsWith("/")) { - throw new IllegalArgumentException("RequestDispatcher path at ServletContext level must start with '/'"); - } - return new MockRequestDispatcher(path); - } - - public RequestDispatcher getNamedDispatcher(String path) { - return this.namedRequestDispatchers.get(path); - } - - /** - * Register a {@link RequestDispatcher} (typically a {@link MockRequestDispatcher}) - * that acts as a wrapper for the named Servlet. - * - * @param name the name of the wrapped Servlet - * @param requestDispatcher the dispatcher that wraps the named Servlet - * @see #getNamedDispatcher - * @see #unregisterNamedDispatcher - */ - public void registerNamedDispatcher(String name, RequestDispatcher requestDispatcher) { - Assert.notNull(name, "RequestDispatcher name must not be null"); - Assert.notNull(requestDispatcher, "RequestDispatcher must not be null"); - this.namedRequestDispatchers.put(name, requestDispatcher); - } - - /** - * Unregister the {@link RequestDispatcher} with the given name. - * - * @param name the name of the dispatcher to unregister - * @see #getNamedDispatcher - * @see #registerNamedDispatcher - */ - public void unregisterNamedDispatcher(String name) { - Assert.notNull(name, "RequestDispatcher name must not be null"); - this.namedRequestDispatchers.remove(name); - } - - /** - * Get the name of the default {@code Servlet}. - *

Defaults to {@value #COMMON_DEFAULT_SERVLET_NAME}. - * @see #setDefaultServletName - */ - public String getDefaultServletName() { - return this.defaultServletName; - } - - /** - * Set the name of the default {@code Servlet}. - *

Also {@link #unregisterNamedDispatcher unregisters} the current default - * {@link RequestDispatcher} and {@link #registerNamedDispatcher replaces} - * it with a {@link MockRequestDispatcher} for the provided - * {@code defaultServletName}. - * @param defaultServletName the name of the default {@code Servlet}; - * never {@code null} or empty - * @see #getDefaultServletName - */ - public void setDefaultServletName(String defaultServletName) { - Assert.hasText(defaultServletName, "defaultServletName must not be null or empty"); - unregisterNamedDispatcher(this.defaultServletName); - this.defaultServletName = defaultServletName; - registerNamedDispatcher(this.defaultServletName, new MockRequestDispatcher(this.defaultServletName)); - } - - public Servlet getServlet(String name) { - return null; - } - - public Enumeration getServlets() { - return Collections.enumeration(new HashSet()); - } - - public Enumeration getServletNames() { - return Collections.enumeration(new HashSet()); - } - - public void log(String message) { - logger.info(message); - } - - public void log(Exception ex, String message) { - logger.info(message, ex); - } - - public void log(String message, Throwable ex) { - logger.info(message, ex); - } - - public String getRealPath(String path) { - Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); - try { - return resource.getFile().getAbsolutePath(); - } - catch (IOException ex) { - logger.warn("Couldn't determine real path of resource " + resource, ex); - return null; - } - } - - public String getServerInfo() { - return "MockServletContext"; - } - - public String getInitParameter(String name) { - Assert.notNull(name, "Parameter name must not be null"); - return this.initParameters.get(name); - } - - public Enumeration getInitParameterNames() { - return Collections.enumeration(this.initParameters.keySet()); - } - - public boolean setInitParameter(String name, String value) { - Assert.notNull(name, "Parameter name must not be null"); - if (this.initParameters.containsKey(name)) { - return false; - } - this.initParameters.put(name, value); - return true; - } - - public void addInitParameter(String name, String value) { - Assert.notNull(name, "Parameter name must not be null"); - this.initParameters.put(name, value); - } - - public Object getAttribute(String name) { - Assert.notNull(name, "Attribute name must not be null"); - return this.attributes.get(name); - } - - public Enumeration getAttributeNames() { - return new Vector(this.attributes.keySet()).elements(); - } - - public void setAttribute(String name, Object value) { - Assert.notNull(name, "Attribute name must not be null"); - if (value != null) { - this.attributes.put(name, value); - } - else { - this.attributes.remove(name); - } - } - - public void removeAttribute(String name) { - Assert.notNull(name, "Attribute name must not be null"); - this.attributes.remove(name); - } - - public void setServletContextName(String servletContextName) { - this.servletContextName = servletContextName; - } - - public String getServletContextName() { - return this.servletContextName; - } - - public ClassLoader getClassLoader() { - return ClassUtils.getDefaultClassLoader(); - } - - public void declareRoles(String... roleNames) { - Assert.notNull(roleNames, "Role names array must not be null"); - for (String roleName : roleNames) { - Assert.hasLength(roleName, "Role name must not be empty"); - this.declaredRoles.add(roleName); - } - } - - public Set getDeclaredRoles() { - return Collections.unmodifiableSet(this.declaredRoles); - } - - - /** - * Inner factory class used to introduce a Java Activation Framework - * dependency when actually asked to resolve a MIME type. - */ - private static class MimeTypeResolver { - - public static String getMimeType(String filePath) { - return FileTypeMap.getDefaultFileTypeMap().getContentType(filePath); - } - } - -} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockActionResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockActionResponse.java index bec6687887c..423cbb0c34b 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockActionResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockActionResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -59,6 +59,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action } + @Override public void setWindowState(WindowState windowState) throws WindowStateException { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called"); @@ -67,6 +68,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectAllowed = false; } + @Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set PortletMode after sendRedirect has been called"); @@ -75,6 +77,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectAllowed = false; } + @Override public void setRenderParameters(Map parameters) { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called"); @@ -83,6 +86,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectAllowed = false; } + @Override public void setRenderParameter(String key, String value) { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called"); @@ -91,6 +95,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectAllowed = false; } + @Override public void setRenderParameter(String key, String[] values) { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called"); @@ -99,6 +104,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectAllowed = false; } + @Override public void sendRedirect(String location) throws IOException { if (!this.redirectAllowed) { throw new IllegalStateException( @@ -108,6 +114,7 @@ public class MockActionResponse extends MockStateAwareResponse implements Action this.redirectedUrl = location; } + @Override public void sendRedirect(String location, String renderUrlParamName) throws IOException { sendRedirect(location); if (renderUrlParamName != null) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockBaseURL.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockBaseURL.java index aad992058b9..28662358c02 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockBaseURL.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockBaseURL.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -56,18 +56,21 @@ public abstract class MockBaseURL implements BaseURL { // BaseURL methods //--------------------------------------------------------------------- + @Override public void setParameter(String key, String value) { Assert.notNull(key, "Parameter key must be null"); Assert.notNull(value, "Parameter value must not be null"); this.parameters.put(key, new String[] {value}); } + @Override public void setParameter(String key, String[] values) { Assert.notNull(key, "Parameter key must be null"); Assert.notNull(values, "Parameter values must not be null"); this.parameters.put(key, values); } + @Override public void setParameters(Map parameters) { Assert.notNull(parameters, "Parameters Map must not be null"); this.parameters.clear(); @@ -87,10 +90,12 @@ public abstract class MockBaseURL implements BaseURL { return this.parameters.get(name); } + @Override public Map getParameterMap() { return Collections.unmodifiableMap(this.parameters); } + @Override public void setSecure(boolean secure) throws PortletSecurityException { this.secure = secure; } @@ -99,14 +104,17 @@ public abstract class MockBaseURL implements BaseURL { return this.secure; } + @Override public void write(Writer out) throws IOException { out.write(toString()); } + @Override public void write(Writer out, boolean escapeXML) throws IOException { out.write(toString()); } + @Override public void addProperty(String key, String value) { String[] values = this.properties.get(key); if (values != null) { @@ -117,6 +125,7 @@ public abstract class MockBaseURL implements BaseURL { } } + @Override public void setProperty(String key, String value) { this.properties.put(key, new String[] {value}); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockCacheControl.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockCacheControl.java index 0ee9fbeb7c7..109133a2b64 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockCacheControl.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockCacheControl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -35,34 +35,42 @@ public class MockCacheControl implements CacheControl { private boolean useCachedContent = false; + @Override public int getExpirationTime() { return this.expirationTime; } + @Override public void setExpirationTime(int time) { this.expirationTime = time; } + @Override public boolean isPublicScope() { return this.publicScope; } + @Override public void setPublicScope(boolean publicScope) { this.publicScope = publicScope; } + @Override public String getETag() { return this.etag; } + @Override public void setETag(String token) { this.etag = token; } + @Override public boolean useCachedContent() { return this.useCachedContent; } + @Override public void setUseCachedContent(boolean useCachedContent) { this.useCachedContent = useCachedContent; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockClientDataRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockClientDataRequest.java index 8f36c3a7640..beccbcf59a5 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockClientDataRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockClientDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -76,6 +76,7 @@ public class MockClientDataRequest extends MockPortletRequest implements ClientD this.content = content; } + @Override public InputStream getPortletInputStream() throws IOException { if (this.content != null) { return new ByteArrayInputStream(this.content); @@ -85,10 +86,12 @@ public class MockClientDataRequest extends MockPortletRequest implements ClientD } } + @Override public void setCharacterEncoding(String characterEncoding) { this.characterEncoding = characterEncoding; } + @Override public BufferedReader getReader() throws UnsupportedEncodingException { if (this.content != null) { InputStream sourceStream = new ByteArrayInputStream(this.content); @@ -101,6 +104,7 @@ public class MockClientDataRequest extends MockPortletRequest implements ClientD } } + @Override public String getCharacterEncoding() { return this.characterEncoding; } @@ -109,10 +113,12 @@ public class MockClientDataRequest extends MockPortletRequest implements ClientD this.contentType = contentType; } + @Override public String getContentType() { return this.contentType; } + @Override public int getContentLength() { return (this.content != null ? content.length : -1); } @@ -121,6 +127,7 @@ public class MockClientDataRequest extends MockPortletRequest implements ClientD this.method = method; } + @Override public String getMethod() { return this.method; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEvent.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEvent.java index 0dc7efaba8d..daa15e51565 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEvent.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -73,14 +73,17 @@ public class MockEvent implements Event { } + @Override public QName getQName() { return this.name; } + @Override public String getName() { return this.name.getLocalPart(); } + @Override public Serializable getValue() { return this.value; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventRequest.java index 2406f18d01c..d29d7865c40 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -73,6 +73,7 @@ public class MockEventRequest extends MockPortletRequest implements EventRequest return EVENT_PHASE; } + @Override public Event getEvent() { return this.event; } @@ -81,6 +82,7 @@ public class MockEventRequest extends MockPortletRequest implements EventRequest this.method = method; } + @Override public String getMethod() { return this.method; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventResponse.java index 1a00e8b2d55..1114d0081bd 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockEventResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -27,6 +27,7 @@ import javax.portlet.EventResponse; */ public class MockEventResponse extends MockStateAwareResponse implements EventResponse { + @Override public void setRenderParameters(EventRequest request) { setRenderParameters(request.getParameterMap()); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMimeResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMimeResponse.java index e606fc808d2..0a48975f691 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMimeResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMimeResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -101,6 +101,7 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons // RenderResponse methods //--------------------------------------------------------------------- + @Override public void setContentType(String contentType) { if (this.request != null) { Enumeration supportedTypes = this.request.getResponseContentTypes(); @@ -112,6 +113,7 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.contentType = contentType; } + @Override public String getContentType() { return this.contentType; } @@ -120,10 +122,12 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.characterEncoding = characterEncoding; } + @Override public String getCharacterEncoding() { return this.characterEncoding; } + @Override public PrintWriter getWriter() throws UnsupportedEncodingException { if (this.writer == null) { Writer targetWriter = (this.characterEncoding != null @@ -150,18 +154,22 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.locale = locale; } + @Override public Locale getLocale() { return this.locale; } + @Override public void setBufferSize(int bufferSize) { this.bufferSize = bufferSize; } + @Override public int getBufferSize() { return this.bufferSize; } + @Override public void flushBuffer() { if (this.writer != null) { this.writer.flush(); @@ -177,6 +185,7 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.committed = true; } + @Override public void resetBuffer() { if (this.committed) { throw new IllegalStateException("Cannot reset buffer - response is already committed"); @@ -188,10 +197,12 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.committed = committed; } + @Override public boolean isCommitted() { return this.committed; } + @Override public void reset() { resetBuffer(); this.characterEncoding = null; @@ -199,22 +210,27 @@ public class MockMimeResponse extends MockPortletResponse implements MimeRespons this.locale = null; } + @Override public OutputStream getPortletOutputStream() throws IOException { return this.outputStream; } + @Override public PortletURL createRenderURL() { return new MockPortletURL(getPortalContext(), MockPortletURL.URL_TYPE_RENDER); } + @Override public PortletURL createActionURL() { return new MockPortletURL(getPortalContext(), MockPortletURL.URL_TYPE_ACTION); } + @Override public ResourceURL createResourceURL() { return new MockResourceURL(); } + @Override public CacheControl getCacheControl() { return this.cacheControl; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMultipartActionRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMultipartActionRequest.java index 7df8b547b09..e269a621e1a 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMultipartActionRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockMultipartActionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -56,14 +56,17 @@ public class MockMultipartActionRequest extends MockActionRequest implements Mul this.multipartFiles.add(file.getName(), file); } + @Override public Iterator getFileNames() { return this.multipartFiles.keySet().iterator(); } + @Override public MultipartFile getFile(String name) { return this.multipartFiles.getFirst(name); } + @Override public List getFiles(String name) { List multipartFiles = this.multipartFiles.get(name); if (multipartFiles != null) { @@ -74,14 +77,17 @@ public class MockMultipartActionRequest extends MockActionRequest implements Mul } } + @Override public Map getFileMap() { return this.multipartFiles.toSingleValueMap(); } + @Override public MultiValueMap getMultiFileMap() { return new LinkedMultiValueMap(this.multipartFiles); } + @Override public String getMultipartContentType(String paramOrFileName) { MultipartFile file = getFile(paramOrFileName); if (file != null) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortalContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortalContext.java index 949d077b9a2..824df6f70d3 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortalContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortalContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -74,6 +74,7 @@ public class MockPortalContext implements PortalContext { } + @Override public String getPortalInfo() { return "MockPortal/1.0"; } @@ -82,18 +83,22 @@ public class MockPortalContext implements PortalContext { this.properties.put(name, value); } + @Override public String getProperty(String name) { return this.properties.get(name); } + @Override public Enumeration getPropertyNames() { return Collections.enumeration(this.properties.keySet()); } + @Override public Enumeration getSupportedPortletModes() { return Collections.enumeration(this.portletModes); } + @Override public Enumeration getSupportedWindowStates() { return Collections.enumeration(this.windowStates); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletConfig.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletConfig.java index 985c1e20dca..cf7f48bb176 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletConfig.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -96,10 +96,12 @@ public class MockPortletConfig implements PortletConfig { } + @Override public String getPortletName() { return this.portletName; } + @Override public PortletContext getPortletContext() { return this.portletContext; } @@ -109,6 +111,7 @@ public class MockPortletConfig implements PortletConfig { this.resourceBundles.put(locale, resourceBundle); } + @Override public ResourceBundle getResourceBundle(Locale locale) { Assert.notNull(locale, "Locale must not be null"); return this.resourceBundles.get(locale); @@ -119,11 +122,13 @@ public class MockPortletConfig implements PortletConfig { this.initParameters.put(name, value); } + @Override public String getInitParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.initParameters.get(name); } + @Override public Enumeration getInitParameterNames() { return Collections.enumeration(this.initParameters.keySet()); } @@ -132,6 +137,7 @@ public class MockPortletConfig implements PortletConfig { this.publicRenderParameterNames.add(name); } + @Override public Enumeration getPublicRenderParameterNames() { return Collections.enumeration(this.publicRenderParameterNames); } @@ -140,6 +146,7 @@ public class MockPortletConfig implements PortletConfig { this.defaultNamespace = defaultNamespace; } + @Override public String getDefaultNamespace() { return this.defaultNamespace; } @@ -148,6 +155,7 @@ public class MockPortletConfig implements PortletConfig { this.publishingEventQNames.add(name); } + @Override public Enumeration getPublishingEventQNames() { return Collections.enumeration(this.publishingEventQNames); } @@ -156,6 +164,7 @@ public class MockPortletConfig implements PortletConfig { this.processingEventQNames.add(name); } + @Override public Enumeration getProcessingEventQNames() { return Collections.enumeration(this.processingEventQNames); } @@ -164,6 +173,7 @@ public class MockPortletConfig implements PortletConfig { this.supportedLocales.add(locale); } + @Override public Enumeration getSupportedLocales() { return Collections.enumeration(this.supportedLocales); } @@ -176,6 +186,7 @@ public class MockPortletConfig implements PortletConfig { this.containerRuntimeOptions.put(key, values); } + @Override public Map getContainerRuntimeOptions() { return Collections.unmodifiableMap(this.containerRuntimeOptions); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletContext.java index cd8c997e37d..902991ab987 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -124,10 +124,12 @@ public class MockPortletContext implements PortletContext { } + @Override public String getServerInfo() { return "MockPortal/1.0"; } + @Override public PortletRequestDispatcher getRequestDispatcher(String path) { if (!path.startsWith("/")) { throw new IllegalArgumentException( @@ -136,10 +138,12 @@ public class MockPortletContext implements PortletContext { return new MockPortletRequestDispatcher(path); } + @Override public PortletRequestDispatcher getNamedDispatcher(String path) { return null; } + @Override public InputStream getResourceAsStream(String path) { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); try { @@ -151,18 +155,22 @@ public class MockPortletContext implements PortletContext { } } + @Override public int getMajorVersion() { return 2; } + @Override public int getMinorVersion() { return 0; } + @Override public String getMimeType(String filePath) { return null; } + @Override public String getRealPath(String path) { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); try { @@ -174,6 +182,7 @@ public class MockPortletContext implements PortletContext { } } + @Override public Set getResourcePaths(String path) { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); try { @@ -192,6 +201,7 @@ public class MockPortletContext implements PortletContext { } } + @Override public URL getResource(String path) throws MalformedURLException { Resource resource = this.resourceLoader.getResource(getResourceLocation(path)); try { @@ -203,14 +213,17 @@ public class MockPortletContext implements PortletContext { } } + @Override public Object getAttribute(String name) { return this.attributes.get(name); } + @Override public Enumeration getAttributeNames() { return Collections.enumeration(this.attributes.keySet()); } + @Override public void setAttribute(String name, Object value) { if (value != null) { this.attributes.put(name, value); @@ -220,6 +233,7 @@ public class MockPortletContext implements PortletContext { } } + @Override public void removeAttribute(String name) { this.attributes.remove(name); } @@ -229,19 +243,23 @@ public class MockPortletContext implements PortletContext { this.initParameters.put(name, value); } + @Override public String getInitParameter(String name) { Assert.notNull(name, "Parameter name must not be null"); return this.initParameters.get(name); } + @Override public Enumeration getInitParameterNames() { return Collections.enumeration(this.initParameters.keySet()); } + @Override public void log(String message) { logger.info(message); } + @Override public void log(String message, Throwable t) { logger.info(message, t); } @@ -250,6 +268,7 @@ public class MockPortletContext implements PortletContext { this.portletContextName = portletContextName; } + @Override public String getPortletContextName() { return this.portletContextName; } @@ -258,6 +277,7 @@ public class MockPortletContext implements PortletContext { this.containerRuntimeOptions.add(key); } + @Override public Enumeration getContainerRuntimeOptions() { return Collections.enumeration(this.containerRuntimeOptions); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java index b885f358526..2cbefb79c1a 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -171,10 +171,12 @@ public class MockPortletRequest implements PortletRequest { // PortletRequest methods //--------------------------------------------------------------------- + @Override public boolean isWindowStateAllowed(WindowState windowState) { return CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState); } + @Override public boolean isPortletModeAllowed(PortletMode portletMode) { return CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode); } @@ -184,6 +186,7 @@ public class MockPortletRequest implements PortletRequest { this.portletMode = portletMode; } + @Override public PortletMode getPortletMode() { return this.portletMode; } @@ -193,6 +196,7 @@ public class MockPortletRequest implements PortletRequest { this.windowState = windowState; } + @Override public WindowState getWindowState() { return this.windowState; } @@ -202,6 +206,7 @@ public class MockPortletRequest implements PortletRequest { this.portletPreferences = preferences; } + @Override public PortletPreferences getPreferences() { return this.portletPreferences; } @@ -214,10 +219,12 @@ public class MockPortletRequest implements PortletRequest { } } + @Override public PortletSession getPortletSession() { return getPortletSession(true); } + @Override public PortletSession getPortletSession(boolean create) { checkActive(); // Reset session if invalidated. @@ -261,21 +268,25 @@ public class MockPortletRequest implements PortletRequest { } } + @Override public String getProperty(String key) { Assert.notNull(key, "Property key must not be null"); List list = this.properties.get(key); return (list != null && list.size() > 0 ? (String) list.get(0) : null); } + @Override public Enumeration getProperties(String key) { Assert.notNull(key, "property key must not be null"); return Collections.enumeration(this.properties.get(key)); } + @Override public Enumeration getPropertyNames() { return Collections.enumeration(this.properties.keySet()); } + @Override public PortalContext getPortalContext() { return this.portalContext; } @@ -284,6 +295,7 @@ public class MockPortletRequest implements PortletRequest { this.authType = authType; } + @Override public String getAuthType() { return this.authType; } @@ -292,6 +304,7 @@ public class MockPortletRequest implements PortletRequest { this.contextPath = contextPath; } + @Override public String getContextPath() { return this.contextPath; } @@ -300,6 +313,7 @@ public class MockPortletRequest implements PortletRequest { this.remoteUser = remoteUser; } + @Override public String getRemoteUser() { return this.remoteUser; } @@ -308,6 +322,7 @@ public class MockPortletRequest implements PortletRequest { this.userPrincipal = userPrincipal; } + @Override public Principal getUserPrincipal() { return this.userPrincipal; } @@ -316,15 +331,18 @@ public class MockPortletRequest implements PortletRequest { this.userRoles.add(role); } + @Override public boolean isUserInRole(String role) { return this.userRoles.contains(role); } + @Override public Object getAttribute(String name) { checkActive(); return this.attributes.get(name); } + @Override public Enumeration getAttributeNames() { checkActive(); return Collections.enumeration(this.attributes.keySet()); @@ -365,19 +383,23 @@ public class MockPortletRequest implements PortletRequest { } } + @Override public String getParameter(String name) { String[] arr = this.parameters.get(name); return (arr != null && arr.length > 0 ? arr[0] : null); } + @Override public Enumeration getParameterNames() { return Collections.enumeration(this.parameters.keySet()); } + @Override public String[] getParameterValues(String name) { return this.parameters.get(name); } + @Override public Map getParameterMap() { return Collections.unmodifiableMap(this.parameters); } @@ -386,10 +408,12 @@ public class MockPortletRequest implements PortletRequest { this.secure = secure; } + @Override public boolean isSecure() { return this.secure; } + @Override public void setAttribute(String name, Object value) { checkActive(); if (value != null) { @@ -400,11 +424,13 @@ public class MockPortletRequest implements PortletRequest { } } + @Override public void removeAttribute(String name) { checkActive(); this.attributes.remove(name); } + @Override public String getRequestedSessionId() { PortletSession session = this.getPortletSession(); return (session != null ? session.getId() : null); @@ -414,6 +440,7 @@ public class MockPortletRequest implements PortletRequest { this.requestedSessionIdValid = requestedSessionIdValid; } + @Override public boolean isRequestedSessionIdValid() { return this.requestedSessionIdValid; } @@ -426,10 +453,12 @@ public class MockPortletRequest implements PortletRequest { this.responseContentTypes.add(0, responseContentType); } + @Override public String getResponseContentType() { return this.responseContentTypes.get(0); } + @Override public Enumeration getResponseContentTypes() { return Collections.enumeration(this.responseContentTypes); } @@ -442,10 +471,12 @@ public class MockPortletRequest implements PortletRequest { this.locales.add(0, locale); } + @Override public Locale getLocale() { return this.locales.get(0); } + @Override public Enumeration getLocales() { return Collections.enumeration(this.locales); } @@ -454,6 +485,7 @@ public class MockPortletRequest implements PortletRequest { this.scheme = scheme; } + @Override public String getScheme() { return this.scheme; } @@ -462,6 +494,7 @@ public class MockPortletRequest implements PortletRequest { this.serverName = serverName; } + @Override public String getServerName() { return this.serverName; } @@ -470,6 +503,7 @@ public class MockPortletRequest implements PortletRequest { this.serverPort = serverPort; } + @Override public int getServerPort() { return this.serverPort; } @@ -478,6 +512,7 @@ public class MockPortletRequest implements PortletRequest { this.windowID = windowID; } + @Override public String getWindowID() { return this.windowID; } @@ -486,10 +521,12 @@ public class MockPortletRequest implements PortletRequest { this.cookies = cookies; } + @Override public Cookie[] getCookies() { return this.cookies; } + @Override public Map getPrivateParameterMap() { if (!this.publicParameterNames.isEmpty()) { Map filtered = new LinkedHashMap(); @@ -505,6 +542,7 @@ public class MockPortletRequest implements PortletRequest { } } + @Override public Map getPublicParameterMap() { if (!this.publicParameterNames.isEmpty()) { Map filtered = new LinkedHashMap(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequestDispatcher.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequestDispatcher.java index ca8695f90e2..f4e0dc98fde 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequestDispatcher.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequestDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -53,10 +53,12 @@ public class MockPortletRequestDispatcher implements PortletRequestDispatcher { } + @Override public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException { include((PortletRequest) request, (PortletResponse) response); } + @Override public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException { Assert.notNull(request, "Request must not be null"); Assert.notNull(response, "Response must not be null"); @@ -69,6 +71,7 @@ public class MockPortletRequestDispatcher implements PortletRequestDispatcher { } } + @Override public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { Assert.notNull(request, "Request must not be null"); Assert.notNull(response, "Response must not be null"); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletResponse.java index b556209fcd3..513a6c8c9c8 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -85,6 +85,7 @@ public class MockPortletResponse implements PortletResponse { // PortletResponse methods //--------------------------------------------------------------------- + @Override public void addProperty(String key, String value) { Assert.notNull(key, "Property key must not be null"); String[] oldArr = this.properties.get(key); @@ -99,6 +100,7 @@ public class MockPortletResponse implements PortletResponse { } } + @Override public void setProperty(String key, String value) { Assert.notNull(key, "Property key must not be null"); this.properties.put(key, new String[] {value}); @@ -119,6 +121,7 @@ public class MockPortletResponse implements PortletResponse { return this.properties.get(key); } + @Override public String encodeURL(String path) { return path; } @@ -127,10 +130,12 @@ public class MockPortletResponse implements PortletResponse { this.namespace = namespace; } + @Override public String getNamespace() { return this.namespace; } + @Override public void addProperty(Cookie cookie) { Assert.notNull(cookie, "Cookie must not be null"); this.cookies.add(cookie); @@ -150,6 +155,7 @@ public class MockPortletResponse implements PortletResponse { return null; } + @Override public void addProperty(String key, Element value) { Assert.notNull(key, "Property key must not be null"); Element[] oldArr = this.xmlProperties.get(key); @@ -180,6 +186,7 @@ public class MockPortletResponse implements PortletResponse { return this.xmlProperties.get(key); } + @Override public Element createElement(String tagName) throws DOMException { if (this.xmlDocument == null) { try { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletSession.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletSession.java index d9632906f76..da8aa73cac6 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletSession.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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,12 +21,13 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Map; + import javax.portlet.PortletContext; import javax.portlet.PortletSession; import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingListener; -import org.springframework.mock.web.MockHttpSession; +import org.springframework.mock.web.test.MockHttpSession; /** * Mock implementation of the {@link javax.portlet.PortletSession} interface. @@ -76,10 +77,12 @@ public class MockPortletSession implements PortletSession { } + @Override public Object getAttribute(String name) { return this.portletAttributes.get(name); } + @Override public Object getAttribute(String name, int scope) { if (scope == PortletSession.PORTLET_SCOPE) { return this.portletAttributes.get(name); @@ -90,10 +93,12 @@ public class MockPortletSession implements PortletSession { return null; } + @Override public Enumeration getAttributeNames() { return Collections.enumeration(this.portletAttributes.keySet()); } + @Override public Enumeration getAttributeNames(int scope) { if (scope == PortletSession.PORTLET_SCOPE) { return Collections.enumeration(this.portletAttributes.keySet()); @@ -104,10 +109,12 @@ public class MockPortletSession implements PortletSession { return null; } + @Override public long getCreationTime() { return this.creationTime; } + @Override public String getId() { return this.id; } @@ -117,10 +124,12 @@ public class MockPortletSession implements PortletSession { setNew(false); } + @Override public long getLastAccessedTime() { return this.lastAccessedTime; } + @Override public int getMaxInactiveInterval() { return this.maxInactiveInterval; } @@ -146,6 +155,7 @@ public class MockPortletSession implements PortletSession { } } + @Override public void invalidate() { this.invalid = true; clearAttributes(); @@ -159,14 +169,17 @@ public class MockPortletSession implements PortletSession { this.isNew = value; } + @Override public boolean isNew() { return this.isNew; } + @Override public void removeAttribute(String name) { this.portletAttributes.remove(name); } + @Override public void removeAttribute(String name, int scope) { if (scope == PortletSession.PORTLET_SCOPE) { this.portletAttributes.remove(name); @@ -176,6 +189,7 @@ public class MockPortletSession implements PortletSession { } } + @Override public void setAttribute(String name, Object value) { if (value != null) { this.portletAttributes.put(name, value); @@ -185,6 +199,7 @@ public class MockPortletSession implements PortletSession { } } + @Override public void setAttribute(String name, Object value, int scope) { if (scope == PortletSession.PORTLET_SCOPE) { if (value != null) { @@ -204,18 +219,22 @@ public class MockPortletSession implements PortletSession { } } + @Override public void setMaxInactiveInterval(int interval) { this.maxInactiveInterval = interval; } + @Override public PortletContext getPortletContext() { return this.portletContext; } + @Override public Map getAttributeMap() { return Collections.unmodifiableMap(this.portletAttributes); } + @Override public Map getAttributeMap(int scope) { if (scope == PortletSession.PORTLET_SCOPE) { return Collections.unmodifiableMap(this.portletAttributes); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletURL.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletURL.java index 12abdf57c93..89fe6a5b170 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletURL.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletURL.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -69,6 +69,7 @@ public class MockPortletURL extends MockBaseURL implements PortletURL { // PortletURL methods //--------------------------------------------------------------------- + @Override public void setWindowState(WindowState windowState) throws WindowStateException { if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) { throw new WindowStateException("WindowState not supported", windowState); @@ -76,10 +77,12 @@ public class MockPortletURL extends MockBaseURL implements PortletURL { this.windowState = windowState; } + @Override public WindowState getWindowState() { return this.windowState; } + @Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); @@ -87,10 +90,12 @@ public class MockPortletURL extends MockBaseURL implements PortletURL { this.portletMode = portletMode; } + @Override public PortletMode getPortletMode() { return this.portletMode; } + @Override public void removePublicRenderParameter(String name) { this.parameters.remove(name); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderRequest.java index d86ba7f2ad4..8b9ed2e41ad 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -86,6 +86,7 @@ public class MockRenderRequest extends MockPortletRequest implements RenderReque return RENDER_PHASE; } + @Override public String getETag() { return getProperty(RenderRequest.ETAG); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderResponse.java index a2feeb3726d..e359b0b52cc 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockRenderResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -69,6 +69,7 @@ public class MockRenderResponse extends MockMimeResponse implements RenderRespon // RenderResponse methods //--------------------------------------------------------------------- + @Override public void setTitle(String title) { this.title = title; } @@ -77,6 +78,7 @@ public class MockRenderResponse extends MockMimeResponse implements RenderRespon return this.title; } + @Override public void setNextPossiblePortletModes(Collection portletModes) { this.nextPossiblePortletModes = portletModes; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceRequest.java index 7cce4ba3c6d..5878e7b96ef 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -97,6 +97,7 @@ public class MockResourceRequest extends MockClientDataRequest implements Resour this.resourceID = resourceID; } + @Override public String getResourceID() { return this.resourceID; } @@ -105,10 +106,12 @@ public class MockResourceRequest extends MockClientDataRequest implements Resour this.cacheability = cacheLevel; } + @Override public String getCacheability() { return this.cacheability; } + @Override public String getETag() { return getProperty(RenderRequest.ETAG); } @@ -121,6 +124,7 @@ public class MockResourceRequest extends MockClientDataRequest implements Resour this.privateRenderParameterMap.put(key, values); } + @Override public Map getPrivateRenderParameterMap() { return Collections.unmodifiableMap(this.privateRenderParameterMap); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceResponse.java index 297a19682ea..4c7f45279b9 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -29,6 +29,7 @@ public class MockResourceResponse extends MockMimeResponse implements ResourceRe private int contentLength = 0; + @Override public void setContentLength(int len) { this.contentLength = len; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceURL.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceURL.java index cce36b18d55..a0cf72f022c 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceURL.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockResourceURL.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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 @@ public class MockResourceURL extends MockBaseURL implements ResourceURL { // ResourceURL methods //--------------------------------------------------------------------- + @Override public void setResourceID(String resourceID) { this.resourceID = resourceID; } @@ -44,10 +45,12 @@ public class MockResourceURL extends MockBaseURL implements ResourceURL { return this.resourceID; } + @Override public void setCacheability(String cacheLevel) { this.cacheability = cacheLevel; } + @Override public String getCacheability() { return this.cacheability; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java index 68536584471..93ddad81d00 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -68,6 +68,7 @@ public class MockStateAwareResponse extends MockPortletResponse implements State } + @Override public void setWindowState(WindowState windowState) throws WindowStateException { if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) { throw new WindowStateException("WindowState not supported", windowState); @@ -75,10 +76,12 @@ public class MockStateAwareResponse extends MockPortletResponse implements State this.windowState = windowState; } + @Override public WindowState getWindowState() { return this.windowState; } + @Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); @@ -86,22 +89,26 @@ public class MockStateAwareResponse extends MockPortletResponse implements State this.portletMode = portletMode; } + @Override public PortletMode getPortletMode() { return this.portletMode; } + @Override public void setRenderParameters(Map parameters) { Assert.notNull(parameters, "Parameters Map must not be null"); this.renderParameters.clear(); this.renderParameters.putAll(parameters); } + @Override public void setRenderParameter(String key, String value) { Assert.notNull(key, "Parameter key must not be null"); Assert.notNull(value, "Parameter value must not be null"); this.renderParameters.put(key, new String[] {value}); } + @Override public void setRenderParameter(String key, String[] values) { Assert.notNull(key, "Parameter key must not be null"); Assert.notNull(values, "Parameter values must not be null"); @@ -123,18 +130,22 @@ public class MockStateAwareResponse extends MockPortletResponse implements State return this.renderParameters.keySet().iterator(); } + @Override public Map getRenderParameterMap() { return Collections.unmodifiableMap(this.renderParameters); } + @Override public void removePublicRenderParameter(String name) { this.renderParameters.remove(name); } + @Override public void setEvent(QName name, Serializable value) { this.events.put(name, value); } + @Override public void setEvent(String name, Serializable value) { this.events.put(new QName(name), value); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/ServletWrappingPortletContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/ServletWrappingPortletContext.java index a333984f48a..8a7150757a5 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/ServletWrappingPortletContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/ServletWrappingPortletContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -59,85 +59,105 @@ public class ServletWrappingPortletContext implements PortletContext { } + @Override public String getServerInfo() { return this.servletContext.getServerInfo(); } + @Override public PortletRequestDispatcher getRequestDispatcher(String path) { return null; } + @Override public PortletRequestDispatcher getNamedDispatcher(String name) { return null; } + @Override public InputStream getResourceAsStream(String path) { return this.servletContext.getResourceAsStream(path); } + @Override public int getMajorVersion() { return 2; } + @Override public int getMinorVersion() { return 0; } + @Override public String getMimeType(String file) { return this.servletContext.getMimeType(file); } + @Override public String getRealPath(String path) { return this.servletContext.getRealPath(path); } + @Override @SuppressWarnings("unchecked") public Set getResourcePaths(String path) { return this.servletContext.getResourcePaths(path); } + @Override public URL getResource(String path) throws MalformedURLException { return this.servletContext.getResource(path); } + @Override public Object getAttribute(String name) { return this.servletContext.getAttribute(name); } + @Override @SuppressWarnings("unchecked") public Enumeration getAttributeNames() { return this.servletContext.getAttributeNames(); } + @Override public String getInitParameter(String name) { return this.servletContext.getInitParameter(name); } + @Override @SuppressWarnings("unchecked") public Enumeration getInitParameterNames() { return this.servletContext.getInitParameterNames(); } + @Override public void log(String msg) { this.servletContext.log(msg); } + @Override public void log(String message, Throwable throwable) { this.servletContext.log(message, throwable); } + @Override public void removeAttribute(String name) { this.servletContext.removeAttribute(name); } + @Override public void setAttribute(String name, Object object) { this.servletContext.setAttribute(name, object); } + @Override public String getPortletContextName() { return this.servletContext.getServletContextName(); } + @Override public Enumeration getContainerRuntimeOptions() { return Collections.enumeration(new HashSet()); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java index f2fc531e763..b1b1459ee75 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; + import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.EventRequest; @@ -47,9 +48,9 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.core.Ordered; -import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.portlet.MockPortletConfig; import org.springframework.mock.web.portlet.MockPortletContext; +import org.springframework.mock.web.test.MockMultipartFile; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.multipart.MaxUploadSizeExceededException; @@ -80,6 +81,7 @@ import org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter; */ public class ComplexPortletApplicationContext extends StaticPortletApplicationContext { + @Override public void refresh() throws BeansException { registerSingleton("standardHandlerAdapter", SimpleControllerHandlerAdapter.class); registerSingleton("portletHandlerAdapter", SimplePortletHandlerAdapter.class); @@ -185,10 +187,12 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class TestController1 implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) { response.setRenderParameter("result", "test1-action"); } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { return null; } @@ -197,8 +201,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class TestController2 implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) {} + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { response.setProperty("result", "test2-view"); return null; @@ -208,8 +214,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class ViewController implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) {} + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { return new ModelAndView("someViewName", "result", "view was here"); } @@ -218,10 +226,12 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class EditController implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) { response.setRenderParameter("param", "edit was here"); } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { return new ModelAndView(request.getParameter("param")); } @@ -230,10 +240,12 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class HelpController1 implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) { response.setRenderParameter("param", "help1 was here"); } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { return new ModelAndView("help1-view"); } @@ -242,10 +254,12 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class HelpController2 implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) { response.setRenderParameter("param", "help2 was here"); } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception { return new ModelAndView("help2-view"); } @@ -253,12 +267,14 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class RequestLocaleCheckingController implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) throws PortletException { if (!Locale.CANADA.equals(request.getLocale())) { throw new PortletException("Incorrect Locale in ActionRequest"); } } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws PortletException, IOException { if (!Locale.CANADA.equals(request.getLocale())) { @@ -272,12 +288,14 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class LocaleContextCheckingController implements Controller { + @Override public void handleActionRequest(ActionRequest request, ActionResponse response) throws PortletException { if (!Locale.CANADA.equals(LocaleContextHolder.getLocale())) { throw new PortletException("Incorrect Locale in LocaleContextHolder"); } } + @Override public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws PortletException, IOException { if (!Locale.CANADA.equals(LocaleContextHolder.getLocale())) { @@ -293,14 +311,17 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo private PortletConfig portletConfig; + @Override public void init(PortletConfig portletConfig) throws PortletException { this.portletConfig = portletConfig; } + @Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException { response.setRenderParameter("result", "myPortlet action called"); } + @Override public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException { response.getWriter().write("myPortlet was here"); } @@ -309,6 +330,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo return this.portletConfig; } + @Override public void destroy() { this.portletConfig = null; } @@ -323,6 +345,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class ExceptionThrowingHandler implements MyHandler { + @Override public void doSomething(PortletRequest request) throws Exception { if (request.getParameter("fail") != null) { throw new ModelAndViewDefiningException(new ModelAndView("failed-modelandview")); @@ -346,28 +369,34 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class MyHandlerAdapter implements HandlerAdapter, Ordered { + @Override public int getOrder() { return 99; } + @Override public boolean supports(Object handler) { return handler != null && MyHandler.class.isAssignableFrom(handler.getClass()); } + @Override public void handleAction(ActionRequest request, ActionResponse response, Object delegate) throws Exception { ((MyHandler) delegate).doSomething(request); } + @Override public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object delegate) throws Exception { ((MyHandler) delegate).doSomething(request); return null; } + @Override public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler) throws Exception { return null; } + @Override public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception { } } @@ -375,6 +404,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class MyHandlerInterceptor1 extends HandlerInterceptorAdapter { + @Override public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler) throws PortletException { if (request.getAttribute("test2-remove-never") != null) { @@ -386,6 +416,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo return true; } + @Override public void postHandleRender( RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws PortletException { @@ -398,6 +429,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo request.removeAttribute("test1-remove-post"); } + @Override public void afterRenderCompletion( RenderRequest request, RenderResponse response, Object handler, Exception ex) throws PortletException { @@ -411,6 +443,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class MyHandlerInterceptor2 extends HandlerInterceptorAdapter { + @Override public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler) throws PortletException { if (request.getAttribute("test1-remove-post") == null) { @@ -425,6 +458,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo return true; } + @Override public void postHandleRender( RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws PortletException { @@ -440,6 +474,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo request.removeAttribute("test2-remove-post"); } + @Override public void afterRenderCompletion( RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception { @@ -453,6 +488,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class MultipartCheckingHandler implements MyHandler { + @Override public void doSomething(PortletRequest request) throws PortletException, IllegalAccessException { if (!(request instanceof MultipartActionRequest)) { throw new PortletException("Not in a MultipartActionRequest"); @@ -463,10 +499,12 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public static class MockMultipartResolver implements PortletMultipartResolver { + @Override public boolean isMultipart(ActionRequest request) { return true; } + @Override public MultipartActionRequest resolveMultipart(ActionRequest request) throws MultipartException { if (request.getAttribute("fail") != null) { throw new MaxUploadSizeExceededException(1000); @@ -485,6 +523,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo return new DefaultMultipartActionRequest(request, files, params, Collections.emptyMap()); } + @Override public void cleanupMultipart(MultipartActionRequest request) { if (request.getAttribute("cleanedUp") != null) { throw new IllegalStateException("Already cleaned up"); @@ -498,6 +537,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo public int counter = 0; + @Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof PortletRequestHandledEvent) { this.counter++; diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java index b624737c1b0..fdb7d9df461 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java @@ -1,5 +1,5 @@ /* -* Copyright 2002-2012 the original author or authors. +* Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import javax.portlet.PortletSession; import junit.framework.TestCase; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.i18n.LocaleContext; @@ -73,6 +73,7 @@ public class DispatcherPortletTests extends TestCase { private DispatcherPortlet complexDispatcherPortlet; + @Override protected void setUp() throws PortletException { simplePortletConfig = new MockPortletConfig(new MockPortletContext(), "simple"); complexPortletConfig = new MockPortletConfig(simplePortletConfig.getPortletContext(), "complex"); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/GenericPortletBeanTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/GenericPortletBeanTests.java index e0256a341de..7028c8bb336 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/GenericPortletBeanTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/GenericPortletBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/SimplePortletApplicationContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/SimplePortletApplicationContext.java index b2bc75c7033..3f53c7edfad 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/SimplePortletApplicationContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/SimplePortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import javax.portlet.RenderResponse; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.ManagedMap; import org.springframework.validation.BindException; @@ -44,6 +44,7 @@ public class SimplePortletApplicationContext extends StaticPortletApplicationCon private String renderCommandSessionAttributeName; private String formSessionAttributeName; + @Override public void refresh() throws BeansException { MutablePropertyValues pvs = new MutablePropertyValues(); registerSingleton("controller1", TestFormController.class, pvs); @@ -98,17 +99,20 @@ public class SimplePortletApplicationContext extends StaticPortletApplicationCon this.setFormView("form"); } + @Override public void doSubmitAction(Object command) { TestBean testBean = (TestBean) command; testBean.setAge(testBean.getAge() + 10); } + @Override public ModelAndView showForm(RenderRequest request, RenderResponse response, BindException errors) throws Exception { TestBean testBean = (TestBean) errors.getModel().get(getCommandName()); this.writeResponse(response, testBean, false); return null; } + @Override public ModelAndView onSubmitRender(RenderRequest request, RenderResponse response, Object command, BindException errors) throws IOException { TestBean testBean = (TestBean) command; @@ -128,6 +132,7 @@ public class SimplePortletApplicationContext extends StaticPortletApplicationCon response.getWriter().write((finished ? "finished" : "") + (testBean.getAge() + 5)); } + @Override public void handleEventRequest(EventRequest request, EventResponse response) throws Exception { response.setRenderParameter("event", request.getEvent().getName()); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java index da9b841c1b0..3bf24624893 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -20,15 +20,15 @@ import java.beans.PropertyEditorSupport; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.Set; import junit.framework.TestCase; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; -import org.springframework.core.CollectionFactory; import org.springframework.mock.web.portlet.MockPortletRequest; import org.springframework.validation.BindingResult; @@ -70,6 +70,7 @@ public class PortletRequestDataBinderTests extends TestCase { PortletRequestDataBinder binder = new PortletRequestDataBinder(bean); binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text)); } @@ -165,7 +166,7 @@ public class PortletRequestDataBinderTests extends TestCase { public void testBindingSet() { TestBean bean = new TestBean(); - Set set = CollectionFactory.createLinkedSetIfPossible(2); + Set set = new LinkedHashSet<>(2); set.add(new TestBean("test1")); set.add(new TestBean("test2")); bean.setSomeSet(set); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValuesTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValuesTests.java index 765e4c65523..a40f0d47c0e 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValuesTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestParameterPropertyValuesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java index 3730a69e12b..8092d835b32 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java @@ -18,6 +18,9 @@ package org.springframework.web.portlet.bind; import junit.framework.TestCase; +import org.junit.Test; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; import org.springframework.mock.web.portlet.MockPortletRequest; import org.springframework.util.StopWatch; @@ -28,8 +31,9 @@ import static org.junit.Assert.*; * @author Juergen Hoeller * @author Mark Fisher */ -public class PortletRequestUtilsTests extends TestCase { +public class PortletRequestUtilsTests { + @Test public void testIntParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "5"); @@ -68,6 +72,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testIntParameters() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param", new String[] {"1", "2", "3"}); @@ -90,9 +95,9 @@ public class PortletRequestUtilsTests extends TestCase { catch (PortletRequestBindingException ex) { // expected } - } + @Test public void testLongParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "5"); @@ -131,6 +136,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testLongParameters() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.setParameter("param", new String[] {"1", "2", "3"}); @@ -162,6 +168,7 @@ public class PortletRequestUtilsTests extends TestCase { assertEquals(2, values[1]); } + @Test public void testFloatParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "5.5"); @@ -200,6 +207,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testFloatParameters() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param", new String[] {"1.5", "2.5", "3"}); @@ -224,6 +232,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testDoubleParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "5.5"); @@ -262,6 +271,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testDoubleParameters() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param", new String[] {"1.5", "2.5", "3"}); @@ -286,6 +296,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testBooleanParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "true"); @@ -319,6 +330,7 @@ public class PortletRequestUtilsTests extends TestCase { assertFalse(PortletRequestUtils.getRequiredBooleanParameter(request, "paramEmpty")); } + @Test public void testBooleanParameters() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param", new String[] {"true", "yes", "off", "1", "bogus"}); @@ -342,6 +354,7 @@ public class PortletRequestUtilsTests extends TestCase { } } + @Test public void testStringParameter() throws PortletRequestBindingException { MockPortletRequest request = new MockPortletRequest(); request.addParameter("param1", "str"); @@ -365,7 +378,9 @@ public class PortletRequestUtilsTests extends TestCase { assertEquals("", PortletRequestUtils.getRequiredStringParameter(request, "paramEmpty")); } + @Test public void testGetIntParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -376,7 +391,9 @@ public class PortletRequestUtilsTests extends TestCase { assertThat(sw.getTotalTimeMillis(), lessThan(250L)); } + @Test public void testGetLongParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -387,7 +404,9 @@ public class PortletRequestUtilsTests extends TestCase { assertThat(sw.getTotalTimeMillis(), lessThan(250L)); } + @Test public void testGetFloatParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -398,7 +417,9 @@ public class PortletRequestUtilsTests extends TestCase { assertThat(sw.getTotalTimeMillis(), lessThan(350L)); } + @Test public void testGetDoubleParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -409,7 +430,9 @@ public class PortletRequestUtilsTests extends TestCase { assertThat(sw.getTotalTimeMillis(), lessThan(250L)); } + @Test public void testGetBooleanParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); @@ -420,7 +443,9 @@ public class PortletRequestUtilsTests extends TestCase { assertThat(sw.getTotalTimeMillis(), lessThan(250L)); } + @Test public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() { + Assume.group(TestGroup.PERFORMANCE); MockPortletRequest request = new MockPortletRequest(); StopWatch sw = new StopWatch(); sw.start(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/AbstractXmlWebApplicationContextTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/AbstractXmlWebApplicationContextTests.java index 98f3b178582..bec09daa5e2 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/AbstractXmlWebApplicationContextTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/AbstractXmlWebApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.web.portlet.context; import javax.servlet.ServletException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.AbstractApplicationContextTests; @@ -44,6 +44,7 @@ public abstract class AbstractXmlWebApplicationContextTests extends AbstractAppl * Overridden as we can't trust superclass method * @see org.springframework.context.AbstractApplicationContextTests#testEvents() */ + @Override public void testEvents() throws Exception { TestListener listener = (TestListener) this.applicationContext.getBean("testListener"); listener.zeroCounter(); @@ -58,6 +59,7 @@ public abstract class AbstractXmlWebApplicationContextTests extends AbstractAppl assertTrue("1 parent events after publication", parentListener.getEventCount() == 1); } + @Override public void testCount() { assertTrue("should have 14 beans, not "+ this.applicationContext.getBeanDefinitionCount(), this.applicationContext.getBeanDefinitionCount() == 14); @@ -104,6 +106,7 @@ public abstract class AbstractXmlWebApplicationContextTests extends AbstractAppl constructed = true; } + @Override public void afterPropertiesSet() { if (this.initMethodInvoked) fail(); @@ -117,6 +120,7 @@ public abstract class AbstractXmlWebApplicationContextTests extends AbstractAppl this.initMethodInvoked = true; } + @Override public void destroy() { if (this.customDestroyed) fail(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletApplicationContextScopeTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletApplicationContextScopeTests.java index 452ddb3c520..288b901f372 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletApplicationContextScopeTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletApplicationContextScopeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -16,18 +16,20 @@ package org.springframework.web.portlet.context; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + import javax.portlet.PortletContext; import javax.portlet.PortletSession; import javax.servlet.ServletContextEvent; -import static org.junit.Assert.*; import org.junit.Test; - -import org.springframework.beans.DerivedTestBean; import org.springframework.beans.factory.support.GenericBeanDefinition; -import org.springframework.mock.web.MockServletContext; import org.springframework.mock.web.portlet.MockRenderRequest; import org.springframework.mock.web.portlet.ServletWrappingPortletContext; +import org.springframework.mock.web.test.MockServletContext; +import org.springframework.tests.sample.beans.DerivedTestBean; import org.springframework.web.context.ContextCleanupListener; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.request.RequestContextHolder; @@ -125,4 +127,4 @@ public class PortletApplicationContextScopeTests { assertTrue(bean.wasDestroyed()); } -} \ No newline at end of file +} diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletConfigAwareBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletConfigAwareBean.java index 3492556e9a1..a5186f3b654 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletConfigAwareBean.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletConfigAwareBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ public class PortletConfigAwareBean implements PortletConfigAware { private PortletConfig portletConfig; + @Override public void setPortletConfig(PortletConfig portletConfig) { this.portletConfig = portletConfig; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareBean.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareBean.java index b89b393ea78..0773459f5e8 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareBean.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ public class PortletContextAwareBean implements PortletContextAware { private PortletContext portletContext; + @Override public void setPortletContext(PortletContext portletContext) { this.portletContext = portletContext; } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareProcessorTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareProcessorTests.java index 28b89a96cf7..2f526c27e8a 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareProcessorTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletContextAwareProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java index 5ae98802923..e52c722b2c3 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/applicationContext.xml b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/applicationContext.xml index 04bc32bb88d..9a4a2163138 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/applicationContext.xml +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/applicationContext.xml @@ -9,7 +9,7 @@ - + - + dummy @@ -45,7 +45,7 @@ Tests of lifecycle callbacks --> + class="org.springframework.tests.sample.beans.MustBeInitialized"> - + yetanotherdummy diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/test-servlet.xml b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/test-servlet.xml index 4002703b211..85885f238d0 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/test-servlet.xml +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/WEB-INF/test-servlet.xml @@ -15,7 +15,7 @@ - + Rod 31 @@ -28,32 +28,32 @@ 31 - + - + Kerry 34 - + typeMismatch 34x - + - + false - + listenerVeto 66 - + diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/XmlPortletApplicationContextTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/XmlPortletApplicationContextTests.java index 148943c06de..2df278bba00 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/XmlPortletApplicationContextTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/XmlPortletApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -22,7 +22,7 @@ import javax.portlet.PortletConfig; import javax.portlet.PortletContext; import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -41,6 +41,7 @@ public class XmlPortletApplicationContextTests extends AbstractXmlWebApplication private ConfigurablePortletApplicationContext root; + @Override protected ConfigurableApplicationContext createContext() throws Exception { root = new XmlPortletApplicationContext(); PortletContext portletContext = new MockPortletContext(); @@ -48,8 +49,10 @@ public class XmlPortletApplicationContextTests extends AbstractXmlWebApplication root.setPortletConfig(portletConfig); root.setConfigLocations(new String[] {"/org/springframework/web/portlet/context/WEB-INF/applicationContext.xml"}); root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() { + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { beanFactory.addBeanPostProcessor(new BeanPostProcessor() { + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if(bean instanceof TestBean) { ((TestBean) bean).getFriends().add("myFriend"); @@ -57,6 +60,7 @@ public class XmlPortletApplicationContextTests extends AbstractXmlWebApplication return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; } @@ -101,6 +105,7 @@ public class XmlPortletApplicationContextTests extends AbstractXmlWebApplication * Overridden in order to access the root ApplicationContext * @see org.springframework.web.context.XmlWebApplicationContextTests#testContextNesting() */ + @Override public void testContextNesting() { TestBean father = (TestBean) this.applicationContext.getBean("father"); assertTrue("Bean from root context", father != null); @@ -116,6 +121,7 @@ public class XmlPortletApplicationContextTests extends AbstractXmlWebApplication assertTrue("Custom BeanPostProcessor applied", rod.getFriends().contains("myFriend")); } + @Override public void testCount() { assertTrue("should have 16 beans, not "+ this.applicationContext.getBeanDefinitionCount(), this.applicationContext.getBeanDefinitionCount() == 16); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterHandlerMappingTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterHandlerMappingTests.java index 8f3c4a539d9..b942d1dfb38 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterHandlerMappingTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterHandlerMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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 @@ public class ParameterHandlerMappingTests extends TestCase { private ConfigurablePortletApplicationContext pac; + @Override public void setUp() throws Exception { MockPortletContext portletContext = new MockPortletContext(); pac = new XmlPortletApplicationContext(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterMappingInterceptorTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterMappingInterceptorTests.java index 4c071f74023..dea0e2c82a4 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterMappingInterceptorTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/ParameterMappingInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeHandlerMappingTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeHandlerMappingTests.java index cff6418b88b..26e4d9600fd 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeHandlerMappingTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeHandlerMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -35,6 +35,7 @@ public class PortletModeHandlerMappingTests extends TestCase { private ConfigurablePortletApplicationContext pac; + @Override public void setUp() throws Exception { MockPortletContext portletContext = new MockPortletContext(); pac = new XmlPortletApplicationContext(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMappingTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMappingTests.java index 687e4938e4a..6cfd9440f4d 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMappingTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/PortletModeParameterHandlerMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -35,6 +35,7 @@ public class PortletModeParameterHandlerMappingTests extends TestCase { private ConfigurablePortletApplicationContext pac; + @Override public void setUp() throws Exception { MockPortletContext portletContext = new MockPortletContext(); pac = new XmlPortletApplicationContext(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolverTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolverTests.java index aecf7ef773a..e00e74589a5 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolverTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/SimpleMappingExceptionResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -43,6 +43,7 @@ public class SimpleMappingExceptionResolverTests extends TestCase { private Object handler2; private Exception genericException; + @Override protected void setUp() { exceptionResolver = new SimpleMappingExceptionResolver(); request = new MockRenderRequest(); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/UserRoleAuthorizationInterceptorTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/UserRoleAuthorizationInterceptorTests.java index ef70c03718e..873b7a5fadc 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/UserRoleAuthorizationInterceptorTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/handler/UserRoleAuthorizationInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/CommandControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/CommandControllerTests.java index fdf57bb0af2..2ea777d8c40 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/CommandControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/CommandControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2013 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. @@ -32,8 +32,8 @@ import javax.portlet.WindowState; import junit.framework.TestCase; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.mock.web.portlet.MockActionRequest; import org.springframework.mock.web.portlet.MockActionResponse; @@ -52,6 +52,7 @@ import org.springframework.web.portlet.handler.PortletSessionRequiredException; /** * @author Mark Fisher */ +@Deprecated public class CommandControllerTests extends TestCase { private static final String ERRORS_KEY = "errors"; @@ -212,6 +213,7 @@ public class CommandControllerTests extends TestCase { public void testSuppressBinding() throws Exception { TestController tc = new TestController() { + @Override protected boolean suppressBinding(PortletRequest request) { return true; } @@ -236,6 +238,7 @@ public class CommandControllerTests extends TestCase { public void testWithCustomDateEditor() throws Exception { final DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); TestController tc = new TestController() { + @Override protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false)); } @@ -261,6 +264,7 @@ public class CommandControllerTests extends TestCase { public void testWithCustomDateEditorEmptyNotAllowed() throws Exception { final DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); TestController tc = new TestController() { + @Override protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false)); } @@ -287,6 +291,7 @@ public class CommandControllerTests extends TestCase { public void testWithCustomDateEditorEmptyAllowed() throws Exception { final DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); TestController tc = new TestController() { + @Override protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } @@ -310,8 +315,10 @@ public class CommandControllerTests extends TestCase { public void testNestedBindingWithPropertyEditor() throws Exception { TestController tc = new TestController() { + @Override protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) { binder.registerCustomEditor(ITestBean.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text)); } @@ -341,9 +348,11 @@ public class CommandControllerTests extends TestCase { public void testWithValidatorNotSupportingCommandClass() throws Exception { Validator v = new Validator() { + @Override public boolean supports(Class c) { return false; } + @Override public void validate(Object o, Errors e) {} }; TestController tc = new TestController(); @@ -364,9 +373,11 @@ public class CommandControllerTests extends TestCase { final String defaultMessage = "validation error!"; TestController tc = new TestController(); tc.setValidator(new Validator() { + @Override public boolean supports(Class c) { return TestBean.class.isAssignableFrom(c); } + @Override public void validate(Object o, Errors e) { e.reject(errorCode, defaultMessage); } @@ -386,9 +397,11 @@ public class CommandControllerTests extends TestCase { final String defaultMessage = "validation error!"; TestController tc = new TestController(); tc.setValidator(new Validator() { + @Override public boolean supports(Class c) { return TestBean.class.isAssignableFrom(c); } + @Override public void validate(Object o, Errors e) { ValidationUtils.rejectIfEmpty(e, "name", errorCode, defaultMessage); } @@ -413,9 +426,11 @@ public class CommandControllerTests extends TestCase { final String defaultMessage = "validation error!"; TestController tc = new TestController(); tc.setValidator(new Validator() { + @Override public boolean supports(Class c) { return TestBean.class.isAssignableFrom(c); } + @Override public void validate(Object o, Errors e) { ValidationUtils.rejectIfEmptyOrWhitespace(e, "name", errorCode, defaultMessage); } @@ -444,10 +459,12 @@ public class CommandControllerTests extends TestCase { super(TestBean.class, "testBean"); } + @Override protected void handleAction(ActionRequest request, ActionResponse response, Object command, BindException errors) { ((TestBean)command).setJedi(true); } + @Override protected ModelAndView handleRender(RenderRequest request, RenderResponse response, Object command, BindException errors) { assertNotNull(command); assertNotNull(errors); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/ParameterizableViewControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/ParameterizableViewControllerTests.java index dc35d85acde..3cb40f68cf6 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/ParameterizableViewControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/ParameterizableViewControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletModeNameViewControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletModeNameViewControllerTests.java index 008ccfaeeb6..1f2f9a8d620 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletModeNameViewControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletModeNameViewControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -34,6 +34,7 @@ public class PortletModeNameViewControllerTests extends TestCase { private PortletModeNameViewController controller; + @Override public void setUp() { controller = new PortletModeNameViewController(); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletWrappingControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletWrappingControllerTests.java index 1bda3ed3d29..2058bbb224a 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletWrappingControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/PortletWrappingControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -155,10 +155,12 @@ public final class PortletWrappingControllerTests { private PortletConfig portletConfig; + @Override public void init(PortletConfig portletConfig) { this.portletConfig = portletConfig; } + @Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException { if (request.getParameter("test") != null) { response.setRenderParameter(RESULT_RENDER_PARAMETER_NAME, "myPortlet-action"); @@ -169,6 +171,7 @@ public final class PortletWrappingControllerTests { } } + @Override public void render(RenderRequest request, RenderResponse response) throws IOException { response.getWriter().write(RENDERED_RESPONSE_CONTENT); } @@ -177,6 +180,7 @@ public final class PortletWrappingControllerTests { return this.portletConfig; } + @Override public void destroy() { throw new IllegalStateException("Being destroyed..."); } @@ -185,6 +189,7 @@ public final class PortletWrappingControllerTests { private static final class MyApplicationContext extends StaticPortletApplicationContext { + @Override public void refresh() throws BeansException { MutablePropertyValues pvs = new MutablePropertyValues(); pvs.add("portletClass", MyPortlet.class); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java index 71fd56e812a..600dc7e8fa6 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -41,9 +41,9 @@ import javax.servlet.http.Cookie; import org.junit.Test; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.propertyeditors.CustomDateEditor; @@ -104,6 +104,7 @@ public class Portlet20AnnotationControllerTests { @Test public void standardHandleMethod() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class)); @@ -122,6 +123,7 @@ public class Portlet20AnnotationControllerTests { @Test public void standardHandleMethodWithResources() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletConfig(getPortletConfig()); @@ -173,6 +175,7 @@ public class Portlet20AnnotationControllerTests { private void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(controllerClass)); @@ -217,12 +220,14 @@ public class Portlet20AnnotationControllerTests { @Test public void formController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -240,12 +245,14 @@ public class Portlet20AnnotationControllerTests { @Test public void modelFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyModelFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -263,6 +270,7 @@ public class Portlet20AnnotationControllerTests { @Test public void commandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyCommandProvidingFormController.class)); @@ -272,6 +280,7 @@ public class Portlet20AnnotationControllerTests { wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -290,6 +299,7 @@ public class Portlet20AnnotationControllerTests { @Test public void typedCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyTypedCommandProvidingFormController.class)); @@ -301,6 +311,7 @@ public class Portlet20AnnotationControllerTests { wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -338,12 +349,14 @@ public class Portlet20AnnotationControllerTests { @Test public void binderInitializingCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyBinderInitializingCommandProvidingFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -362,12 +375,14 @@ public class Portlet20AnnotationControllerTests { @Test public void specificBinderInitializingCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MySpecificBinderInitializingCommandProvidingFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -386,6 +401,7 @@ public class Portlet20AnnotationControllerTests { @Test public void parameterDispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -427,6 +443,7 @@ public class Portlet20AnnotationControllerTests { @Test public void typeLevelParameterDispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -513,6 +530,7 @@ public class Portlet20AnnotationControllerTests { @Test public void portlet20DispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -613,6 +631,7 @@ public class Portlet20AnnotationControllerTests { @Test public void eventDispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -697,6 +716,7 @@ public class Portlet20AnnotationControllerTests { @Test public void testPredicatePriorityComparisonAcrossControllers() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); // The order of handler registration is important to get @@ -762,6 +782,7 @@ public class Portlet20AnnotationControllerTests { @RequestMapping("VIEW") private static class MyController extends AbstractController { + @Override protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception { response.getWriter().write("test"); return null; @@ -950,6 +971,7 @@ public class Portlet20AnnotationControllerTests { return new TestBean(defaultName.getClass().getSimpleName() + ":" + defaultName.toString()); } + @Override @RequestMapping("VIEW") @RenderMapping public String myHandle(@ModelAttribute("myCommand") TestBean tb, BindingResult errors, ModelMap model) { @@ -996,6 +1018,7 @@ public class Portlet20AnnotationControllerTests { private static class MyOtherTypedCommandProvidingFormController extends MyCommandProvidingFormController { + @Override @RequestMapping("VIEW") @RenderMapping public String myHandle(@ModelAttribute("myCommand") TestBean tb, BindingResult errors, ModelMap model) { @@ -1034,6 +1057,7 @@ public class Portlet20AnnotationControllerTests { private static class MyWebBindingInitializer implements WebBindingInitializer { + @Override public void initBinder(WebDataBinder binder, WebRequest request) { assertNotNull(request.getLocale()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); @@ -1045,6 +1069,7 @@ public class Portlet20AnnotationControllerTests { private static class MySpecialArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) { if (methodParameter.getParameterType().equals(MySpecialArg.class)) { return new MySpecialArg("myValue"); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java index 88cec558020..7a58b4a1c45 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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,9 +38,9 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.propertyeditors.CustomDateEditor; @@ -86,6 +86,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void testStandardHandleMethod() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class)); @@ -115,6 +116,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(controllerClass)); @@ -153,12 +155,14 @@ public class PortletAnnotationControllerTests extends TestCase { public void testFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -175,12 +179,14 @@ public class PortletAnnotationControllerTests extends TestCase { public void testModelFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyModelFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -197,6 +203,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void testCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyCommandProvidingFormController.class)); @@ -206,6 +213,7 @@ public class PortletAnnotationControllerTests extends TestCase { wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -223,6 +231,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void testTypedCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyTypedCommandProvidingFormController.class)); @@ -234,6 +243,7 @@ public class PortletAnnotationControllerTests extends TestCase { wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -270,12 +280,14 @@ public class PortletAnnotationControllerTests extends TestCase { public void testBinderInitializingCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MyBinderInitializingCommandProvidingFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -293,12 +305,14 @@ public class PortletAnnotationControllerTests extends TestCase { public void testSpecificBinderInitializingCommandProvidingFormController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.registerBeanDefinition("controller", new RootBeanDefinition(MySpecificBinderInitializingCommandProvidingFormController.class)); wac.refresh(); return wac; } + @Override protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { new TestView().render(mv.getViewName(), mv.getModel(), request, response); } @@ -316,6 +330,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void testParameterDispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -356,6 +371,7 @@ public class PortletAnnotationControllerTests extends TestCase { public void testTypeLevelParameterDispatchingController() throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { + @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { StaticPortletApplicationContext wac = new StaticPortletApplicationContext(); wac.setPortletContext(new MockPortletContext()); @@ -465,6 +481,7 @@ public class PortletAnnotationControllerTests extends TestCase { @RequestMapping("VIEW") private static class MyController extends AbstractController { + @Override protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception { response.getWriter().write("test"); return null; @@ -600,6 +617,7 @@ public class PortletAnnotationControllerTests extends TestCase { return new TestBean(defaultName.getClass().getSimpleName() + ":" + defaultName.toString()); } + @Override @RequestMapping("VIEW") public String myHandle(@ModelAttribute("myCommand") TestBean tb, BindingResult errors, ModelMap model) { if (!model.containsKey("myKey")) { @@ -644,6 +662,7 @@ public class PortletAnnotationControllerTests extends TestCase { private static class MyOtherTypedCommandProvidingFormController extends MyCommandProvidingFormController { + @Override @RequestMapping("VIEW") public String myHandle(@ModelAttribute("myCommand") TestBean tb, BindingResult errors, ModelMap model) { if (!model.containsKey("myKey")) { @@ -681,6 +700,7 @@ public class PortletAnnotationControllerTests extends TestCase { private static class MyWebBindingInitializer implements WebBindingInitializer { + @Override public void initBinder(WebDataBinder binder, WebRequest request) { assertNotNull(request.getLocale()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); @@ -692,6 +712,7 @@ public class PortletAnnotationControllerTests extends TestCase { private static class MySpecialArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) { if (methodParameter.getParameterType().equals(MySpecialArg.class)) { return new MySpecialArg("myValue"); @@ -807,6 +828,7 @@ public class PortletAnnotationControllerTests extends TestCase { public static class MyModelAndViewResolver implements ModelAndViewResolver { + @Override public org.springframework.web.servlet.ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, @@ -814,10 +836,12 @@ public class PortletAnnotationControllerTests extends TestCase { NativeWebRequest webRequest) { if (returnValue instanceof MySpecialArg) { return new org.springframework.web.servlet.ModelAndView(new View() { + @Override public String getContentType() { return "text/html"; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().write("myValue"); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java index a55e0d8e964..8fd99d5357f 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-20011 the original author or authors. + * Copyright 2002-2013 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. @@ -27,8 +27,8 @@ import javax.portlet.PortletSession; import org.junit.Test; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.portlet.MockActionRequest; import org.springframework.mock.web.portlet.MockActionResponse; import org.springframework.mock.web.portlet.MockPortletContext; @@ -83,6 +83,7 @@ public final class PortletUtilsTests { @Test(expected=FileNotFoundException.class) public void testGetRealPathWithPathThatCannotBeResolvedToFile() throws Exception { PortletUtils.getRealPath(new MockPortletContext() { + @Override public String getRealPath(String path) { return null; } @@ -221,6 +222,7 @@ public final class PortletUtilsTests { request.setParameter("William", "Baskerville"); request.setParameter("Adso", "Melk"); MockActionResponse response = new MockActionResponse() { + @Override public void setRenderParameter(String key, String[] values) { throw new IllegalStateException(); } @@ -243,6 +245,7 @@ public final class PortletUtilsTests { @Test public void testClearAllRenderParametersDoesNotPropagateExceptionIfRedirectAlreadySentAtTimeOfCall() throws Exception { MockActionResponse response = new MockActionResponse() { + @Override @SuppressWarnings("unchecked") public void setRenderParameters(Map parameters) { throw new IllegalStateException(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java index 056fa247bcf..db4ae5973d6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java index f200ccb1192..13407758767 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java index 0b59d5f6d3c..3ed6dbf3570 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerMapping.java index daf05bcf7ea..791e169a016 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java index bed0733813b..d580afe766e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/LocaleResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndView.java index b07d4d50829..d58ea7de6a8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndViewDefiningException.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndViewDefiningException.java index 08bd4f6abdc..ffb22c02f58 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndViewDefiningException.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ModelAndViewDefiningException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/RequestToViewNameTranslator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/RequestToViewNameTranslator.java index d0a503ca376..7c47cd3aa89 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/RequestToViewNameTranslator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/RequestToViewNameTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ResourceServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ResourceServlet.java index d280c8229cb..b286661489b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ResourceServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ResourceServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/SmartView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/SmartView.java index 209c1bc092c..31539c1653a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/SmartView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/SmartView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ThemeResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ThemeResolver.java index c44619e313f..39c0cbd8b18 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ThemeResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ThemeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewRendererServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewRendererServlet.java index db6f31186c7..dbc4ad5f3d0 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewRendererServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewRendererServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewResolver.java index 8e2429af866..e6a50cc2dfb 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/ViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java index 68f0220540c..d842b4d689c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/DefaultServletHandlerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceHandler.java index 2b4af21e86f..d1d887700bc 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java index a0defb43f11..abf53b4e2c8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/MvcNamespaceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java index 8a05cf73829..97df07e544a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java index d218be939cd..e580aea38b7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DefaultServletHandlerConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DefaultServletHandlerConfigurer.java index eaae024b2b7..6b6f5d1acf8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DefaultServletHandlerConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DefaultServletHandlerConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java index 2daa59c4761..178569b4c4c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/EnableWebMvc.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java index b406d284ae4..8ce3914180e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java index 914c9cfaa39..96fdcaf4e09 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistration.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistration.java index 155aa38536c..bc3b1738ce6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistration.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistry.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistry.java index 9cbbadf4f19..fcc284989f8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistry.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractDetectingUrlHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractDetectingUrlHandlerMapping.java index 9cbc2c14892..c06bb4eefff 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractDetectingUrlHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractDetectingUrlHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java index a86ed1ddb72..fdef487e481 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java index 0e74e57384b..ea079c49386 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodExceptionResolver.java index 4501a8fe37f..5a4c7d92480 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/ConversionServiceExposingInterceptor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/ConversionServiceExposingInterceptor.java index f9b8cbc344a..f7349c93de6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/ConversionServiceExposingInterceptor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/ConversionServiceExposingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java index f9e1e7c393b..8716f20cef6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletHandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletHandlerAdapter.java index 9f149b19492..e72e011c7ae 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletHandlerAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletHandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java index e3ca75d02d3..663786ff294 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.java index b581ca2b387..abef0a7ff7e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java index 551c790d533..661bb62ac75 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/CookieLocaleResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/CookieLocaleResolver.java index 66f5bcae6a8..94c7d03723f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/CookieLocaleResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/CookieLocaleResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/FixedLocaleResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/FixedLocaleResolver.java index a2abd437154..f56590f4698 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/FixedLocaleResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/FixedLocaleResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/SessionLocaleResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/SessionLocaleResolver.java index 66f7b3990f9..de1bdd57c7c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/SessionLocaleResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/SessionLocaleResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractCommandController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractCommandController.java index fad6bb9dc94..6c4731ff1fc 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractCommandController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractCommandController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractController.java index a6d57754632..a0ef16cc32f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractFormController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractFormController.java index f3a3939a10b..da72de2f51f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractFormController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractUrlViewController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractUrlViewController.java index 8033b21fe86..14b1e82caad 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractUrlViewController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractUrlViewController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractWizardFormController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractWizardFormController.java index 0b40a12d047..a53836a7a4d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractWizardFormController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/AbstractWizardFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/BaseCommandController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/BaseCommandController.java index b34b7f99235..2f47edaa25a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/BaseCommandController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/BaseCommandController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/CancellableFormController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/CancellableFormController.java index 87d6a019019..1bd9ef89706 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/CancellableFormController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/CancellableFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/Controller.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/Controller.java index b02d72d3cdd..654062ed958 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/Controller.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/Controller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java index 6ed540dcdde..8ca1b33a3d3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ParameterizableViewController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ParameterizableViewController.java index f8365a14701..c5493d0ec64 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ParameterizableViewController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ParameterizableViewController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletForwardingController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletForwardingController.java index c96e356e60b..73607f6d7fe 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletForwardingController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletForwardingController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java index 79c8bf3851f..10dffda157b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/SimpleFormController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/SimpleFormController.java index c589641dded..030c2dca2c5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/SimpleFormController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/SimpleFormController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java index 604bea9b6c1..50a20e51b97 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java index d4c6cccab32..d204e33e89b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java index a7580c500ac..0d58e8c134c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtils.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtils.java index 62bbc4ebc79..5c0282f527d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtils.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractNameValueExpression.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractNameValueExpression.java index dd050ca81c3..3915ffc7618 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractNameValueExpression.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractNameValueExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java index 5328d5e799a..921ecb249a0 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/HeadersRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/HeadersRequestCondition.java index 20b4ee8381a..3ece7e8d73b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/HeadersRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/HeadersRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/MediaTypeExpression.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/MediaTypeExpression.java index 9df8949dac7..986d9a4fe9b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/MediaTypeExpression.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/MediaTypeExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/NameValueExpression.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/NameValueExpression.java index 83a01ea56a8..6bb9c818727 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/NameValueExpression.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/NameValueExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java index 66d6e51009a..294d4e6ed13 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/AbstractHandlerMethodAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/AbstractHandlerMethodAdapter.java index d6bce0d4829..9824b80e0e5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/AbstractHandlerMethodAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/AbstractHandlerMethodAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java index 765ed74a645..6d0e3941e6c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java index f271cfe4794..14c74c60771 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletCookieValueMethodArgumentResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletCookieValueMethodArgumentResolver.java index ee09382f23a..8d3d77acd99 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletCookieValueMethodArgumentResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletCookieValueMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletWebArgumentResolverAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletWebArgumentResolverAdapter.java index 54a4e2265eb..5513dddae00 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletWebArgumentResolverAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletWebArgumentResolverAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/AbstractUrlMethodNameResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/AbstractUrlMethodNameResolver.java index 444b45dce5d..ed781d99c78 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/AbstractUrlMethodNameResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/AbstractUrlMethodNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/MethodNameResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/MethodNameResolver.java index 4df1b6acff5..d67f3019f86 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/MethodNameResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/MethodNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java index 5dc2d264fa8..00917177e81 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/ParameterMethodNameResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/ParameterMethodNameResolver.java index 8c5d93844df..bd9405b65bb 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/ParameterMethodNameResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/ParameterMethodNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/PropertiesMethodNameResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/PropertiesMethodNameResolver.java index ed43904a3f4..3cbcb08a8f7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/PropertiesMethodNameResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/multiaction/PropertiesMethodNameResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AbstractControllerUrlHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AbstractControllerUrlHandlerMapping.java index 40f7aa68d5c..7c4f94535f4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AbstractControllerUrlHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AbstractControllerUrlHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AnnotationControllerTypePredicate.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AnnotationControllerTypePredicate.java index c824754eb1f..dfa46ec0ec3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AnnotationControllerTypePredicate.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/AnnotationControllerTypePredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerBeanNameHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerBeanNameHandlerMapping.java index 6977c4e5592..168781491f7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerBeanNameHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerBeanNameHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.java index 34a3e0a2e86..4b8f9b33c57 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributes.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributes.java index daeaa970c51..d23b050cbc9 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributes.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMap.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMap.java index 27c0e25bbc8..6db27a10d4f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMap.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java index 4c1ca19ef16..0a928be3a45 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java index e78a6ac5498..c5f9e6a3e32 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JspAwareRequestContext.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JspAwareRequestContext.java index 4b44bd98323..69d5cefe803 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JspAwareRequestContext.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JspAwareRequestContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JstlUtils.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JstlUtils.java index 34d44b5c725..f568f362137 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JstlUtils.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/JstlUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java index e5a74646218..3f586a94467 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestDataValueProcessor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestDataValueProcessor.java index a8ca8ca2562..6dd24b78265 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestDataValueProcessor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestDataValueProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java index 3cc1b41fca4..7f759e8c97f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindErrorsTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindErrorsTag.java index 28e5aa57227..cf037fc1158 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindErrorsTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindErrorsTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindTag.java index 0b6e91eb023..f5b45233e11 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/BindTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EditorAwareTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EditorAwareTag.java index 05fd7845a3a..290c70f2a91 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EditorAwareTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EditorAwareTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java index 73cf45267f6..2c0056def49 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EscapeBodyTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EvalTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EvalTag.java index dbf878f047a..6ec63b58c8d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EvalTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/EvalTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java index 578c9e69cef..8e610458101 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapeTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapingAwareTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapingAwareTag.java index 6e72f1f91d1..05db5eb70a3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapingAwareTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/HtmlEscapingAwareTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java index c195208d980..a3a0c4c7f50 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/MessageTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/NestedPathTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/NestedPathTag.java index bc3ee3b24f6..1f8ddd28432 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/NestedPathTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/NestedPathTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/Param.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/Param.java index d37d05a9eb2..8909c3598dd 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/Param.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/Param.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamAware.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamAware.java index 32df5d7412e..a99f4378bbb 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamAware.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamTag.java index 8b222e3d3a4..a0b62747ea2 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ParamTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/RequestContextAwareTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/RequestContextAwareTag.java index 8e8091f5ff0..b02021fbb60 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/RequestContextAwareTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/RequestContextAwareTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ThemeTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ThemeTag.java index 370a842360c..182247bf6f6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ThemeTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ThemeTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/TransformTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/TransformTag.java index 90f8b3ae569..a0379d88000 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/TransformTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/TransformTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java index 0bdaef89ceb..370bf196882 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractCheckedElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractCheckedElementTag.java index cebf23c64f0..a1035d4da1e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractCheckedElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractCheckedElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractDataBoundFormElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractDataBoundFormElementTag.java index b526096c239..a0d569a5090 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractDataBoundFormElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractDataBoundFormElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractFormTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractFormTag.java index 08200ab8d92..67f62f3d368 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractFormTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractFormTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java index f0e48baaae3..a31cc1ebe62 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementBodyTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java index 5b70045309d..6316ac8b3c2 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlInputElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlInputElementTag.java index d1d3dcf9ed8..1718b08feaf 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlInputElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlInputElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java index be41b85a6ed..5c431cc7353 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java index 71ca75cd65b..9d26dc554aa 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractSingleCheckedElementTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ButtonTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ButtonTag.java index db85b752d26..d3468aed0b5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ButtonTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ButtonTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java index 51a846808fa..6244a2d5373 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java index 29d6e93376e..50cd7447ee3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ErrorsTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ErrorsTag.java index 60a00ffe326..c05a4468874 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ErrorsTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ErrorsTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java index 4b776488ad9..f827631d62e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/HiddenInputTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/HiddenInputTag.java index b1d32e4b869..7a6de1dd26b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/HiddenInputTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/HiddenInputTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java index a451f8840e6..514d9400ab5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/InputTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/LabelTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/LabelTag.java index 474f9c913a0..f8dd7f28e82 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/LabelTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/LabelTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionTag.java index 278887344a6..3e9ee381ce3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java index 1c47096591e..062b4900d4c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionsTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionsTag.java index 02712da2465..0c57b8dd9be 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionsTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/OptionsTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/PasswordInputTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/PasswordInputTag.java index 6ee579519af..02b5b9b7a8a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/PasswordInputTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/PasswordInputTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonTag.java index facbde6d241..3d4dc779952 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonsTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonsTag.java index 90033186c92..e95064e4f95 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonsTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/RadioButtonsTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectTag.java index c840f3e8474..e0afe0f431a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java index 63c41341eed..8446f9f2b14 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/SelectedValueComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagIdGenerator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagIdGenerator.java index 8062d17c57d..ae4185f86f8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagIdGenerator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagIdGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagWriter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagWriter.java index a3163671726..b4d2d914f86 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagWriter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TagWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java index c2ac715ca83..09539fbbb81 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/TextareaTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ValueFormatter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ValueFormatter.java index c10ac1ee02a..70ae90264b9 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ValueFormatter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/ValueFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/CookieThemeResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/CookieThemeResolver.java index 12ab0f5feac..26660987349 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/CookieThemeResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/CookieThemeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/FixedThemeResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/FixedThemeResolver.java index 2c6bdee4352..75aae57b619 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/FixedThemeResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/FixedThemeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/SessionThemeResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/SessionThemeResolver.java index 766058f4633..686f7a2708d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/SessionThemeResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/theme/SessionThemeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractUrlBasedView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractUrlBasedView.java index 757a42aadf7..9e17d98f8fd 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractUrlBasedView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/AbstractUrlBasedView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java index 066242271d1..a8ca84e6645 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java index c73b81cc18e..9ffb54e7b79 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceView.java index b19385c1070..83c2bb55c26 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceViewResolver.java index 9b50d346d6a..cd55f05377f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/InternalResourceViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/JstlView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/JstlView.java index 164f51b2b50..7906b33f047 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/JstlView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/JstlView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java index 22e6a1fafc3..2726e0537c3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ResourceBundleViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/UrlBasedViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/UrlBasedViewResolver.java index f9b4a77e31f..56a3a3effb8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/UrlBasedViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/UrlBasedViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java index 68ecc69edba..59b45a8a800 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractJExcelView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractJExcelView.java index 0050f40313c..2ce37aeea3c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractJExcelView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractJExcelView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java index 34bc3071cf7..89402557098 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java index 6773d689c84..643231404a1 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsView.java index 6ace4da3fe4..f2a579bef68 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvView.java index 61ba6142ef3..f8297f3b144 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlView.java index b6bc188d17a..83ac59115c2 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.java index 54cbae7e857..00bb4439fb7 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfView.java index 4d7199e71ea..f10937f2e21 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsViewResolver.java index d496d56fd00..f646898b936 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsView.java index 712b7ca740b..33ae346f0a0 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/AbstractSpringPreparerFactory.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/AbstractSpringPreparerFactory.java index 84fe7d1d030..ef4faaf2e0a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/AbstractSpringPreparerFactory.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/AbstractSpringPreparerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/TilesConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/TilesConfigurer.java index 6f1e2b9b0c8..050aad09cf5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/TilesConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/tiles2/TilesConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfig.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfig.java index f8b7c475921..9bffdadf102 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfig.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfigurer.java index 1eaf045c1f1..5d547a639e3 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutView.java index 0933aeb57c5..65493af17c8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutViewResolver.java index 8678b62e58e..873421473e8 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityLayoutViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityView.java index 5a8081c30b9..d094d75e9f5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityViewResolver.java index d0eec2ea82b..11ce8c62d80 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MarshallingView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MarshallingView.java index dd68939008d..c08daa0a851 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MarshallingView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MarshallingView.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/AbstractXsltView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/AbstractXsltView.java index 1db1ef7da7f..24a6d018db4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/AbstractXsltView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/AbstractXsltView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java index 7fad0bf3299..9753b9b5760 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltViewResolver.java index cb731e19de6..8ba15e391ca 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltViewResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/beans/BeanWithObjectProperty.java b/spring-webmvc/src/test/java/org/springframework/beans/BeanWithObjectProperty.java deleted file mode 100644 index bb5e71f5cd0..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/BeanWithObjectProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * @author Juergen Hoeller - * @since 17.08.2004 - */ -public class BeanWithObjectProperty { - - private Object object; - - public Object getObject() { - return object; - } - - public void setObject(Object object) { - this.object = object; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/Colour.java b/spring-webmvc/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec79..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/beans/DerivedTestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/DerivedTestBean.java deleted file mode 100644 index 0940539f54a..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/DerivedTestBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.DisposableBean; - -/** - * @author Juergen Hoeller - * @since 21.08.2003 - */ -@SuppressWarnings("serial") -public class DerivedTestBean extends TestBean implements Serializable, BeanNameAware, DisposableBean { - - private String beanName; - - private boolean initialized; - - private boolean destroyed; - - - public DerivedTestBean() { - } - - public DerivedTestBean(String[] names) { - if (names == null || names.length < 2) { - throw new IllegalArgumentException("Invalid names array"); - } - setName(names[0]); - setBeanName(names[1]); - } - - public static DerivedTestBean create(String[] names) { - return new DerivedTestBean(names); - } - - - public void setBeanName(String beanName) { - if (this.beanName == null || beanName == null) { - this.beanName = beanName; - } - } - - public String getBeanName() { - return beanName; - } - - public void setSpouseRef(String name) { - setSpouse(new TestBean(name)); - } - - - public void initialize() { - this.initialized = true; - } - - public boolean wasInitialized() { - return initialized; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/beans/FieldAccessBean.java b/spring-webmvc/src/test/java/org/springframework/beans/FieldAccessBean.java deleted file mode 100644 index 61f911902c7..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/FieldAccessBean.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -/** - * @author Juergen Hoeller - * @since 07.03.2006 - */ -public class FieldAccessBean { - - public String name; - - protected int age; - - private TestBean spouse; - - - public String getName() { - return name; - } - - public int getAge() { - return age; - } - - public TestBean getSpouse() { - return spouse; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/GenericBean.java b/spring-webmvc/src/test/java/org/springframework/beans/GenericBean.java deleted file mode 100644 index 00dd127e47c..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/GenericBean.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright 2002-2010 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.springframework.core.io.Resource; - -/** - * @author Juergen Hoeller - */ -public class GenericBean { - - private Set integerSet; - - private Set testBeanSet; - - private List resourceList; - - private List> listOfLists; - - private ArrayList listOfArrays; - - private List> listOfMaps; - - private Map plainMap; - - private Map shortMap; - - private HashMap longMap; - - private Map> collectionMap; - - private Map> mapOfMaps; - - private Map> mapOfLists; - - private CustomEnum customEnum; - - private T genericProperty; - - private List genericListProperty; - - - public GenericBean() { - } - - public GenericBean(Set integerSet) { - this.integerSet = integerSet; - } - - public GenericBean(Set integerSet, List resourceList) { - this.integerSet = integerSet; - this.resourceList = resourceList; - } - - public GenericBean(HashSet integerSet, Map shortMap) { - this.integerSet = integerSet; - this.shortMap = shortMap; - } - - public GenericBean(Map shortMap, Resource resource) { - this.shortMap = shortMap; - this.resourceList = Collections.singletonList(resource); - } - - public GenericBean(Map plainMap, Map shortMap) { - this.plainMap = plainMap; - this.shortMap = shortMap; - } - - public GenericBean(HashMap longMap) { - this.longMap = longMap; - } - - public GenericBean(boolean someFlag, Map> collectionMap) { - this.collectionMap = collectionMap; - } - - - public Set getIntegerSet() { - return integerSet; - } - - public void setIntegerSet(Set integerSet) { - this.integerSet = integerSet; - } - - public Set getTestBeanSet() { - return testBeanSet; - } - - public void setTestBeanSet(Set testBeanSet) { - this.testBeanSet = testBeanSet; - } - - public List getResourceList() { - return resourceList; - } - - public void setResourceList(List resourceList) { - this.resourceList = resourceList; - } - - public List> getListOfLists() { - return listOfLists; - } - - public ArrayList getListOfArrays() { - return listOfArrays; - } - - public void setListOfArrays(ArrayList listOfArrays) { - this.listOfArrays = listOfArrays; - } - - public void setListOfLists(List> listOfLists) { - this.listOfLists = listOfLists; - } - - public List> getListOfMaps() { - return listOfMaps; - } - - public void setListOfMaps(List> listOfMaps) { - this.listOfMaps = listOfMaps; - } - - public Map getPlainMap() { - return plainMap; - } - - public Map getShortMap() { - return shortMap; - } - - public void setShortMap(Map shortMap) { - this.shortMap = shortMap; - } - - public HashMap getLongMap() { - return longMap; - } - - public void setLongMap(HashMap longMap) { - this.longMap = longMap; - } - - public Map> getCollectionMap() { - return collectionMap; - } - - public void setCollectionMap(Map> collectionMap) { - this.collectionMap = collectionMap; - } - - public Map> getMapOfMaps() { - return mapOfMaps; - } - - public void setMapOfMaps(Map> mapOfMaps) { - this.mapOfMaps = mapOfMaps; - } - - public Map> getMapOfLists() { - return mapOfLists; - } - - public void setMapOfLists(Map> mapOfLists) { - this.mapOfLists = mapOfLists; - } - - public T getGenericProperty() { - return genericProperty; - } - - public void setGenericProperty(T genericProperty) { - this.genericProperty = genericProperty; - } - - public List getGenericListProperty() { - return genericListProperty; - } - - public void setGenericListProperty(List genericListProperty) { - this.genericListProperty = genericListProperty; - } - - public CustomEnum getCustomEnum() { - return customEnum; - } - - public void setCustomEnum(CustomEnum customEnum) { - this.customEnum = customEnum; - } - - - public static GenericBean createInstance(Set integerSet) { - return new GenericBean(integerSet); - } - - public static GenericBean createInstance(Set integerSet, List resourceList) { - return new GenericBean(integerSet, resourceList); - } - - public static GenericBean createInstance(HashSet integerSet, Map shortMap) { - return new GenericBean(integerSet, shortMap); - } - - public static GenericBean createInstance(Map shortMap, Resource resource) { - return new GenericBean(shortMap, resource); - } - - public static GenericBean createInstance(Map map, Map shortMap) { - return new GenericBean(map, shortMap); - } - - public static GenericBean createInstance(HashMap longMap) { - return new GenericBean(longMap); - } - - public static GenericBean createInstance(boolean someFlag, Map> collectionMap) { - return new GenericBean(someFlag, collectionMap); - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e679..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/INestedTestBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface INestedTestBean { - - public String getCompany(); - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/IOther.java b/spring-webmvc/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187cb..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/IOther.java +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -public interface IOther { - - void absquatulate(); - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/ITestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/ITestBean.java deleted file mode 100644 index cdf5ef510dd..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans; - -import java.io.IOException; - -/** - * Interface used for {@link org.springframework.beans.TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/IndexedTestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/IndexedTestBean.java deleted file mode 100644 index ddb091770ee..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/NestedTestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8ae..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/Person.java b/spring-webmvc/src/test/java/org/springframework/beans/Person.java deleted file mode 100644 index a78998ad5d4..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/Person.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -/** - * - * @author Rod Johnson - */ -public interface Person { - - String getName(); - void setName(String name); - int getAge(); - void setAge(int i); - - /** - * Test for non-property method matching. - * If the parameter is a Throwable, it will be thrown rather than - * returned. - */ - Object echo(Object o) throws Throwable; -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/Pet.java b/spring-webmvc/src/test/java/org/springframework/beans/Pet.java deleted file mode 100644 index 35d9c736c13..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/Pet.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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.beans; - -/** - * @author Rob Harrop - * @since 2.0 - */ -public class Pet { - - private String name; - - public Pet(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public String toString() { - return getName(); - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - final Pet pet = (Pet) o; - - if (name != null ? !name.equals(pet.name) : pet.name != null) return false; - - return true; - } - - public int hashCode() { - return (name != null ? name.hashCode() : 0); - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/SerializablePerson.java b/spring-webmvc/src/test/java/org/springframework/beans/SerializablePerson.java deleted file mode 100644 index 13c2c5447a5..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/SerializablePerson.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans; - -import java.io.Serializable; - -import org.springframework.util.ObjectUtils; - -/** - * Serializable implementation of the Person interface. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class SerializablePerson implements Person, Serializable { - - private String name; - private int age; - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Object echo(Object o) throws Throwable { - if (o instanceof Throwable) { - throw (Throwable) o; - } - return o; - } - - public boolean equals(Object other) { - if (!(other instanceof SerializablePerson)) { - return false; - } - SerializablePerson p = (SerializablePerson) other; - return p.age == age && ObjectUtils.nullSafeEquals(name, p.name); - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/beans/TestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeacf..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see org.springframework.beans.ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see org.springframework.beans.ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see org.springframework.beans.IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/factory/DummyFactory.java b/spring-webmvc/src/test/java/org/springframework/beans/factory/DummyFactory.java deleted file mode 100644 index 006228975a7..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/factory/DummyFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; - -/** - * Simple factory to allow testing of FactoryBean support in AbstractBeanFactory. - * Depending on whether its singleton property is set, it will return a singleton - * or a prototype instance. - * - *

Implements InitializingBean interface, so we can check that - * factories get this lifecycle callback if they want. - * - * @author Rod Johnson - * @since 10.03.2003 - */ -public class DummyFactory - implements FactoryBean, BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - public static final String SINGLETON_NAME = "Factory singleton"; - - private static boolean prototypeCreated; - - /** - * Clear static state. - */ - public static void reset() { - prototypeCreated = false; - } - - - /** - * Default is for factories to return a singleton instance. - */ - private boolean singleton = true; - - private String beanName; - - private AutowireCapableBeanFactory beanFactory; - - private boolean postProcessed; - - private boolean initialized; - - private TestBean testBean; - - private TestBean otherTestBean; - - - public DummyFactory() { - this.testBean = new TestBean(); - this.testBean.setName(SINGLETON_NAME); - this.testBean.setAge(25); - } - - /** - * Return if the bean managed by this factory is a singleton. - * @see FactoryBean#isSingleton() - */ - public boolean isSingleton() { - return this.singleton; - } - - /** - * Set if the bean managed by this factory is a singleton. - */ - public void setSingleton(boolean singleton) { - this.singleton = singleton; - } - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = (AutowireCapableBeanFactory) beanFactory; - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public void setOtherTestBean(TestBean otherTestBean) { - this.otherTestBean = otherTestBean; - this.testBean.setSpouse(otherTestBean); - } - - public TestBean getOtherTestBean() { - return otherTestBean; - } - - public void afterPropertiesSet() { - if (initialized) { - throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); - } - this.initialized = true; - } - - /** - * Was this initialized by invocation of the - * afterPropertiesSet() method from the InitializingBean interface? - */ - public boolean wasInitialized() { - return initialized; - } - - public static boolean wasPrototypeCreated() { - return prototypeCreated; - } - - - /** - * Return the managed object, supporting both singleton - * and prototype mode. - * @see FactoryBean#getObject() - */ - public Object getObject() throws BeansException { - if (isSingleton()) { - return this.testBean; - } - else { - TestBean prototype = new TestBean("prototype created at " + System.currentTimeMillis(), 11); - if (this.beanFactory != null) { - this.beanFactory.applyBeanPostProcessorsBeforeInitialization(prototype, this.beanName); - } - prototypeCreated = true; - return prototype; - } - } - - public Class getObjectType() { - return TestBean.class; - } - - - public void destroy() { - if (this.testBean != null) { - this.testBean.setName(null); - } - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/factory/LifecycleBean.java b/spring-webmvc/src/test/java/org/springframework/beans/factory/LifecycleBean.java deleted file mode 100644 index 19b7da62f8d..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/factory/LifecycleBean.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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.beans.factory; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; - -/** - * Simple test of BeanFactory initialization and lifecycle callbacks. - * - * @author Rod Johnson - * @author Colin Sampaleanu - * @since 12.03.2003 - */ -public class LifecycleBean implements BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { - - protected boolean initMethodDeclared = false; - - protected String beanName; - - protected BeanFactory owningFactory; - - protected boolean postProcessedBeforeInit; - - protected boolean inited; - - protected boolean initedViaDeclaredInitMethod; - - protected boolean postProcessedAfterInit; - - protected boolean destroyed; - - - public void setInitMethodDeclared(boolean initMethodDeclared) { - this.initMethodDeclared = initMethodDeclared; - } - - public boolean isInitMethodDeclared() { - return initMethodDeclared; - } - - public void setBeanName(String name) { - this.beanName = name; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.owningFactory = beanFactory; - } - - public void postProcessBeforeInit() { - if (this.inited || this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessBeforeInit after afterPropertiesSet"); - } - if (this.postProcessedBeforeInit) { - throw new RuntimeException("Factory called postProcessBeforeInit twice"); - } - this.postProcessedBeforeInit = true; - } - - public void afterPropertiesSet() { - if (this.owningFactory == null) { - throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); - } - if (!this.postProcessedBeforeInit) { - throw new RuntimeException("Factory didn't call postProcessBeforeInit before afterPropertiesSet on lifecycle bean"); - } - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory initialized via declared init method before initializing via afterPropertiesSet"); - } - if (this.inited) { - throw new RuntimeException("Factory called afterPropertiesSet twice"); - } - this.inited = true; - } - - public void declaredInitMethod() { - if (!this.inited) { - throw new RuntimeException("Factory didn't call afterPropertiesSet before declared init method"); - } - - if (this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called declared init method twice"); - } - this.initedViaDeclaredInitMethod = true; - } - - public void postProcessAfterInit() { - if (!this.inited) { - throw new RuntimeException("Factory called postProcessAfterInit before afterPropertiesSet"); - } - if (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) { - throw new RuntimeException("Factory called postProcessAfterInit before calling declared init method"); - } - if (this.postProcessedAfterInit) { - throw new RuntimeException("Factory called postProcessAfterInit twice"); - } - this.postProcessedAfterInit = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited || (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) || - !this.postProcessedAfterInit) { - throw new RuntimeException("Factory didn't initialize lifecycle object correctly"); - } - } - - public void destroy() { - if (this.destroyed) { - throw new IllegalStateException("Already destroyed"); - } - this.destroyed = true; - } - - public boolean isDestroyed() { - return destroyed; - } - - - public static class PostProcessor implements BeanPostProcessor { - - public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessBeforeInit(); - } - return bean; - } - - public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { - if (bean instanceof LifecycleBean) { - ((LifecycleBean) bean).postProcessAfterInit(); - } - return bean; - } - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/factory/MustBeInitialized.java b/spring-webmvc/src/test/java/org/springframework/beans/factory/MustBeInitialized.java deleted file mode 100644 index 4715fe448f6..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/factory/MustBeInitialized.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.beans.factory; - -import org.springframework.beans.factory.InitializingBean; - -/** - * Simple test of BeanFactory initialization - * @author Rod Johnson - * @since 12.03.2003 - */ -public class MustBeInitialized implements InitializingBean { - - private boolean inited; - - /** - * @see InitializingBean#afterPropertiesSet() - */ - public void afterPropertiesSet() throws Exception { - this.inited = true; - } - - /** - * Dummy business method that will fail unless the factory - * managed the bean's lifecycle correctly - */ - public void businessMethod() { - if (!this.inited) - throw new RuntimeException("Factory didn't call afterPropertiesSet() on MustBeInitialized object"); - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/beans/factory/access/TestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/factory/access/TestBean.java index 3a77af2f711..ac3b91c5ffb 100644 --- a/spring-webmvc/src/test/java/org/springframework/beans/factory/access/TestBean.java +++ b/spring-webmvc/src/test/java/org/springframework/beans/factory/access/TestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/context/ACATester.java b/spring-webmvc/src/test/java/org/springframework/context/ACATester.java index 72c129ca4e3..7fa8a8263d8 100644 --- a/spring-webmvc/src/test/java/org/springframework/context/ACATester.java +++ b/spring-webmvc/src/test/java/org/springframework/context/ACATester.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -27,6 +27,7 @@ public class ACATester implements ApplicationContextAware { private ApplicationContext ac; + @Override public void setApplicationContext(ApplicationContext ctx) throws ApplicationContextException { // check reinitialization if (this.ac != null) { diff --git a/spring-webmvc/src/test/java/org/springframework/context/BeanThatBroadcasts.java b/spring-webmvc/src/test/java/org/springframework/context/BeanThatBroadcasts.java index 8137de62f61..f3163636829 100644 --- a/spring-webmvc/src/test/java/org/springframework/context/BeanThatBroadcasts.java +++ b/spring-webmvc/src/test/java/org/springframework/context/BeanThatBroadcasts.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -29,6 +29,7 @@ public class BeanThatBroadcasts implements ApplicationContextAware { public int receivedCount; + @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; if (applicationContext.getDisplayName().indexOf("listener") != -1) { diff --git a/spring-webmvc/src/test/java/org/springframework/context/BeanThatListens.java b/spring-webmvc/src/test/java/org/springframework/context/BeanThatListens.java index 9ab3f8ea40d..ab40da4b896 100644 --- a/spring-webmvc/src/test/java/org/springframework/context/BeanThatListens.java +++ b/spring-webmvc/src/test/java/org/springframework/context/BeanThatListens.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -43,6 +43,7 @@ public class BeanThatListens implements ApplicationListener { } + @Override public void onApplicationEvent(ApplicationEvent event) { eventCount++; if (beanThatBroadcasts != null) { diff --git a/spring-webmvc/src/test/java/org/springframework/context/LifecycleContextBean.java b/spring-webmvc/src/test/java/org/springframework/context/LifecycleContextBean.java index 50c9936c444..37d4c9715fb 100644 --- a/spring-webmvc/src/test/java/org/springframework/context/LifecycleContextBean.java +++ b/spring-webmvc/src/test/java/org/springframework/context/LifecycleContextBean.java @@ -3,7 +3,7 @@ package org.springframework.context; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; +import org.springframework.tests.sample.beans.LifecycleBean; /** * Simple bean to test ApplicationContext lifecycle methods for beans @@ -15,18 +15,21 @@ public class LifecycleContextBean extends LifecycleBean implements ApplicationCo protected ApplicationContext owningContext; + @Override public void setBeanFactory(BeanFactory beanFactory) { super.setBeanFactory(beanFactory); if (this.owningContext != null) throw new RuntimeException("Factory called setBeanFactory after setApplicationContext"); } + @Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (this.owningContext == null) throw new RuntimeException("Factory didn't call setAppliationContext before afterPropertiesSet on lifecycle bean"); } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if (this.owningFactory == null) throw new RuntimeException("Factory called setApplicationContext before setBeanFactory"); diff --git a/spring-webmvc/src/test/java/org/springframework/context/TestListener.java b/spring-webmvc/src/test/java/org/springframework/context/TestListener.java index 29f375105ff..739222190fa 100644 --- a/spring-webmvc/src/test/java/org/springframework/context/TestListener.java +++ b/spring-webmvc/src/test/java/org/springframework/context/TestListener.java @@ -21,6 +21,7 @@ public class TestListener implements ApplicationListener { eventCount = 0; } + @Override public void onApplicationEvent(ApplicationEvent e) { ++eventCount; } diff --git a/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/PersonBean.java b/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/PersonBean.java deleted file mode 100644 index 3d0bce4c841..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/PersonBean.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.ui.jasperreports; - -/** - * @author Rob Harrop - */ -public class PersonBean { - - private int id; - - private String name; - - private String street; - - private String city; - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/ProductBean.java b/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/ProductBean.java deleted file mode 100644 index 070fa2dc426..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/ui/jasperreports/ProductBean.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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.ui.jasperreports; - -/** - * @author Rob Harrop - */ -public class ProductBean { - - private int id; - - private String name; - - private float quantity; - - private float price; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public float getQuantity() { - return quantity; - } - - public void setQuantity(float quantity) { - this.quantity = quantity; - } - - public float getPrice() { - return price; - } - - public void setPrice(float price) { - this.price = price; - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/util/SerializationTestUtils.java b/spring-webmvc/src/test/java/org/springframework/util/SerializationTestUtils.java deleted file mode 100644 index 9ae4f54ec24..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/util/SerializationTestUtils.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * - * @author Rod Johnson - */ -public class SerializationTestUtils { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - return o2; - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractApplicationContextTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/AbstractApplicationContextTests.java deleted file mode 100644 index ce3c45d2e72..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractApplicationContextTests.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.web.context; - -import java.util.Locale; - -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.LifecycleBean; -import org.springframework.context.ACATester; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationEvent; -import org.springframework.context.BeanThatListens; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.NoSuchMessageException; -import org.springframework.context.TestListener; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractApplicationContextTests extends AbstractListableBeanFactoryTests { - - /** Must be supplied as XML */ - public static final String TEST_NAMESPACE = "testNamespace"; - - protected ConfigurableApplicationContext applicationContext; - - /** Subclass must register this */ - protected TestListener listener = new TestListener(); - - protected TestListener parentListener = new TestListener(); - - protected void setUp() throws Exception { - this.applicationContext = createContext(); - } - - protected BeanFactory getBeanFactory() { - return applicationContext; - } - - protected ApplicationContext getApplicationContext() { - return applicationContext; - } - - /** - * Must register a TestListener. - * Must register standard beans. - * Parent must register rod with name Roderick - * and father with name Albert. - */ - protected abstract ConfigurableApplicationContext createContext() throws Exception; - - public void testContextAwareSingletonWasCalledBack() throws Exception { - ACATester aca = (ACATester) applicationContext.getBean("aca"); - assertTrue("has had context set", aca.getApplicationContext() == applicationContext); - Object aca2 = applicationContext.getBean("aca"); - assertTrue("Same instance", aca == aca2); - assertTrue("Says is singleton", applicationContext.isSingleton("aca")); - } - - public void testContextAwarePrototypeWasCalledBack() throws Exception { - ACATester aca = (ACATester) applicationContext.getBean("aca-prototype"); - assertTrue("has had context set", aca.getApplicationContext() == applicationContext); - Object aca2 = applicationContext.getBean("aca-prototype"); - assertTrue("NOT Same instance", aca != aca2); - assertTrue("Says is prototype", !applicationContext.isSingleton("aca-prototype")); - } - - public void testParentNonNull() { - assertTrue("parent isn't null", applicationContext.getParent() != null); - } - - public void testGrandparentNull() { - assertTrue("grandparent is null", applicationContext.getParent().getParent() == null); - } - - public void testOverrideWorked() throws Exception { - TestBean rod = (TestBean) applicationContext.getParent().getBean("rod"); - assertTrue("Parent's name differs", rod.getName().equals("Roderick")); - } - - public void testGrandparentDefinitionFound() throws Exception { - TestBean dad = (TestBean) applicationContext.getBean("father"); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testGrandparentTypedDefinitionFound() throws Exception { - TestBean dad = applicationContext.getBean("father", TestBean.class); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testCloseTriggersDestroy() { - LifecycleBean lb = (LifecycleBean) applicationContext.getBean("lifecycle"); - assertTrue("Not destroyed", !lb.isDestroyed()); - applicationContext.close(); - if (applicationContext.getParent() != null) { - ((ConfigurableApplicationContext) applicationContext.getParent()).close(); - } - assertTrue("Destroyed", lb.isDestroyed()); - applicationContext.close(); - if (applicationContext.getParent() != null) { - ((ConfigurableApplicationContext) applicationContext.getParent()).close(); - } - assertTrue("Destroyed", lb.isDestroyed()); - } - - public void testMessageSource() throws NoSuchMessageException { - assertEquals("message1", applicationContext.getMessage("code1", null, Locale.getDefault())); - assertEquals("message2", applicationContext.getMessage("code2", null, Locale.getDefault())); - - try { - applicationContext.getMessage("code0", null, Locale.getDefault()); - fail("looking for code0 should throw a NoSuchMessageException"); - } - catch (NoSuchMessageException ex) { - // that's how it should be - } - } - - public void testEvents() throws Exception { - listener.zeroCounter(); - parentListener.zeroCounter(); - assertTrue("0 events before publication", listener.getEventCount() == 0); - assertTrue("0 parent events before publication", parentListener.getEventCount() == 0); - this.applicationContext.publishEvent(new MyEvent(this)); - assertTrue("1 events after publication, not " + listener.getEventCount(), listener.getEventCount() == 1); - assertTrue("1 parent events after publication", parentListener.getEventCount() == 1); - } - - public void testBeanAutomaticallyHearsEvents() throws Exception { - //String[] listenerNames = ((ListableBeanFactory) applicationContext).getBeanDefinitionNames(ApplicationListener.class); - //assertTrue("listeners include beanThatListens", Arrays.asList(listenerNames).contains("beanThatListens")); - BeanThatListens b = (BeanThatListens) applicationContext.getBean("beanThatListens"); - b.zero(); - assertTrue("0 events before publication", b.getEventCount() == 0); - this.applicationContext.publishEvent(new MyEvent(this)); - assertTrue("1 events after publication, not " + b.getEventCount(), b.getEventCount() == 1); - } - - - @SuppressWarnings("serial") - public static class MyEvent extends ApplicationEvent { - - public MyEvent(Object source) { - super(source); - } - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractBeanFactoryTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/AbstractBeanFactoryTests.java deleted file mode 100644 index cd81c78fa6e..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractBeanFactoryTests.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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.web.context; - -import java.beans.PropertyEditorSupport; -import java.util.StringTokenizer; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.springframework.beans.BeansException; -import org.springframework.beans.PropertyBatchUpdateException; -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.BeanCreationException; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanIsNotAFactoryException; -import org.springframework.beans.factory.BeanNotOfRequiredTypeException; -import org.springframework.beans.factory.DummyFactory; -import org.springframework.beans.factory.LifecycleBean; -import org.springframework.beans.factory.MustBeInitialized; -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; - -/** - * Subclasses must implement setUp() to initialize bean factory - * and any other variables they need. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractBeanFactoryTests extends TestCase { - - protected abstract BeanFactory getBeanFactory(); - - /** - * Roderick beans inherits from rod, overriding name only. - */ - public void testInheritance() { - assertTrue(getBeanFactory().containsBean("rod")); - assertTrue(getBeanFactory().containsBean("roderick")); - TestBean rod = (TestBean) getBeanFactory().getBean("rod"); - TestBean roderick = (TestBean) getBeanFactory().getBean("roderick"); - assertTrue("not == ", rod != roderick); - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - assertTrue("roderick.name is Roderick", roderick.getName().equals("Roderick")); - assertTrue("roderick.age was inherited", roderick.getAge() == rod.getAge()); - } - - public void testGetBeanWithNullArg() { - try { - getBeanFactory().getBean((String) null); - fail("Can't get null bean"); - } - catch (IllegalArgumentException ex) { - // OK - } - } - - /** - * Test that InitializingBean objects receive the afterPropertiesSet() callback - */ - public void testInitializingBeanCallback() { - MustBeInitialized mbi = (MustBeInitialized) getBeanFactory().getBean("mustBeInitialized"); - // The dummy business method will throw an exception if the - // afterPropertiesSet() callback wasn't invoked - mbi.businessMethod(); - } - - /** - * Test that InitializingBean/BeanFactoryAware/DisposableBean objects receive the - * afterPropertiesSet() callback before BeanFactoryAware callbacks - */ - public void testLifecycleCallbacks() { - LifecycleBean lb = (LifecycleBean) getBeanFactory().getBean("lifecycle"); - Assert.assertEquals("lifecycle", lb.getBeanName()); - // The dummy business method will throw an exception if the - // necessary callbacks weren't invoked in the right order. - lb.businessMethod(); - assertTrue("Not destroyed", !lb.isDestroyed()); - } - - public void testFindsValidInstance() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - TestBean rod = (TestBean) o; - assertTrue("rod.name is Rod", rod.getName().equals("Rod")); - assertTrue("rod.age is 31", rod.getAge() == 31); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - assertTrue("Actual type is correct", ex.getActualType() == getBeanFactory().getBean("rod").getClass()); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testGetSharedInstanceByMatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance with matching class"); - } - } - - public void testGetSharedInstanceByMatchingClassNoCatch() { - Object o = getBeanFactory().getBean("rod", TestBean.class); - assertTrue("Rod bean is a TestBean", o instanceof TestBean); - } - - public void testGetSharedInstanceByNonmatchingClass() { - try { - Object o = getBeanFactory().getBean("rod", BeanFactory.class); - fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException"); - } - catch (BeanNotOfRequiredTypeException ex) { - // So far, so good - assertTrue("Exception has correct bean name", ex.getBeanName().equals("rod")); - assertTrue("Exception requiredType must be BeanFactory.class", ex.getRequiredType().equals(BeanFactory.class)); - assertTrue("Exception actualType as TestBean.class", TestBean.class.isAssignableFrom(ex.getActualType())); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testSharedInstancesAreEqual() { - try { - Object o = getBeanFactory().getBean("rod"); - assertTrue("Rod bean1 is a TestBean", o instanceof TestBean); - Object o1 = getBeanFactory().getBean("rod"); - assertTrue("Rod bean2 is a TestBean", o1 instanceof TestBean); - assertTrue("Object equals applies", o == o1); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testPrototypeInstancesAreIndependent() { - TestBean tb1 = (TestBean) getBeanFactory().getBean("kathy"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("kathy"); - assertTrue("ref equal DOES NOT apply", tb1 != tb2); - assertTrue("object equal true", tb1.equals(tb2)); - tb1.setAge(1); - tb2.setAge(2); - assertTrue("1 age independent = 1", tb1.getAge() == 1); - assertTrue("2 age independent = 2", tb2.getAge() == 2); - assertTrue("object equal now false", !tb1.equals(tb2)); - } - - public void testNotThere() { - assertFalse(getBeanFactory().containsBean("Mr Squiggle")); - try { - Object o = getBeanFactory().getBean("Mr Squiggle"); - fail("Can't find missing bean"); - } - catch (BeansException ex) { - //ex.printStackTrace(); - //fail("Shouldn't throw exception on getting valid instance"); - } - } - - public void testValidEmpty() { - try { - Object o = getBeanFactory().getBean("validEmpty"); - assertTrue("validEmpty bean is a TestBean", o instanceof TestBean); - TestBean ve = (TestBean) o; - assertTrue("Valid empty has defaults", ve.getName() == null && ve.getAge() == 0 && ve.getSpouse() == null); - } - catch (BeansException ex) { - ex.printStackTrace(); - fail("Shouldn't throw exception on valid empty"); - } - } - - public void xtestTypeMismatch() { - try { - Object o = getBeanFactory().getBean("typeMismatch"); - fail("Shouldn't succeed with type mismatch"); - } - catch (BeanCreationException wex) { - assertEquals("typeMismatch", wex.getBeanName()); - assertTrue(wex.getCause() instanceof PropertyBatchUpdateException); - PropertyBatchUpdateException ex = (PropertyBatchUpdateException) wex.getCause(); - // Further tests - assertTrue("Has one error ", ex.getExceptionCount() == 1); - assertTrue("Error is for field age", ex.getPropertyAccessException("age") != null); - assertTrue("We have rejected age in exception", ex.getPropertyAccessException("age").getPropertyChangeEvent().getNewValue().equals("34x")); - } - } - - public void testGrandparentDefinitionFoundInBeanFactory() throws Exception { - TestBean dad = (TestBean) getBeanFactory().getBean("father"); - assertTrue("Dad has correct name", dad.getName().equals("Albert")); - } - - public void testFactorySingleton() throws Exception { - assertTrue(getBeanFactory().isSingleton("&singletonFactory")); - assertTrue(getBeanFactory().isSingleton("singletonFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton from factory has correct name, not " + tb.getName(), tb.getName().equals(DummyFactory.SINGLETON_NAME)); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - TestBean tb2 = (TestBean) getBeanFactory().getBean("singletonFactory"); - assertTrue("Singleton references ==", tb == tb2); - assertTrue("FactoryBean is BeanFactoryAware", factory.getBeanFactory() != null); - } - - public void testFactoryPrototype() throws Exception { - assertTrue(getBeanFactory().isSingleton("&prototypeFactory")); - assertFalse(getBeanFactory().isSingleton("prototypeFactory")); - TestBean tb = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue(!tb.getName().equals(DummyFactory.SINGLETON_NAME)); - TestBean tb2 = (TestBean) getBeanFactory().getBean("prototypeFactory"); - assertTrue("Prototype references !=", tb != tb2); - } - - /** - * Check that we can get the factory bean itself. - * This is only possible if we're dealing with a factory - * @throws Exception - */ - public void testGetFactoryItself() throws Exception { - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue(factory != null); - } - - /** - * Check that afterPropertiesSet gets called on factory - * @throws Exception - */ - public void testFactoryIsInitialized() throws Exception { - TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory"); - DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory"); - assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized()); - } - - /** - * It should be illegal to dereference a normal bean - * as a factory - */ - public void testRejectsFactoryGetOnNormalBean() { - try { - getBeanFactory().getBean("&rod"); - fail("Shouldn't permit factory get on normal bean"); - } - catch (BeanIsNotAFactoryException ex) { - // Ok - } - } - - // TODO: refactor in AbstractBeanFactory (tests for AbstractBeanFactory) - // and rename this class - public void testAliasing() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ConfigurableBeanFactory)) { - return; - } - ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) bf; - - String alias = "rods alias"; - try { - cbf.getBean(alias); - fail("Shouldn't permit factory get on normal bean"); - } - catch (NoSuchBeanDefinitionException ex) { - // Ok - assertTrue(alias.equals(ex.getBeanName())); - } - - // Create alias - cbf.registerAlias("rod", alias); - Object rod = getBeanFactory().getBean("rod"); - Object aliasRod = getBeanFactory().getBean(alias); - assertTrue(rod == aliasRod); - } - - - public static class TestBeanEditor extends PropertyEditorSupport { - - public void setAsText(String text) { - TestBean tb = new TestBean(); - StringTokenizer st = new StringTokenizer(text, "_"); - tb.setName(st.nextToken()); - tb.setAge(Integer.parseInt(st.nextToken())); - setValue(tb); - } - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractListableBeanFactoryTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/AbstractListableBeanFactoryTests.java deleted file mode 100644 index 6a2d204d68f..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/AbstractListableBeanFactoryTests.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.springframework.web.context; - -import junit.framework.Assert; - -import org.springframework.beans.TestBean; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.ListableBeanFactory; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFactoryTests { - - /** Subclasses must initialize this */ - protected ListableBeanFactory getListableBeanFactory() { - BeanFactory bf = getBeanFactory(); - if (!(bf instanceof ListableBeanFactory)) { - throw new IllegalStateException("ListableBeanFactory required"); - } - return (ListableBeanFactory) bf; - } - - /** - * Subclasses can override this. - */ - public void testCount() { - assertCount(13); - } - - protected final void assertCount(int count) { - String[] defnames = getListableBeanFactory().getBeanDefinitionNames(); - Assert.assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count); - } - - public void assertTestBeanCount(int count) { - String[] defNames = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, false); - Assert.assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " + - defNames.length, defNames.length == count); - - int countIncludingFactoryBeans = count + 2; - String[] names = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, true); - Assert.assertTrue("We should have " + countIncludingFactoryBeans + - " beans for class org.springframework.beans.TestBean, not " + names.length, - names.length == countIncludingFactoryBeans); - } - - public void testGetDefinitionsForNoSuchClass() { - String[] defnames = getListableBeanFactory().getBeanNamesForType(String.class); - Assert.assertTrue("No string definitions", defnames.length == 0); - } - - /** - * Check that count refers to factory class, not bean class. (We don't know - * what type factories may return, and it may even change over time.) - */ - public void testGetCountForFactoryClass() { - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - - Assert.assertTrue("Should have 2 factories, not " + - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length, - getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2); - } - - public void testContainsBeanDefinition() { - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("rod")); - Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("roderick")); - } - -} \ No newline at end of file diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java index 8169998a93e..15a7e36fea4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,10 +36,10 @@ import javax.servlet.ServletContextListener; import org.junit.Test; import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; -import org.springframework.beans.factory.LifecycleBean; +import org.springframework.tests.sample.beans.LifecycleBean; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextException; @@ -105,6 +105,7 @@ public final class ContextLoaderTests { sc.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, "/org/springframework/web/context/WEB-INF/applicationContext.xml"); final ServletContextListener listener = new ContextLoaderListener() { + @Override protected void customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) { assertNotNull("The ServletContext should not be null.", servletContext); assertEquals("Verifying that we received the expected ServletContext.", sc, servletContext); @@ -301,6 +302,7 @@ public final class ContextLoaderTests { "/org/springframework/web/context/WEB-INF/applicationContext.xml", "/org/springframework/web/context/WEB-INF/fail.xml" }) { + @Override public void refresh() throws BeansException { try { super.refresh(); @@ -320,6 +322,7 @@ public final class ContextLoaderTests { } private static class TestContextInitializer implements ApplicationContextInitializer { + @Override public void initialize(ConfigurableApplicationContext applicationContext) { ConfigurableEnvironment environment = applicationContext.getEnvironment(); environment.getPropertySources().addFirst(new PropertySource("testPropertySource") { @@ -332,6 +335,7 @@ public final class ContextLoaderTests { } private static class TestWebContextInitializer implements ApplicationContextInitializer { + @Override public void initialize(ConfigurableWebApplicationContext applicationContext) { ServletContext ctx = applicationContext.getServletContext(); // type-safe access to servlet-specific methods ctx.setAttribute("initialized", true); @@ -339,6 +343,7 @@ public final class ContextLoaderTests { } private static class EnvApplicationContextInitializer implements ApplicationContextInitializer { + @Override public void initialize(ConfigurableWebApplicationContext applicationContext) { // test that ApplicationContextInitializers can access ServletContext properties // via the environment (SPR-8991) @@ -352,6 +357,7 @@ public final class ContextLoaderTests { } private static class UnknownContextInitializer implements ApplicationContextInitializer { + @Override public void initialize(UnknownApplicationContext applicationContext) { applicationContext.unheardOf(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/ResourceBundleMessageSourceTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/ResourceBundleMessageSourceTests.java deleted file mode 100644 index ff462f3650f..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/ResourceBundleMessageSourceTests.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright 2002-2012 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 - * - * http://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.web.context; - -import java.util.Date; -import java.util.Locale; - -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.MessageSource; -import org.springframework.context.NoSuchMessageException; -import org.springframework.context.support.AbstractMessageSource; -import org.springframework.mock.web.test.MockServletContext; -import org.springframework.ui.context.Theme; -import org.springframework.ui.context.ThemeSource; -import org.springframework.web.context.support.StaticWebApplicationContext; -import org.springframework.web.context.support.XmlWebApplicationContext; -import org.springframework.web.servlet.theme.AbstractThemeResolver; - -/** - * Creates a WebApplicationContext that points to a "web.xml" file that - * contains the entry for what file to use for the applicationContext - * (file "org/springframework/web/context/WEB-INF/applicationContext.xml"). - * That file then has an entry for a bean called "messageSource". - * Whatever the basename property is set to for this bean is what the name of - * a properties file in the classpath must be (in our case the name is - * "messages" - note no package names). - * Thus the catalog filename will be in the root of where the classes are compiled - * to and will be called "messages_XX_YY.properties" where "XX" and "YY" are the - * language and country codes known by the ResourceBundle class. - * - *

NOTE: The main method of this class is the "createWebApplicationContext(...)" method, - * and it was copied from org.springframework.web.context.XmlWebApplicationContextTests. - * - * @author Rod Johnson - * @author Jean-Pierre Pawlak - */ -public class ResourceBundleMessageSourceTests extends AbstractApplicationContextTests { - - /** - * We use ticket WAR root for file structure. - * We don't attempt to read web.xml. - */ - public static final String WAR_ROOT = "/org/springframework/web/context"; - - private ConfigurableWebApplicationContext root; - - private MessageSource themeMsgSource; - - protected ConfigurableApplicationContext createContext() throws Exception { - root = new XmlWebApplicationContext(); - MockServletContext sc = new MockServletContext(); - root.setServletContext(sc); - root.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/applicationContext.xml"}); - root.refresh(); - - ConfigurableWebApplicationContext wac = new XmlWebApplicationContext(); - wac.setParent(root); - wac.setServletContext(sc); - wac.setNamespace("test-servlet"); - wac.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/test-servlet.xml"}); - wac.refresh(); - - Theme theme = ((ThemeSource) wac).getTheme(AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME); - assertNotNull(theme); - assertTrue("Theme name has to be the default theme name", AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME.equals(theme.getName())); - themeMsgSource = theme.getMessageSource(); - assertNotNull(themeMsgSource); - return wac; - } - - public void testCount() { - assertTrue("should have 14 beans, not " + - this.applicationContext.getBeanDefinitionCount(), - this.applicationContext.getBeanDefinitionCount() == 14); - } - - /** - * Overridden as we can't trust superclass method. - * @see org.springframework.context.AbstractApplicationContextTests#testEvents() - */ - public void testEvents() throws Exception { - // Do nothing - } - - public void testRootMessageSourceWithUseCodeAsDefaultMessage() throws NoSuchMessageException { - AbstractMessageSource messageSource = (AbstractMessageSource) root.getBean("messageSource"); - messageSource.setUseCodeAsDefaultMessage(true); - - assertEquals("message1", applicationContext.getMessage("code1", null, Locale.getDefault())); - assertEquals("message2", applicationContext.getMessage("code2", null, Locale.getDefault())); - - try { - applicationContext.getMessage("code0", null, Locale.getDefault()); - fail("looking for code0 should throw a NoSuchMessageException"); - } - catch (NoSuchMessageException ex) { - // that's how it should be - } - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/messagesXXX.properties" files. - */ - public void testGetMessageWithDefaultPassedInAndFoundInMsgCatalog() { - assertTrue("valid msg from resourcebundle with default msg passed in returned default msg. Expected msg from catalog.", - getApplicationContext().getMessage("message.format.example2", null, "This is a default msg if not found in msg.cat.", Locale.US - ) - .equals("This is a test message in the message catalog with no args.")); - // getApplicationContext().getTheme("theme").getMessageSource().getMessage() - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/messagesXXX.properties" files. - */ - public void testGetMessageWithDefaultPassedInAndNotFoundInMsgCatalog() { - assertTrue("bogus msg from resourcebundle with default msg passed in returned default msg", - getApplicationContext().getMessage("bogus.message", null, "This is a default msg if not found in msg.cat.", Locale.UK - ) - .equals("This is a default msg if not found in msg.cat.")); - } - - /** - * The underlying implementation uses a hashMap to cache messageFormats - * once a message has been asked for. This test is an attempt to - * make sure the cache is being used properly. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/messagesXXX.properties" files. - * @see org.springframework.context.support.AbstractMessageSource for more details. - */ - public void testGetMessageWithMessageAlreadyLookedFor() throws Exception { - Object[] arguments = { - new Integer(7), new Date(System.currentTimeMillis()), - "a disturbance in the Force" - }; - - // The first time searching, we don't care about for this test - getApplicationContext().getMessage("message.format.example1", arguments, Locale.US); - - // Now msg better be as expected - assertTrue("2nd search within MsgFormat cache returned expected message for Locale.US", - getApplicationContext().getMessage("message.format.example1", arguments, Locale.US - ) - .indexOf("there was \"a disturbance in the Force\" on planet 7.") != -1); - - Object[] newArguments = { - new Integer(8), new Date(System.currentTimeMillis()), - "a disturbance in the Force" - }; - - // Now msg better be as expected even with different args - assertTrue("2nd search within MsgFormat cache with different args returned expected message for Locale.US", - getApplicationContext().getMessage("message.format.example1", newArguments, Locale.US - ) - .indexOf("there was \"a disturbance in the Force\" on planet 8.") != -1); - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/messagesXXX.properties" files. - * Example taken from the javadocs for the java.text.MessageFormat class - */ - public void testGetMessageWithNoDefaultPassedInAndFoundInMsgCatalog() throws Exception { - Object[] arguments = { - new Integer(7), new Date(System.currentTimeMillis()), - "a disturbance in the Force" - }; - - /* - Try with Locale.US - Since the msg has a time value in it, we will use String.indexOf(...) - to just look for a substring without the time. This is because it is - possible that by the time we store a time variable in this method - and the time the ResourceBundleMessageSource resolves the msg the - minutes of the time might not be the same. - */ - assertTrue("msg from resourcebundle for Locale.US substituting args for placeholders is as expected", - getApplicationContext().getMessage("message.format.example1", arguments, Locale.US - ) - .indexOf("there was \"a disturbance in the Force\" on planet 7.") != -1); - - // Try with Locale.UK - assertTrue("msg from resourcebundle for Locale.UK substituting args for placeholders is as expected", - getApplicationContext().getMessage("message.format.example1", arguments, Locale.UK - ) - .indexOf("there was \"a disturbance in the Force\" on station number 7.") != -1); - - // Try with Locale.US - different test msg that requires no args - assertTrue("msg from resourcebundle that requires no args for Locale.US is as expected", - getApplicationContext().getMessage("message.format.example2", null, Locale.US) - .equals("This is a test message in the message catalog with no args.")); - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/messagesXXX.properties" files. - */ - public void testGetMessageWithNoDefaultPassedInAndNotFoundInMsgCatalog() { - // Expecting an exception - try { - getApplicationContext().getMessage("bogus.message", null, Locale.UK); - fail("bogus msg from resourcebundle without default msg should have thrown exception"); - } - catch (NoSuchMessageException tExcept) { - assertTrue("bogus msg from resourcebundle without default msg threw expected exception", - true); - } - } - - public void testGetMultipleBasenamesForMessageSource() throws NoSuchMessageException { - assertEquals("message1", getApplicationContext().getMessage("code1", null, Locale.UK)); - assertEquals("message2", getApplicationContext().getMessage("code2", null, Locale.UK)); - assertEquals("message3", getApplicationContext().getMessage("code3", null, Locale.UK)); - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/themeXXX.properties" files. - */ - public void testGetMessageWithDefaultPassedInAndFoundInThemeCatalog() { - // Try with Locale.US - String msg = getThemeMessage("theme.example1", null, "This is a default theme msg if not found in theme cat.", Locale.US); - assertTrue("valid msg from theme resourcebundle with default msg passed in returned default msg. Expected msg from catalog. Received: " + msg, - msg.equals("This is a test message in the theme message catalog.")); - // Try with Locale.UK - msg = getThemeMessage("theme.example1", null, "This is a default theme msg if not found in theme cat.", Locale.UK); - assertTrue("valid msg from theme resourcebundle with default msg passed in returned default msg. Expected msg from catalog.", - msg.equals("This is a test message in the theme message catalog with no args.")); - } - - /** - * @see org.springframework.context.support.AbstractMessageSource for more details. - * NOTE: Messages are contained within the "test/org/springframework/web/context/WEB-INF/themeXXX.properties" files. - */ - public void testGetMessageWithDefaultPassedInAndNotFoundInThemeCatalog() { - assertTrue("bogus msg from theme resourcebundle with default msg passed in returned default msg", - getThemeMessage("bogus.message", null, "This is a default msg if not found in theme cat.", Locale.UK - ) - .equals("This is a default msg if not found in theme cat.")); - } - - public void testThemeSourceNesting() throws NoSuchMessageException { - String overriddenMsg = getThemeMessage("theme.example2", null, null, Locale.UK); - MessageSource ms = ((ThemeSource) root).getTheme(AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME).getMessageSource(); - String originalMsg = ms.getMessage("theme.example2", null, Locale.UK); - assertTrue("correct overridden msg", "test-message2".equals(overriddenMsg)); - assertTrue("correct original msg", "message2".equals(originalMsg)); - } - - public void testThemeSourceNestingWithParentDefault() throws NoSuchMessageException { - StaticWebApplicationContext leaf = new StaticWebApplicationContext(); - leaf.setParent(getApplicationContext()); - leaf.refresh(); - assertNotNull("theme still found", leaf.getTheme("theme")); - MessageSource ms = leaf.getTheme("theme").getMessageSource(); - String msg = ms.getMessage("theme.example2", null, null, Locale.UK); - assertEquals("correct overridden msg", "test-message2", msg); - } - - private String getThemeMessage(String code, Object args[], String defaultMessage, Locale locale) { - return themeMsgSource.getMessage(code, args, defaultMessage, locale); - } - -} diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/ServletConfigAwareBean.java b/spring-webmvc/src/test/java/org/springframework/web/context/ServletConfigAwareBean.java index c3dc6275e1b..7276af86ae9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/ServletConfigAwareBean.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/ServletConfigAwareBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ public class ServletConfigAwareBean implements ServletConfigAware { private ServletConfig servletConfig; + @Override public void setServletConfig(ServletConfig servletConfig) { this.servletConfig = servletConfig; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/ServletContextAwareBean.java b/spring-webmvc/src/test/java/org/springframework/web/context/ServletContextAwareBean.java index a868f2f30d9..9363468268d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/ServletContextAwareBean.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/ServletContextAwareBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ public class ServletContextAwareBean implements ServletContextAware { private ServletContext servletContext; + @Override public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml index e25d3317379..6080b76eb0a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/ContextLoaderTests-acc-context.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/applicationContext.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/applicationContext.xml index 3a59552ded2..b4d7c366f24 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/applicationContext.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/applicationContext.xml @@ -9,7 +9,7 @@ - + - + dummy @@ -45,7 +45,7 @@ Tests of lifecycle callbacks --> + class="org.springframework.tests.sample.beans.MustBeInitialized"> 31 - + - + Kerry 34 - + typeMismatch 34x @@ -31,20 +31,20 @@ + class="org.springframework.tests.sample.beans.factory.DummyFactory"> + class="org.springframework.tests.sample.beans.factory.DummyFactory"> false - + listenerVeto 66 - + diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/contextInclude.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/contextInclude.xml index 2e4938383be..5f178d50ebb 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/contextInclude.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/contextInclude.xml @@ -1,6 +1,6 @@ - + yetanotherdummy diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml index 7da590d1f21..eb7bf0f6eae 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml @@ -3,12 +3,12 @@ - + - + diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/test-servlet.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/test-servlet.xml index 4002703b211..85885f238d0 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/test-servlet.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/test-servlet.xml @@ -15,7 +15,7 @@ - + Rod 31 @@ -28,32 +28,32 @@ 31 - + - + Kerry 34 - + typeMismatch 34x - + - + false - + listenerVeto 66 - + diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/testNamespace.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/testNamespace.xml index dd10e5fcab7..89c42365d4a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/testNamespace.xml +++ b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/testNamespace.xml @@ -3,12 +3,12 @@ - + Rod 31 - + Kerry 34 diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java index cca608e9f19..4dce1e9fac3 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,12 +21,13 @@ import java.util.Locale; import javax.servlet.ServletException; import org.springframework.beans.BeansException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.context.AbstractApplicationContextTests; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.NoSuchMessageException; import org.springframework.context.TestListener; @@ -45,6 +46,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes private ConfigurableWebApplicationContext root; + @Override protected ConfigurableApplicationContext createContext() throws Exception { InitAndIB.constructed = false; root = new XmlWebApplicationContext(); @@ -53,8 +55,10 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes root.setServletContext(sc); root.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/applicationContext.xml"}); root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() { + @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { beanFactory.addBeanPostProcessor(new BeanPostProcessor() { + @Override @SuppressWarnings("unchecked") public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { if (bean instanceof TestBean) { @@ -62,6 +66,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes } return bean; } + @Override public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { return bean; } @@ -90,6 +95,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes * Overridden as we can't trust superclass method * @see org.springframework.context.AbstractApplicationContextTests#testEvents() */ + @Override public void testEvents() throws Exception { TestListener listener = (TestListener) this.applicationContext.getBean("testListener"); listener.zeroCounter(); @@ -104,6 +110,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes assertTrue("1 parent events after publication", parentListener.getEventCount() == 1); } + @Override public void testCount() { assertTrue("should have 14 beans, not "+ this.applicationContext.getBeanDefinitionCount(), this.applicationContext.getBeanDefinitionCount() == 14); @@ -169,6 +176,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes constructed = true; } + @Override public void afterPropertiesSet() { if (this.initMethodInvoked) fail(); @@ -182,6 +190,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes this.initMethodInvoked = true; } + @Override public void destroy() { if (this.customDestroyed) fail(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/support/HttpRequestHandlerTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/support/HttpRequestHandlerTests.java index 96429a28cda..c6a5025c137 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/support/HttpRequestHandlerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/support/HttpRequestHandlerTests.java @@ -48,6 +48,7 @@ public class HttpRequestHandlerTests { StaticWebApplicationContext wac = new StaticWebApplicationContext(); wac.getBeanFactory().registerSingleton("myHandler", new HttpRequestHandler() { + @Override public void handleRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { assertSame(request, req); assertSame(response, res); diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java index 75af2c0b5a4..07823327e66 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,10 @@ package org.springframework.web.context.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.IOException; import java.util.Collections; @@ -28,7 +31,7 @@ import java.util.Set; import org.junit.Test; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.ConstructorArgumentValues; @@ -38,6 +41,7 @@ import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.support.ManagedMap; import org.springframework.beans.factory.support.ManagedSet; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.io.Resource; import org.springframework.mock.web.test.MockServletContext; @@ -51,6 +55,7 @@ import org.springframework.mock.web.test.MockServletContext; public class ServletContextSupportTests { @Test + @Deprecated public void testServletContextFactoryBean() { MockServletContext sc = new MockServletContext(); @@ -155,6 +160,7 @@ public class ServletContextSupportTests { } @Test + @Deprecated public void testServletContextPropertyPlaceholderConfigurer() { MockServletContext sc = new MockServletContext(); sc.addInitParameter("key4", "mykey4"); @@ -168,7 +174,7 @@ public class ServletContextSupportTests { pvs.add("spouse", new RuntimeBeanReference("${ref}")); wac.registerSingleton("tb1", TestBean.class, pvs); - RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, null); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); wac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd); pvs = new MutablePropertyValues(); @@ -185,6 +191,7 @@ public class ServletContextSupportTests { } @Test + @Deprecated public void testServletContextPropertyPlaceholderConfigurerWithLocalOverriding() { MockServletContext sc = new MockServletContext(); sc.addInitParameter("key4", "mykey4"); @@ -198,7 +205,7 @@ public class ServletContextSupportTests { pvs.add("spouse", new RuntimeBeanReference("${ref}")); wac.registerSingleton("tb1", TestBean.class, pvs); - RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, null); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); wac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd); pvs = new MutablePropertyValues(); @@ -215,6 +222,7 @@ public class ServletContextSupportTests { } @Test + @Deprecated public void testServletContextPropertyPlaceholderConfigurerWithContextOverride() { MockServletContext sc = new MockServletContext(); sc.addInitParameter("key4", "mykey4"); @@ -228,7 +236,7 @@ public class ServletContextSupportTests { pvs.add("spouse", new RuntimeBeanReference("${ref}")); wac.registerSingleton("tb1", TestBean.class, pvs); - RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, null); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); wac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd); pvs = new MutablePropertyValues(); @@ -246,6 +254,7 @@ public class ServletContextSupportTests { } @Test + @Deprecated public void testServletContextPropertyPlaceholderConfigurerWithContextOverrideAndAttributes() { MockServletContext sc = new MockServletContext(); sc.addInitParameter("key4", "mykey4"); @@ -260,7 +269,7 @@ public class ServletContextSupportTests { pvs.add("spouse", new RuntimeBeanReference("${ref}")); wac.registerSingleton("tb1", TestBean.class, pvs); - RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, null); + RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); wac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd); pvs = new MutablePropertyValues(); @@ -279,6 +288,7 @@ public class ServletContextSupportTests { } @Test + @Deprecated public void testServletContextPropertyPlaceholderConfigurerWithAttributes() { MockServletContext sc = new MockServletContext(); sc.addInitParameter("key4", "mykey4"); @@ -312,7 +322,9 @@ public class ServletContextSupportTests { someMap.put("key2", "${age}name"); MutablePropertyValues innerPvs = new MutablePropertyValues(); innerPvs.add("touchy", "${os.name}"); - someMap.put("key3", new RootBeanDefinition(TestBean.class, innerPvs)); + RootBeanDefinition innerBd = new RootBeanDefinition(TestBean.class); + innerBd.setPropertyValues(innerPvs); + someMap.put("key3", innerBd); MutablePropertyValues innerPvs2 = new MutablePropertyValues(innerPvs); someMap.put("${key4}", new BeanDefinitionHolder(new ChildBeanDefinition("tb1", innerPvs2), "child")); pvs.add("someMap", someMap); @@ -371,6 +383,7 @@ public class ServletContextSupportTests { paths.add("/WEB-INF/context2.xml"); MockServletContext sc = new MockServletContext("classpath:org/springframework/web/context") { + @Override public Set getResourcePaths(String path) { if ("/WEB-INF/".equals(path)) { return paths; @@ -397,6 +410,7 @@ public class ServletContextSupportTests { dirs.add("/WEB-INF/mydir2/"); MockServletContext sc = new MockServletContext("classpath:org/springframework/web/context") { + @Override public Set getResourcePaths(String path) { if ("/WEB-INF/".equals(path)) { return dirs; @@ -433,6 +447,7 @@ public class ServletContextSupportTests { paths.add("/WEB-INF/mydir2/mydir3/"); MockServletContext sc = new MockServletContext("classpath:org/springframework/web/context") { + @Override public Set getResourcePaths(String path) { if ("/WEB-INF/".equals(path)) { return dirs; @@ -470,6 +485,7 @@ public class ServletContextSupportTests { paths.add("C:/webroot/someOtherDirThatDoesntContainPath"); MockServletContext sc = new MockServletContext("classpath:org/springframework/web/context") { + @Override public Set getResourcePaths(String path) { if ("/WEB-INF/".equals(path)) { return paths; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java index cae15040058..b5b4f0206fa 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -73,6 +73,7 @@ import org.springframework.web.servlet.view.ResourceBundleViewResolver; */ public class ComplexWebApplicationContext extends StaticWebApplicationContext { + @Override public void refresh() throws BeansException { registerSingleton(DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME, SessionLocaleResolver.class); registerSingleton(DispatcherServlet.THEME_RESOLVER_BEAN_NAME, SessionThemeResolver.class); @@ -130,7 +131,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { registerSingleton("viewResolver2", InternalResourceViewResolver.class, pvs); pvs = new MutablePropertyValues(); - pvs.add("commandClass", "org.springframework.beans.TestBean"); + pvs.add("commandClass", "org.springframework.tests.sample.beans.TestBean"); pvs.add("formView", "form"); registerSingleton("formHandler", SimpleFormController.class, pvs); @@ -179,6 +180,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class HeadController implements Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { if ("HEAD".equals(request.getMethod())) { response.setContentLength(5); @@ -190,6 +192,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class BodyController implements Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { response.getOutputStream().write("body".getBytes()); return null; @@ -199,6 +202,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class NoViewController implements Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { return new ModelAndView(); } @@ -209,22 +213,27 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { private ServletConfig servletConfig; + @Override public void init(ServletConfig servletConfig) throws ServletException { this.servletConfig = servletConfig; } + @Override public ServletConfig getServletConfig() { return servletConfig; } + @Override public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException { servletResponse.getOutputStream().write("body".getBytes()); } + @Override public String getServletInfo() { return null; } + @Override public void destroy() { this.servletConfig = null; } @@ -241,20 +250,24 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MyHandlerAdapter extends ApplicationObjectSupport implements HandlerAdapter, Ordered { + @Override public int getOrder() { return 99; } + @Override public boolean supports(Object handler) { return handler != null && MyHandler.class.isAssignableFrom(handler.getClass()); } + @Override public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object delegate) throws ServletException, IllegalAccessException { ((MyHandler) delegate).doSomething(request); return null; } + @Override public long getLastModified(HttpServletRequest request, Object delegate) { return ((MyHandler) delegate).lastModified(); } @@ -263,15 +276,18 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MyDummyAdapter extends ApplicationObjectSupport implements HandlerAdapter { + @Override public boolean supports(Object handler) { return handler != null && MyHandler.class.isAssignableFrom(handler.getClass()); } + @Override public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object delegate) throws IOException, ServletException { throw new ServletException("dummy"); } + @Override public long getLastModified(HttpServletRequest request, Object delegate) { return -1; } @@ -280,6 +296,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MyHandlerInterceptor1 implements HandlerInterceptor { + @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException { if (request.getAttribute("test2") != null) { @@ -291,6 +308,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { return true; } + @Override public void postHandle( HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws ServletException { @@ -303,6 +321,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { request.removeAttribute("test1x"); } + @Override public void afterCompletion( HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws ServletException { @@ -316,6 +335,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MyHandlerInterceptor2 implements HandlerInterceptor { + @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException { if (request.getAttribute("test1x") == null) { @@ -330,6 +350,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { return true; } + @Override public void postHandle( HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws ServletException { @@ -345,6 +366,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { request.removeAttribute("test2x"); } + @Override public void afterCompletion( HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { @@ -358,14 +380,17 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MyWebRequestInterceptor implements WebRequestInterceptor { + @Override public void preHandle(WebRequest request) throws Exception { request.setAttribute("test3", "test3", WebRequest.SCOPE_REQUEST); } + @Override public void postHandle(WebRequest request, ModelMap model) throws Exception { request.setAttribute("test3x", "test3x", WebRequest.SCOPE_REQUEST); } + @Override public void afterCompletion(WebRequest request, Exception ex) throws Exception { request.setAttribute("test3y", "test3y", WebRequest.SCOPE_REQUEST); } @@ -374,6 +399,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class ComplexLocaleChecker implements MyHandler { + @Override public void doSomething(HttpServletRequest request) throws ServletException, IllegalAccessException { WebApplicationContext wac = RequestContextUtils.getWebApplicationContext(request); if (!(wac instanceof ComplexWebApplicationContext)) { @@ -411,6 +437,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { } } + @Override public long lastModified() { return 99; } @@ -419,10 +446,12 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public static class MockMultipartResolver implements MultipartResolver { + @Override public boolean isMultipart(HttpServletRequest request) { return true; } + @Override public MultipartHttpServletRequest resolveMultipart(HttpServletRequest request) throws MultipartException { if (request.getAttribute("fail") != null) { throw new MaxUploadSizeExceededException(1000); @@ -435,15 +464,18 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { } request.setAttribute("resolved", Boolean.TRUE); return new AbstractMultipartHttpServletRequest(request) { + @Override public HttpHeaders getMultipartHeaders(String paramOrFileName) { return null; } + @Override public String getMultipartContentType(String paramOrFileName) { return null; } }; } + @Override public void cleanupMultipart(MultipartHttpServletRequest request) { if (request.getAttribute("cleanedUp") != null) { throw new IllegalStateException("Already cleaned up"); @@ -457,6 +489,7 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { public int counter = 0; + @Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof RequestHandledEvent) { this.counter++; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/DispatcherServletTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/DispatcherServletTests.java index 9eadbf64610..147875e4ca4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/DispatcherServletTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/DispatcherServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -32,12 +32,11 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import junit.framework.Assert; import junit.framework.TestCase; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.DefaultMessageSourceResolvable; import org.springframework.core.env.ConfigurableEnvironment; @@ -81,6 +80,7 @@ public class DispatcherServletTests extends TestCase { private DispatcherServlet complexDispatcherServlet; + @Override protected void setUp() throws ServletException { servletConfig = new MockServletConfig(new MockServletContext(), "simple"); MockServletConfig complexConfig = new MockServletConfig(servletConfig.getServletContext(), "complex"); @@ -143,7 +143,7 @@ public class DispatcherServletTests extends TestCase { ComplexWebApplicationContext.TestApplicationListener listener = (ComplexWebApplicationContext.TestApplicationListener) complexDispatcherServlet .getWebApplicationContext().getBean("testListener"); - Assert.assertEquals(1, listener.counter); + assertEquals(1, listener.counter); } public void testPublishEventsOff() throws Exception { @@ -154,7 +154,7 @@ public class DispatcherServletTests extends TestCase { ComplexWebApplicationContext.TestApplicationListener listener = (ComplexWebApplicationContext.TestApplicationListener) complexDispatcherServlet .getWebApplicationContext().getBean("testListener"); - Assert.assertEquals(0, listener.counter); + assertEquals(0, listener.counter); } public void testFormRequest() throws Exception { @@ -869,6 +869,7 @@ public class DispatcherServletTests extends TestCase { public static class ControllerFromParent implements Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { return new ModelAndView(ControllerFromParent.class.getName()); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/FlashMapTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/FlashMapTests.java index dba96246098..f9ad57ba052 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/FlashMapTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/FlashMapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java index 70c40be9fd1..ce525f937da 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2013 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. @@ -47,9 +47,10 @@ import org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping; */ public class SimpleWebApplicationContext extends StaticWebApplicationContext { + @Override public void refresh() throws BeansException { MutablePropertyValues pvs = new MutablePropertyValues(); - pvs.add("commandClass", "org.springframework.beans.TestBean"); + pvs.add("commandClass", "org.springframework.tests.sample.beans.TestBean"); pvs.add("formView", "form"); registerSingleton("/form.do", SimpleFormController.class, pvs); @@ -75,6 +76,7 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext { public static class LocaleChecker implements Controller, LastModified { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (!(RequestContextUtils.getWebApplicationContext(request) instanceof SimpleWebApplicationContext)) { @@ -89,6 +91,7 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext { return null; } + @Override public long getLastModified(HttpServletRequest request) { return 98; } @@ -105,6 +108,7 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext { this.messageSource.addMessage("themetestArgs", Locale.ENGLISH, "theme test message {0}"); } + @Override public Theme getTheme(String themeName) { if (AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME.equals(themeName)) { return new SimpleTheme(AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME, this.messageSource); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParserTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParserTests.java index e1c8898604f..3f72adf22e5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParserTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -148,6 +148,7 @@ public class AnnotationDrivenBeanDefinitionParserTests { class TestWebArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception { return null; } @@ -156,10 +157,12 @@ class TestWebArgumentResolver implements WebArgumentResolver { class TestHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { + @Override public boolean supportsParameter(MethodParameter parameter) { return false; } + @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { return null; @@ -168,10 +171,12 @@ class TestHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver class TestHandlerMethodReturnValueHandler implements HandlerMethodReturnValueHandler { + @Override public boolean supportsReturnType(MethodParameter returnType) { return false; } + @Override public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception { @@ -181,10 +186,12 @@ class TestHandlerMethodReturnValueHandler implements HandlerMethodReturnValueHan class TestMessageCodesResolver implements MessageCodesResolver { + @Override public String[] resolveMessageCodes(String errorCode, String objectName) { return new String[] { "test.foo.bar" }; } + @Override @SuppressWarnings("rawtypes") public String[] resolveMessageCodes(String errorCode, String objectName, String field, Class fieldType) { return new String[] { "test.foo.bar" }; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java index 9ced7b5ddd9..8ff997204f1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java @@ -516,10 +516,12 @@ public class MvcNamespaceTests { boolean validatorInvoked; + @Override public boolean supports(Class clazz) { return true; } + @Override public void validate(Object target, Errors errors) { this.validatorInvoked = true; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java index 6c43c1ea0fd..b1433e2986e 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java @@ -161,13 +161,16 @@ public class InterceptorRegistryTests { private boolean preHandleInvoked = false; + @Override public void preHandle(WebRequest request) throws Exception { preHandleInvoked = true; } + @Override public void postHandle(WebRequest request, ModelMap model) throws Exception { } + @Override public void afterCompletion(WebRequest request, Exception ex) throws Exception { } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistryTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistryTests.java index 888cdfe9b28..0695958fa74 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistryTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewControllerRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportExtensionTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportExtensionTests.java index c14ad7735ca..40f10ea7e60 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportExtensionTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import java.util.List; import org.junit.Before; import org.junit.Test; import org.springframework.beans.DirectFieldAccessor; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.convert.converter.Converter; import org.springframework.core.io.FileSystemResourceLoader; import org.springframework.format.FormatterRegistry; @@ -222,6 +222,7 @@ public class WebMvcConfigurationSupportExtensionTests { @Override public void addFormatters(FormatterRegistry registry) { registry.addConverter(new Converter() { + @Override public String convert(TestBean source) { return "converted"; } @@ -236,9 +237,11 @@ public class WebMvcConfigurationSupportExtensionTests { @Override public Validator getValidator() { return new Validator() { + @Override public void validate(Object target, Errors errors) { errors.reject("invalid"); } + @Override public boolean supports(Class clazz) { return true; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/BeanNameUrlHandlerMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/BeanNameUrlHandlerMappingTests.java index 6e018218fd7..c8e3a860d70 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/BeanNameUrlHandlerMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/BeanNameUrlHandlerMappingTests.java @@ -38,6 +38,7 @@ public class BeanNameUrlHandlerMappingTests extends TestCase { private ConfigurableWebApplicationContext wac; + @Override public void setUp() throws Exception { MockServletContext sc = new MockServletContext(""); wac = new XmlWebApplicationContext(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CancellableFormControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CancellableFormControllerTests.java index d066e44525f..ff3ebd962f4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CancellableFormControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CancellableFormControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +21,7 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.validation.BindException; @@ -183,6 +183,7 @@ public class CancellableFormControllerTests extends TestCase { final String reason = "Because I wanted to"; TestController ctl = new TestController() { + @Override protected ModelAndView onCancel(HttpServletRequest request, HttpServletResponse response, Object command) { return new ModelAndView(getCancelView(), "reason", reason); } @@ -221,9 +222,11 @@ public class CancellableFormControllerTests extends TestCase { private boolean invoked = false; + @Override public boolean supports(Class clazz) { return TestBean.class.isAssignableFrom(clazz); } + @Override public void validate(Object target, Errors errors) { this.invoked = true; TestBean tb = (TestBean) target; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CommandControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CommandControllerTests.java index 26b73b097fd..da2da2e174a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CommandControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/CommandControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.mock.web.test.MockHttpServletRequest; @@ -208,6 +208,7 @@ public class CommandControllerTests extends TestCase { public void testCachingWithLastModified() throws Exception { class LastModifiedTestController extends TestController implements LastModified { + @Override public long getLastModified(HttpServletRequest request) { return 0; } @@ -223,6 +224,7 @@ public class CommandControllerTests extends TestCase { public void testCachingWithCustomCacheForSecondsCall() throws Exception { TestController mc = new TestController() { + @Override protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) { cacheForSeconds(response, 5); return super.handle(request, response, command, errors); @@ -237,6 +239,7 @@ public class CommandControllerTests extends TestCase { public void testCachingWithCustomApplyCacheSecondsCall1() throws Exception { TestController mc = new TestController() { + @Override protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) { applyCacheSeconds(response, 5); return super.handle(request, response, command, errors); @@ -251,6 +254,7 @@ public class CommandControllerTests extends TestCase { public void testCachingWithCustomApplyCacheSecondsCall2() throws Exception { TestController mc = new TestController() { + @Override protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) { applyCacheSeconds(response, 0); return super.handle(request, response, command, errors); @@ -267,6 +271,7 @@ public class CommandControllerTests extends TestCase { public void testCachingWithCustomApplyCacheSecondsCall3() throws Exception { TestController mc = new TestController() { + @Override protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) { applyCacheSeconds(response, -1); return super.handle(request, response, command, errors); @@ -282,6 +287,7 @@ public class CommandControllerTests extends TestCase { public void testCustomDateEditorWithAllowEmpty() throws Exception { final DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.GERMAN); TestController mc = new TestController() { + @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(df, true)); } @@ -311,6 +317,7 @@ public class CommandControllerTests extends TestCase { public void testCustomDateEditorWithoutAllowEmpty() throws Exception { final DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.GERMAN); TestController mc = new TestController() { + @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(df, false)); } @@ -341,6 +348,7 @@ public class CommandControllerTests extends TestCase { final NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN); TestController mc = new TestController() { + @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { binder.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true)); } @@ -371,6 +379,7 @@ public class CommandControllerTests extends TestCase { final NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN); TestController mc = new TestController() { + @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { binder.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false)); } @@ -463,9 +472,11 @@ public class CommandControllerTests extends TestCase { public void testResetEmptyFieldsTurnedOff() throws Exception { TestController mc = new TestController() { + @Override protected Object getCommand(HttpServletRequest request) throws Exception { return new TestBean("original", 99); } + @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { binder.setFieldMarkerPrefix(null); } @@ -497,6 +508,7 @@ public class CommandControllerTests extends TestCase { super(TestBean.class, "person"); } + @Override protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) { Map m = new HashMap(); assertTrue("Command not null", command != null); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/ControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/ControllerTests.java index 584e03d14ca..208225c4333 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/ControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/ControllerTests.java @@ -178,23 +178,28 @@ public class ControllerTests extends TestCase { destroyed = false; } + @Override public void init(ServletConfig servletConfig) { config = servletConfig; } + @Override public ServletConfig getServletConfig() { return config; } + @Override public void service(ServletRequest servletRequest, ServletResponse servletResponse) { request = servletRequest; response = servletResponse; } + @Override public String getServletInfo() { return "TestServlet"; } + @Override public void destroy() { destroyed = true; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/FormControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/FormControllerTests.java index ac926b224f5..3c40caacd6b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/FormControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/FormControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; -import org.springframework.beans.IndexedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.support.StaticApplicationContext; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; @@ -46,6 +46,7 @@ import org.springframework.web.servlet.ModelAndView; * @author Rod Johnson * @author Juergen Hoeller */ +@Deprecated public class FormControllerTests extends TestCase { public void testReferenceDataOnForm() throws Exception { @@ -122,6 +123,7 @@ public class FormControllerTests extends TestCase { final Integer someNumber = new Integer(12); TestController mc = new TestController() { + @Override protected void onBindOnNewForm(HttpServletRequest request, Object command) throws Exception { TestBean testBean = (TestBean)command; testBean.setSomeNumber(new Integer(12)); @@ -370,6 +372,7 @@ public class FormControllerTests extends TestCase { String successView = "s"; TestController mc = new TestController() { + @Override protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { throw new ServletException("invalid submit"); @@ -438,10 +441,12 @@ public class FormControllerTests extends TestCase { final Float myFloat = new Float("123.45"); TestController mc = new TestController() { + @Override protected boolean isFormChangeRequest(HttpServletRequest request) { return (request.getParameter("formChange") != null); } + @Override protected void onFormChange(HttpServletRequest request, HttpServletResponse response, Object command) { assertNotNull("Command should not be null", command); assertEquals("Incorrect command class", TestBean.class, command.getClass()); @@ -513,8 +518,10 @@ public class FormControllerTests extends TestCase { public static String TOOSHORT = "tooshort"; + @Override public boolean supports(Class clazz) { return true; } + @Override public void validate(Object obj, Errors errors) { TestBean tb = (TestBean) obj; if (tb.getName() == null || "".equals(tb.getName())) @@ -529,8 +536,10 @@ public class FormControllerTests extends TestCase { public static String TOOSHORT = "tooshort"; + @Override public boolean supports(Class clazz) { return true; } + @Override public void validate(Object obj, Errors errors) { errors.reject("test", "testmessage"); } @@ -548,12 +557,14 @@ public class FormControllerTests extends TestCase { setCommandName(BEAN_NAME); } + @Override protected Object formBackingObject(HttpServletRequest request) throws ServletException { TestBean person = new TestBean(); person.setAge(DEFAULT_AGE); return person; } + @Override protected boolean isFormChangeRequest(HttpServletRequest request) { return (request.getParameter("formChange") != null); } @@ -562,6 +573,7 @@ public class FormControllerTests extends TestCase { private static class TestControllerWithCustomOnSubmit extends TestController { + @Override protected ModelAndView onSubmit(Object command) throws Exception { return new ModelAndView("mySuccess"); } @@ -580,6 +592,7 @@ public class FormControllerTests extends TestCase { setCommandClass(TestBean.class); } + @Override protected Map referenceData(HttpServletRequest request) { ++refDataCount; Map m = new HashMap(); @@ -595,6 +608,7 @@ public class FormControllerTests extends TestCase { public static class BooleanBindingFormController extends AbstractFormController { + @Override protected ModelAndView processFormSubmission (HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) throws Exception { ModelAndView mav = new ModelAndView(); @@ -602,6 +616,7 @@ public class FormControllerTests extends TestCase { return mav; } + @Override protected ModelAndView showForm( HttpServletRequest req, HttpServletResponse resp, BindException err) throws Exception { return null; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/WizardFormControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/WizardFormControllerTests.java index 1d48f052d56..1d37caff853 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/WizardFormControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/WizardFormControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -28,7 +28,7 @@ import javax.servlet.http.HttpSession; import junit.framework.TestCase; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.util.ObjectUtils; @@ -40,6 +40,7 @@ import org.springframework.web.servlet.ModelAndView; * @author Juergen Hoeller * @since 29.04.2003 */ +@Deprecated public class WizardFormControllerTests extends TestCase { public void testNoDirtyPageChange() throws Exception { @@ -105,9 +106,11 @@ public class WizardFormControllerTests extends TestCase { public void testCustomSessionAttributes() throws Exception { AbstractWizardFormController wizard = new TestWizardController() { + @Override protected String getFormSessionAttributeName() { return "myFormAttr"; } + @Override protected String getPageSessionAttributeName() { return "myPageAttr"; } @@ -140,9 +143,11 @@ public class WizardFormControllerTests extends TestCase { public void testCustomRequestDependentSessionAttributes() throws Exception { AbstractWizardFormController wizard = new TestWizardController() { + @Override protected String getFormSessionAttributeName(HttpServletRequest request) { return "myFormAttr" + request.getParameter("formAttr"); } + @Override protected String getPageSessionAttributeName(HttpServletRequest request) { return "myPageAttr" + request.getParameter("pageAttr"); } @@ -383,15 +388,18 @@ public class WizardFormControllerTests extends TestCase { setPages(new String[] {"page0", "page1"}); } + @Override protected Map referenceData(HttpServletRequest request, int page) throws Exception { assertEquals(new Integer(page), request.getAttribute("target")); return super.referenceData(request, page); } + @Override protected boolean suppressValidation(HttpServletRequest request, Object command) { return (request.getParameter("formChange") != null); } + @Override protected void validatePage(Object command, Errors errors, int page) { TestBean tb = (TestBean) command; switch (page) { @@ -410,6 +418,7 @@ public class WizardFormControllerTests extends TestCase { } } + @Override protected ModelAndView processFinish( HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws ServletException, IOException { @@ -417,6 +426,7 @@ public class WizardFormControllerTests extends TestCase { return new ModelAndView("success", getCommandName(), command); } + @Override protected ModelAndView processCancel( HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws ServletException, IOException { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolverTests.java index 2384b320c01..62ac0171a6d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolverTests.java @@ -43,6 +43,7 @@ import org.springframework.web.servlet.ModelAndView; * @author Arjen Poutsma * @author Juergen Hoeller */ +@Deprecated public class AnnotationMethodHandlerExceptionResolverTests { private AnnotationMethodHandlerExceptionResolver exceptionResolver; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ControllerClassNameHandlerMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ControllerClassNameHandlerMappingTests.java index cbf9da30612..6c495b31ab7 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ControllerClassNameHandlerMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ControllerClassNameHandlerMappingTests.java @@ -41,6 +41,7 @@ public class ControllerClassNameHandlerMappingTests extends TestCase { private HandlerMapping hm4; + @Override public void setUp() throws Exception { MockServletContext sc = new MockServletContext(""); this.wac = new XmlWebApplicationContext(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/JdkProxyServletAnnotationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/JdkProxyServletAnnotationTests.java index bac4f505bb2..45249d3e4b1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/JdkProxyServletAnnotationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/JdkProxyServletAnnotationTests.java @@ -110,6 +110,7 @@ public class JdkProxyServletAnnotationTests { public static class TypeLevelImpl implements TypeLevel { + @Override public void doIt(Writer writer) throws IOException { writer.write("doIt"); } @@ -126,6 +127,7 @@ public class JdkProxyServletAnnotationTests { public static class MethodLevelImpl implements MethodLevel { + @Override public void doIt(Writer writer) throws IOException { writer.write("doIt"); } @@ -142,6 +144,7 @@ public class JdkProxyServletAnnotationTests { public static class TypeAndMethodLevelImpl implements TypeAndMethodLevel { + @Override public void doIt(Writer writer) throws IOException { writer.write("doIt"); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/RequestSpecificMappingInfoComparatorTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/RequestSpecificMappingInfoComparatorTests.java index 22299a891f6..1b941da624b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/RequestSpecificMappingInfoComparatorTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/RequestSpecificMappingInfoComparatorTests.java @@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMethod; /** * @author Arjen Poutsma */ +@Deprecated public class RequestSpecificMappingInfoComparatorTests { private AnnotationMethodHandlerAdapter.RequestSpecificMappingInfoComparator comparator; @@ -124,6 +125,7 @@ public class RequestSpecificMappingInfoComparatorTests { private static class MockComparator implements Comparator { + @Override public int compare(String s1, String s2) { return 0; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java index cd36fa25088..bbfa7e29902 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -30,9 +30,11 @@ import java.security.Principal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Date; +import java.util.GregorianCalendar; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; @@ -57,12 +59,12 @@ import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreato import org.springframework.aop.interceptor.SimpleTraceInterceptor; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.GenericBean; -import org.springframework.beans.ITestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.GenericBean; +import org.springframework.tests.sample.beans.ITestBean; import org.springframework.beans.PropertyEditorRegistrar; import org.springframework.beans.PropertyEditorRegistry; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -327,7 +329,7 @@ public class ServletAnnotationControllerTests { request.addParameter("testBeanSet", new String[] {"1", "2"}); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.service(request, response); - assertEquals("[1, 2]-org.springframework.beans.TestBean", response.getContentAsString()); + assertEquals("[1, 2]-org.springframework.tests.sample.beans.TestBean", response.getContentAsString()); } @Test @@ -1517,7 +1519,7 @@ public class ServletAnnotationControllerTests { request.setCookies(new Cookie("date", "2008-11-18")); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.service(request, response); - assertEquals("test-108", response.getContentAsString()); + assertEquals("test-2008", response.getContentAsString()); } @Test @@ -1964,6 +1966,7 @@ public class ServletAnnotationControllerTests { public static class ListEditorRegistrar implements PropertyEditorRegistrar { + @Override public void registerCustomEditors(PropertyEditorRegistry registry) { registry.registerCustomEditor(Set.class, new ListEditor()); } @@ -2190,12 +2193,14 @@ public class ServletAnnotationControllerTests { @Controller public static class MySessionAttributesControllerImpl implements MySessionAttributesControllerIfc { + @Override public String get(Model model) { model.addAttribute("object1", new Object()); model.addAttribute("object2", new Object()); return "page1"; } + @Override public String post(@ModelAttribute("object1") Object object1) { //do something with object1 return "page2"; @@ -2222,6 +2227,7 @@ public class ServletAnnotationControllerTests { @Controller public static class MyParameterizedControllerImpl implements MyEditableParameterizedControllerIfc { + @Override public List getTestBeans() { List list = new LinkedList(); list.add(new TestBean("tb1")); @@ -2229,12 +2235,14 @@ public class ServletAnnotationControllerTests { return list; } + @Override public String get(Model model) { model.addAttribute("object1", new TestBean()); model.addAttribute("object2", new TestBean()); return "page1"; } + @Override public String post(TestBean object) { //do something with object1 return "page2"; @@ -2244,6 +2252,7 @@ public class ServletAnnotationControllerTests { @Controller public static class MyParameterizedControllerImplWithOverriddenMappings implements MyEditableParameterizedControllerIfc { + @Override @ModelAttribute("testBeanList") public List getTestBeans() { List list = new LinkedList(); @@ -2252,6 +2261,7 @@ public class ServletAnnotationControllerTests { return list; } + @Override @RequestMapping(method = RequestMethod.GET) public String get(Model model) { model.addAttribute("object1", new TestBean()); @@ -2259,6 +2269,7 @@ public class ServletAnnotationControllerTests { return "page1"; } + @Override @RequestMapping(method = RequestMethod.POST) public String post(@ModelAttribute("object1") TestBean object1) { //do something with object1 @@ -2428,6 +2439,7 @@ public class ServletAnnotationControllerTests { private static class MyWebBindingInitializer implements WebBindingInitializer { + @Override public void initBinder(WebDataBinder binder, WebRequest request) { LocalValidatorFactoryBean vf = new LocalValidatorFactoryBean(); vf.afterPropertiesSet(); @@ -2441,6 +2453,7 @@ public class ServletAnnotationControllerTests { private static class MySpecialArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) { if (methodParameter.getParameterType().equals(MySpecialArg.class)) { return new MySpecialArg("myValue"); @@ -2599,6 +2612,7 @@ public class ServletAnnotationControllerTests { private static class TestPrincipal implements Principal { + @Override public String getName() { return "test"; } @@ -2606,6 +2620,7 @@ public class ServletAnnotationControllerTests { private static class OtherPrincipal implements Principal { + @Override public String getName() { return "other"; } @@ -2613,12 +2628,15 @@ public class ServletAnnotationControllerTests { private static class TestViewResolver implements ViewResolver { + @Override public View resolveViewName(final String viewName, Locale locale) throws Exception { return new View() { + @Override public String getContentType() { return null; } + @Override @SuppressWarnings({"unchecked", "deprecation"}) public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -2657,11 +2675,14 @@ public class ServletAnnotationControllerTests { public static class ModelExposingViewResolver implements ViewResolver { + @Override public View resolveViewName(final String viewName, Locale locale) throws Exception { return new View() { + @Override public String getContentType() { return null; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) { request.setAttribute("viewName", viewName); request.getSession().setAttribute("model", model); @@ -2758,6 +2779,7 @@ public class ServletAnnotationControllerTests { public static class TestBeanConverter implements Converter { + @Override public ITestBean convert(String source) { return new TestBean(source); } @@ -2849,23 +2871,28 @@ public class ServletAnnotationControllerTests { public static class NotReadableMessageConverter implements HttpMessageConverter { + @Override public boolean canRead(Class clazz, MediaType mediaType) { return true; } + @Override public boolean canWrite(Class clazz, MediaType mediaType) { return true; } + @Override public List getSupportedMediaTypes() { return Collections.singletonList(new MediaType("application", "pdf")); } + @Override public Object read(Class clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException { throw new HttpMessageNotReadableException("Could not read"); } + @Override public void write(Object o, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { throw new UnsupportedOperationException("Not implemented"); @@ -2880,23 +2907,28 @@ public class ServletAnnotationControllerTests { this.supportedMediaTypes = Arrays.asList(supportedMediaTypes); } + @Override public boolean canRead(Class clazz, MediaType mediaType) { return supportedMediaTypes.contains(mediaType); } + @Override public boolean canWrite(Class clazz, MediaType mediaType) { return supportedMediaTypes.contains(mediaType); } + @Override public List getSupportedMediaTypes() { return supportedMediaTypes; } + @Override public Object read(Class clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException { return null; } + @Override public void write(Object o, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { outputMessage.getHeaders().setContentType(contentType); @@ -2968,6 +3000,7 @@ public class ServletAnnotationControllerTests { public static class MyModelAndViewResolver implements ModelAndViewResolver { + @Override public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, @@ -2975,10 +3008,12 @@ public class ServletAnnotationControllerTests { NativeWebRequest webRequest) { if (returnValue instanceof MySpecialArg) { return new ModelAndView(new View() { + @Override public String getContentType() { return "text/html"; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().write("myValue"); @@ -3019,8 +3054,10 @@ public class ServletAnnotationControllerTests { @RequestMapping(method = RequestMethod.GET) public void handle(@CookieValue("date") Date date, Writer writer) throws IOException { - assertEquals("Invalid path variable value", new Date(108, 10, 18), date); - writer.write("test-" + date.getYear()); + assertEquals("Invalid path variable value", new GregorianCalendar(2008, 10, 18).getTime(), date); + Calendar c = new GregorianCalendar(); + c.setTime(date); + writer.write("test-" + c.get(Calendar.YEAR)); } } @@ -3036,6 +3073,7 @@ public class ServletAnnotationControllerTests { @Controller public static class TestControllerImpl implements TestController { + @Override @RequestMapping("/method") public ModelAndView method(MyEntity object) { return new ModelAndView("/something"); @@ -3131,6 +3169,7 @@ public class ServletAnnotationControllerTests { @Controller public static class IMyControllerImpl implements IMyController { + @Override public void handle(Writer writer, @RequestParam(value="p", required=false) String param) throws IOException { writer.write("handle " + param); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtilsTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtilsTests.java index 9bff0224218..c0c7fce7588 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtilsTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationMappingUtilsTests.java @@ -22,7 +22,10 @@ import org.junit.Test; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.web.bind.annotation.RequestMethod; -/** @author Arjen Poutsma */ +/** + * @author Arjen Poutsma + */ +@Deprecated public class ServletAnnotationMappingUtilsTests { @Test diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7766Tests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7766Tests.java index b88c10fa9f7..b48a1465011 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7766Tests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7766Tests.java @@ -29,6 +29,7 @@ import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; public class Spr7766Tests { @Test + @Deprecated public void test() throws Exception { AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter(); ConfigurableWebBindingInitializer binder = new ConfigurableWebBindingInitializer(); @@ -46,6 +47,7 @@ public class Spr7766Tests { } public class ColorConverter implements Converter { + @Override public Color convert(String source) { if (!source.startsWith("#")) source = "#" + source; return Color.decode(source); } } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java index f9c1b200c24..c963438df2c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java @@ -33,6 +33,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; +@Deprecated public class Spr7839Tests { AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter(); @@ -48,6 +49,7 @@ public class Spr7839Tests { ConfigurableWebBindingInitializer binder = new ConfigurableWebBindingInitializer(); GenericConversionService service = new DefaultConversionService(); service.addConverter(new Converter() { + @Override public NestedBean convert(String source) { return new NestedBean(source); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/UriTemplateServletAnnotationControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/UriTemplateServletAnnotationControllerTests.java index d13a82607b2..dcd2e6ec3db 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/UriTemplateServletAnnotationControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/UriTemplateServletAnnotationControllerTests.java @@ -20,6 +20,8 @@ import java.io.IOException; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.GregorianCalendar; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; @@ -486,7 +488,7 @@ public class UriTemplateServletAnnotationControllerTests { public void handle(@PathVariable("hotel") String hotel, @PathVariable Date date, Writer writer) throws IOException { assertEquals("Invalid path variable value", "42", hotel); - assertEquals("Invalid path variable value", new Date(108, 10, 18), date); + assertEquals("Invalid path variable value", new GregorianCalendar(2008, 10, 18).getTime(), date); writer.write("test-" + hotel); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/BuyForm.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/BuyForm.java index 3f42bdd83af..00f6ea145cb 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/BuyForm.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/BuyForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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,6 +21,7 @@ import org.springframework.web.servlet.mvc.SimpleFormController; /** * @author Rob Harrop */ +@Deprecated public class BuyForm extends SimpleFormController { } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/Controller.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/Controller.java index 307b6ab80d8..e8025b835a5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/Controller.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/Controller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -26,6 +26,7 @@ import org.springframework.web.servlet.ModelAndView; */ public class Controller implements org.springframework.web.servlet.mvc.Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) { return new ModelAndView("indexView"); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerBeanNameHandlerMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerBeanNameHandlerMappingTests.java index fce0eca69ae..a0822913bcf 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerBeanNameHandlerMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerBeanNameHandlerMappingTests.java @@ -35,6 +35,7 @@ public class ControllerBeanNameHandlerMappingTests extends TestCase { private HandlerMapping hm; + @Override public void setUp() throws Exception { MockServletContext sc = new MockServletContext(""); this.wac = new XmlWebApplicationContext(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerClassNameHandlerMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerClassNameHandlerMappingTests.java index bb2ee10976c..15cdacd232b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerClassNameHandlerMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/ControllerClassNameHandlerMappingTests.java @@ -42,6 +42,7 @@ public class ControllerClassNameHandlerMappingTests extends TestCase { private HandlerMapping hm4; + @Override public void setUp() throws Exception { MockServletContext sc = new MockServletContext(""); this.wac = new XmlWebApplicationContext(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/WelcomeController.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/WelcomeController.java index 5c36b0989d3..eb05fe9bba1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/WelcomeController.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/mapping/WelcomeController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.Controller; */ public class WelcomeController implements Controller { + @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) { return new ModelAndView("welcomeView"); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java index ea7e21b24f1..676e44729df 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java @@ -195,6 +195,7 @@ public class RequestMappingInfoTests { new ParamsRequestCondition("foo"), null, null, null, null); Comparator comparator = new Comparator() { + @Override public int compare(RequestMappingInfo info, RequestMappingInfo otherInfo) { return info.compareTo(otherInfo, new MockHttpServletRequest()); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractServletHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractServletHandlerMethodTests.java index b97f1c034aa..228ead8c9ba 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractServletHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractServletHandlerMethodTests.java @@ -16,7 +16,7 @@ package org.springframework.web.servlet.mvc.method.annotation; -import static junit.framework.Assert.assertNotNull; +import static org.junit.Assert.assertNotNull; import javax.servlet.ServletException; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ExtendedServletRequestDataBinderTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ExtendedServletRequestDataBinderTests.java index 32ac81d6687..33307032e58 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ExtendedServletRequestDataBinderTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ExtendedServletRequestDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -23,7 +23,7 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.bind.WebDataBinder; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java index eaabf4c2d92..fa7a9f81303 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java @@ -114,6 +114,7 @@ public class HandlerMethodAnnotationDetectionTests { } class TestPointcut extends StaticMethodMatcherPointcut { + @Override public boolean matches(Method method, Class clazz) { return method.getName().equals("hashCode"); } @@ -202,19 +203,23 @@ public class HandlerMethodAnnotationDetectionTests { */ static class AbstractClassController extends MappingAbstractClass { + @Override public void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String pattern) { CustomDateEditor dateEditor = new CustomDateEditor(new SimpleDateFormat(pattern), false); dataBinder.registerCustomEditor(Date.class, dateEditor); } + @Override public void initModel(@RequestHeader("header1") Date date, Model model) { model.addAttribute("attr1", date); } + @Override public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception { return date; } + @Override public String handleException(Exception exception) { return exception.getMessage(); } @@ -251,19 +256,23 @@ public class HandlerMethodAnnotationDetectionTests { */ static class InterfaceController implements MappingInterface { + @Override public void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String thePattern) { CustomDateEditor dateEditor = new CustomDateEditor(new SimpleDateFormat(thePattern), false); dataBinder.registerCustomEditor(Date.class, dateEditor); } + @Override public void initModel(@RequestHeader("header1") Date date, Model model) { model.addAttribute("attr1", date); } + @Override public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception { return date; } + @Override public String handleException(Exception exception) { return exception.getMessage(); } @@ -295,19 +304,23 @@ public class HandlerMethodAnnotationDetectionTests { */ static class ParameterizedAbstractClassController extends MappingParameterizedAbstractClass { + @Override public void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String thePattern) { CustomDateEditor dateEditor = new CustomDateEditor(new SimpleDateFormat(thePattern), false); dataBinder.registerCustomEditor(Date.class, dateEditor); } + @Override public void initModel(@RequestHeader("header1") Date date, Model model) { model.addAttribute("attr1", date); } + @Override public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception { return date; } + @Override public String handleException(Exception exception) { return exception.getMessage(); } @@ -340,23 +353,27 @@ public class HandlerMethodAnnotationDetectionTests { */ static class ParameterizedInterfaceController implements MappingParameterizedInterface { + @Override @InitBinder public void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String thePattern) { CustomDateEditor dateEditor = new CustomDateEditor(new SimpleDateFormat(thePattern), false); dataBinder.registerCustomEditor(Date.class, dateEditor); } + @Override @ModelAttribute public void initModel(@RequestHeader("header1") Date date, Model model) { model.addAttribute("attr1", date); } + @Override @RequestMapping(value="/path1/path2", method=RequestMethod.POST) @ModelAttribute("attr2") public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception { return date; } + @Override @ExceptionHandler(Exception.class) @ResponseBody public String handleException(Exception exception) { @@ -412,6 +429,7 @@ public class HandlerMethodAnnotationDetectionTests { private static StaticMethodMatcherPointcut getControllerPointcut() { return new StaticMethodMatcherPointcut() { + @Override public boolean matches(Method method, Class targetClass) { return ((AnnotationUtils.findAnnotation(targetClass, Controller.class) != null) || (AnnotationUtils.findAnnotation(targetClass, RequestMapping.class) != null)); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java index 467fff6dcfa..cd431d61541 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java @@ -159,10 +159,12 @@ public class HttpEntityMethodProcessorTests { private Long id; private String name; + @Override public Long getId() { return id; } + @Override public void setId(Long id) { this.id = id; } @@ -177,6 +179,7 @@ public class HttpEntityMethodProcessorTests { } private final class ValidatingBinderFactory implements WebDataBinderFactory { + @Override public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.afterPropertiesSet(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java index 1ff5a6303ee..e0a515c3b05 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -28,7 +28,7 @@ import java.util.List; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.MethodParameter; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.ui.ExtendedModelMap; @@ -124,6 +124,7 @@ public class ModelAndViewResolverMethodReturnValueHandlerTests { this.returnValueType = returnValueType; } + @Override @SuppressWarnings("rawtypes") public ModelAndView resolveModelAndView(Method method, Class handlerType, Object returnValue, ExtendedModelMap model, NativeWebRequest request) { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java index e86b96b3732..caa7fbcea66 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -44,7 +44,7 @@ import javax.validation.Valid; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.MethodParameter; @@ -394,28 +394,33 @@ public class RequestMappingHandlerAdapterIntegrationTests { } private static class StubValidator implements Validator { + @Override public boolean supports(Class clazz) { return true; } + @Override public void validate(Object target, Errors errors) { errors.reject("error"); } } private static class ColorArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception { return new Color(0); } } private static class User implements Principal { + @Override public String getName() { return "user"; } } private static class OtherUser implements Principal { + @Override public String getName() { return "other user"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartIntegrationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartIntegrationTests.java index 43c8c22dd6d..a15466aabc0 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartIntegrationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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,13 +36,13 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.http.client.FreePortScanner; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.ResourceHttpMessageConverter; import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter; import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; import org.springframework.stereotype.Controller; +import org.springframework.tests.web.FreePortScanner; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartMethodArgumentResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartMethodArgumentResolverTests.java index 813c7819a9f..5f9869e1dc8 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartMethodArgumentResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestPartMethodArgumentResolverTests.java @@ -275,6 +275,7 @@ public class RequestPartMethodArgumentResolverTests { } private final class ValidatingBinderFactory implements WebDataBinderFactory { + @Override public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.afterPropertiesSet(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorMockTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorMockTests.java index 85ab677a0a7..315040419e9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorMockTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorMockTests.java @@ -323,6 +323,7 @@ public class RequestResponseBodyMethodProcessorMockTests { } private final class ValidatingBinderFactory implements WebDataBinderFactory { + @Override public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.afterPropertiesSet(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorTests.java index e42a2aa9679..5c69b6f4245 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessorTests.java @@ -259,10 +259,12 @@ public class RequestResponseBodyMethodProcessorTests { private Long id; private String name; + @Override public Long getId() { return id; } + @Override public void setId(Long id) { this.id = id; } @@ -277,6 +279,7 @@ public class RequestResponseBodyMethodProcessorTests { } private final class ValidatingBinderFactory implements WebDataBinderFactory { + @Override public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.afterPropertiesSet(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/SerlvetModelAttributeMethodProcessorTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/SerlvetModelAttributeMethodProcessorTests.java index 21ef1b19592..26e95d0c33d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/SerlvetModelAttributeMethodProcessorTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/SerlvetModelAttributeMethodProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.MethodParameter; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.mock.web.test.MockHttpServletRequest; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java index d1872128cbe..6c5c7327e08 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -64,10 +64,10 @@ import org.junit.Test; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.aop.interceptor.SimpleTraceInterceptor; import org.springframework.aop.support.DefaultPointcutAdvisor; -import org.springframework.beans.DerivedTestBean; -import org.springframework.beans.GenericBean; -import org.springframework.beans.ITestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.DerivedTestBean; +import org.springframework.tests.sample.beans.GenericBean; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -243,6 +243,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void defaultExpressionParameters() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { RootBeanDefinition ppc = new RootBeanDefinition(PropertyPlaceholderConfigurer.class); ppc.getPropertyValues().add("properties", "myKey=foo"); @@ -266,6 +267,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void typeNestedSetBinding() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { RootBeanDefinition csDef = new RootBeanDefinition(FormattingConversionServiceFactoryBean.class); csDef.getPropertyValues().add("converters", new TestBeanConverter()); @@ -281,7 +283,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl request.addParameter("testBeanSet", new String[] {"1", "2"}); MockHttpServletResponse response = new MockHttpServletResponse(); getServlet().service(request, response); - assertEquals("[1, 2]-org.springframework.beans.TestBean", response.getContentAsString()); + assertEquals("[1, 2]-org.springframework.tests.sample.beans.TestBean", response.getContentAsString()); } @Test @@ -308,6 +310,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void emptyParameterListHandleMethod() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { RootBeanDefinition vrDef = new RootBeanDefinition(InternalResourceViewResolver.class); vrDef.getPropertyValues().add("suffix", ".jsp"); @@ -328,6 +331,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void sessionAttributeExposure() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { context.registerBeanDefinition("viewResolver", new RootBeanDefinition(ModelExposingViewResolver.class)); } @@ -358,6 +362,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void sessionAttributeExposureWithInterface() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { context.registerBeanDefinition("viewResolver", new RootBeanDefinition(ModelExposingViewResolver.class)); DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator(); @@ -392,6 +397,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void parameterizedAnnotatedInterface() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { context.registerBeanDefinition("viewResolver", new RootBeanDefinition(ModelExposingViewResolver.class)); } @@ -424,6 +430,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void parameterizedAnnotatedInterfaceWithOverriddenMappingsInImpl() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { context.registerBeanDefinition("viewResolver", new RootBeanDefinition(ModelExposingViewResolver.class)); } @@ -508,6 +515,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void formController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); } @@ -524,6 +532,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void modelFormController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); } @@ -540,6 +549,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void proxiedFormController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator(); @@ -561,6 +571,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void commandProvidingFormControllerWithCustomEditor() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); @@ -581,6 +592,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void typedCommandProvidingFormController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); @@ -620,6 +632,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void binderInitializingCommandProvidingFormController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); } @@ -637,6 +650,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void specificBinderInitializingCommandProvidingFormController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class)); } @@ -658,6 +672,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl WebApplicationContext webAppContext = initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { wac.setServletContext(servletContext); AnnotationConfigUtils.registerAnnotationConfigProcessors(wac); @@ -831,6 +846,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void responseBodyNoAcceptableMediaType() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); StringHttpMessageConverter converter = new StringHttpMessageConverter(); @@ -866,6 +882,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void unsupportedRequestBody() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); adapterDef.getPropertyValues().add("messageConverters", new ByteArrayHttpMessageConverter()); @@ -900,6 +917,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void badRequestRequestBody() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); adapterDef.getPropertyValues().add("messageConverters", new NotReadableMessageConverter()); @@ -946,6 +964,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void overlappingMessageConvertersRequestBody() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); List> messageConverters = new ArrayList>(); @@ -980,6 +999,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void responseBodyArgMismatch() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setClassesToBeBound(A.class, B.class); @@ -1155,6 +1175,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void mavResolver() throws ServletException, IOException { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition adapterDef = new RootBeanDefinition(RequestMappingHandlerAdapter.class); ModelAndViewResolver[] mavResolvers = new ModelAndViewResolver[] {new MyModelAndViewResolver()}; @@ -1283,6 +1304,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void requestMappingInterfaceWithProxy() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator(); autoProxyCreator.setBeanFactory(wac.getBeanFactory()); @@ -1420,6 +1442,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void parameterCsvAsStringArray() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext wac) { RootBeanDefinition csDef = new RootBeanDefinition(FormattingConversionServiceFactoryBean.class); RootBeanDefinition wbiDef = new RootBeanDefinition(ConfigurableWebBindingInitializer.class); @@ -1525,6 +1548,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Test public void prototypeController() throws Exception { initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { RootBeanDefinition beanDef = new RootBeanDefinition(PrototypeController.class); beanDef.setScope(BeanDefinition.SCOPE_PROTOTYPE); @@ -1727,12 +1751,14 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl public static class MySessionAttributesControllerImpl implements MySessionAttributesControllerIfc { + @Override public String get(Model model) { model.addAttribute("object1", new Object()); model.addAttribute("object2", new Object()); return "page1"; } + @Override public String post(@ModelAttribute("object1") Object object1) { //do something with object1 return "page2"; @@ -1759,6 +1785,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Controller public static class MyParameterizedControllerImpl implements MyEditableParameterizedControllerIfc { + @Override public List getTestBeans() { List list = new LinkedList(); list.add(new TestBean("tb1")); @@ -1766,12 +1793,14 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl return list; } + @Override public String get(Model model) { model.addAttribute("object1", new TestBean()); model.addAttribute("object2", new TestBean()); return "page1"; } + @Override public String post(TestBean object) { //do something with object1 return "page2"; @@ -1781,6 +1810,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Controller public static class MyParameterizedControllerImplWithOverriddenMappings implements MyEditableParameterizedControllerIfc { + @Override @ModelAttribute("testBeanList") public List getTestBeans() { List list = new LinkedList(); @@ -1789,6 +1819,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl return list; } + @Override @RequestMapping(method = RequestMethod.GET) public String get(Model model) { model.addAttribute("object1", new TestBean()); @@ -1796,6 +1827,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl return "page1"; } + @Override @RequestMapping(method = RequestMethod.POST) public String post(@ModelAttribute("object1") TestBean object1) { //do something with object1 @@ -1966,6 +1998,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl static class MyWebBindingInitializer implements WebBindingInitializer { + @Override public void initBinder(WebDataBinder binder, WebRequest request) { LocalValidatorFactoryBean vf = new LocalValidatorFactoryBean(); vf.afterPropertiesSet(); @@ -1979,6 +2012,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl static class MySpecialArgumentResolver implements WebArgumentResolver { + @Override public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) { if (methodParameter.getParameterType().equals(MySpecialArg.class)) { return new MySpecialArg("myValue"); @@ -2132,6 +2166,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl static class TestPrincipal implements Principal { + @Override public String getName() { return "test"; } @@ -2139,6 +2174,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl static class OtherPrincipal implements Principal { + @Override public String getName() { return "other"; } @@ -2146,12 +2182,15 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl static class TestViewResolver implements ViewResolver { + @Override public View resolveViewName(final String viewName, Locale locale) throws Exception { return new View() { + @Override public String getContentType() { return null; } + @Override @SuppressWarnings({"unchecked", "deprecation", "rawtypes"}) public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -2190,11 +2229,14 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl public static class ModelExposingViewResolver implements ViewResolver { + @Override public View resolveViewName(final String viewName, Locale locale) throws Exception { return new View() { + @Override public String getContentType() { return null; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) { request.setAttribute("viewName", viewName); request.getSession().setAttribute("model", model); @@ -2291,6 +2333,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl public static class TestBeanConverter implements Converter { + @Override public ITestBean convert(String source) { return new TestBean(source); } @@ -2398,23 +2441,28 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl public static class NotReadableMessageConverter implements HttpMessageConverter { + @Override public boolean canRead(Class clazz, MediaType mediaType) { return true; } + @Override public boolean canWrite(Class clazz, MediaType mediaType) { return true; } + @Override public List getSupportedMediaTypes() { return Collections.singletonList(new MediaType("application", "pdf")); } + @Override public Object read(Class clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException { throw new HttpMessageNotReadableException("Could not read"); } + @Override public void write(Object o, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { throw new UnsupportedOperationException("Not implemented"); @@ -2429,23 +2477,28 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl this.supportedMediaTypes = Arrays.asList(supportedMediaTypes); } + @Override public boolean canRead(Class clazz, MediaType mediaType) { return supportedMediaTypes.contains(mediaType); } + @Override public boolean canWrite(Class clazz, MediaType mediaType) { return supportedMediaTypes.contains(mediaType); } + @Override public List getSupportedMediaTypes() { return supportedMediaTypes; } + @Override public Object read(Class clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException { return null; } + @Override public void write(Object o, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { outputMessage.getHeaders().setContentType(contentType); @@ -2545,6 +2598,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl public static class MyModelAndViewResolver implements ModelAndViewResolver { + @Override @SuppressWarnings("rawtypes") public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, @@ -2553,10 +2607,12 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl NativeWebRequest webRequest) { if (returnValue instanceof MySpecialArg) { return new ModelAndView(new View() { + @Override public String getContentType() { return "text/html"; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().write("myValue"); @@ -2628,6 +2684,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Controller public static class TestControllerImpl implements TestController { + @Override @RequestMapping("/method") public ModelAndView method(MyEntity object) { return new ModelAndView("/something"); @@ -2723,6 +2780,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl @Controller public static class IMyControllerImpl implements IMyController { + @Override public void handle(Writer writer, @RequestParam(value="p", required=false) String param) throws IOException { writer.write("handle " + param); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java index 50d30583af1..5365749ed5d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethodTests.java @@ -185,10 +185,12 @@ public class ServletInvocableHandlerMethodTests { private static class ExceptionRaisingReturnValueHandler implements HandlerMethodReturnValueHandler { + @Override public boolean supportsReturnType(MethodParameter returnType) { return true; } + @Override public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception { throw new HttpMessageNotWritableException("oops, can't write"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolverTests.java index f3c51db5a8b..0b0afcee8d9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolverTests.java @@ -95,6 +95,7 @@ public class ServletRequestMethodArgumentResolverTests { @Test public void principal() throws Exception { Principal principal = new Principal() { + @Override public String getName() { return "Foo"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/UriTemplateServletAnnotationControllerHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/UriTemplateServletAnnotationControllerHandlerMethodTests.java index 22e924e600f..3739046c597 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/UriTemplateServletAnnotationControllerHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/UriTemplateServletAnnotationControllerHandlerMethodTests.java @@ -107,6 +107,7 @@ public class UriTemplateServletAnnotationControllerHandlerMethodTests extends Ab WebApplicationContext wac = initServlet(new ApplicationContextInitializer() { + @Override public void initialize(GenericWebApplicationContext context) { RootBeanDefinition beanDef = new RootBeanDefinition(ModelValidatingViewResolver.class); beanDef.getConstructorArgumentValues().addGenericArgumentValue(pathVars); @@ -671,8 +672,10 @@ public class UriTemplateServletAnnotationControllerHandlerMethodTests extends Ab this.attrsToValidate = attrsToValidate; } + @Override public View resolveViewName(final String viewName, Locale locale) throws Exception { return new AbstractView () { + @Override public String getContentType() { return null; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/multiaction/MultiActionControllerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/multiaction/MultiActionControllerTests.java index 18ae25f7e01..64de09b05af 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/multiaction/MultiActionControllerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/multiaction/MultiActionControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -30,7 +30,7 @@ import javax.servlet.http.HttpSession; import junit.framework.TestCase; import org.springframework.beans.FatalBeanException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.context.ApplicationContextException; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java index 852c95fd8af..fe492bab941 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -26,7 +26,7 @@ import java.util.Collections; import org.junit.Before; import org.junit.Test; import org.springframework.beans.ConversionNotSupportedException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.TypeMismatchException; import org.springframework.core.MethodParameter; import org.springframework.http.MediaType; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMapTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMapTests.java index e229bac169a..cb7b41e9d69 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMapTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/RedirectAttributesModelMapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -24,7 +24,7 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.convert.converter.Converter; import org.springframework.format.support.DefaultFormattingConversionService; import org.springframework.format.support.FormattingConversionService; @@ -139,6 +139,7 @@ public class RedirectAttributesModelMapTests { public static class TestBeanConverter implements Converter { + @Override public String convert(TestBean source) { return "[" + source.getName() + "]"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockFilterRegistration.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockFilterRegistration.java index 92b5d65487a..d3d0547fba8 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockFilterRegistration.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockFilterRegistration.java @@ -39,10 +39,12 @@ class MockFilterRegistration implements Dynamic { return this.asyncSupported; } + @Override public void setAsyncSupported(boolean isAsyncSupported) { this.asyncSupported = isAsyncSupported; } + @Override public void addMappingForServletNames(EnumSet dispatcherTypes, boolean isMatchAfter, String... servletNames) { @@ -53,38 +55,47 @@ class MockFilterRegistration implements Dynamic { // Not implemented + @Override public String getName() { return null; } + @Override public Collection getServletNameMappings() { return null; } + @Override public void addMappingForUrlPatterns(EnumSet dispatcherTypes, boolean isMatchAfter, String... urlPatterns) { } + @Override public Collection getUrlPatternMappings() { return null; } + @Override public String getClassName() { return null; } + @Override public boolean setInitParameter(String name, String value) { return false; } + @Override public String getInitParameter(String name) { return null; } + @Override public Set setInitParameters(Map initParameters) { return null; } + @Override public Map getInitParameters() { return null; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockServletRegistration.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockServletRegistration.java index 2b0e15a4db5..958f1755b49 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockServletRegistration.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/MockServletRegistration.java @@ -40,27 +40,33 @@ class MockServletRegistration implements ServletRegistration.Dynamic { return loadOnStartup; } + @Override public void setLoadOnStartup(int loadOnStartup) { this.loadOnStartup = loadOnStartup; } + @Override public void setRunAsRole(String roleName) { this.roleName = roleName; } + @Override public Set addMapping(String... urlPatterns) { mappings.addAll(Arrays.asList(urlPatterns)); return mappings; } + @Override public Collection getMappings() { return mappings; } + @Override public String getRunAsRole() { return roleName; } + @Override public void setAsyncSupported(boolean isAsyncSupported) { this.asyncSupported = isAsyncSupported; } @@ -71,33 +77,41 @@ class MockServletRegistration implements ServletRegistration.Dynamic { // not implemented + @Override public String getName() { return null; } + @Override public void setMultipartConfig(MultipartConfigElement multipartConfig) { } + @Override public Set setServletSecurity(ServletSecurityElement constraint) { return null; } + @Override public String getClassName() { return null; } + @Override public boolean setInitParameter(String name, String value) { return false; } + @Override public String getInitParameter(String name) { return null; } + @Override public Set setInitParameters(Map initParameters) { return null; } + @Override public Map getInitParameters() { return null; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/RequestDataValueProcessorWrapper.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/RequestDataValueProcessorWrapper.java index 84e940352ac..4d5b846832b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/support/RequestDataValueProcessorWrapper.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/support/RequestDataValueProcessorWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -30,18 +30,22 @@ public class RequestDataValueProcessorWrapper implements RequestDataValueProcess this.processor = processor; } + @Override public String processUrl(HttpServletRequest request, String url) { return (this.processor != null) ? this.processor.processUrl(request, url) : url; } + @Override public String processFormFieldValue(HttpServletRequest request, String name, String value, String type) { return (this.processor != null) ? this.processor.processFormFieldValue(request, name, value, type) : value; } + @Override public String processAction(HttpServletRequest request, String action) { return (this.processor != null) ? this.processor.processAction(request, action) : action; } + @Override public Map getExtraHiddenFields(HttpServletRequest request) { return (this.processor != null) ? this.processor.getExtraHiddenFields(request) : null; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagOutsideDispatcherServletTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagOutsideDispatcherServletTests.java index e4fce1213fc..95a8e0ddf0a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagOutsideDispatcherServletTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagOutsideDispatcherServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ package org.springframework.web.servlet.tags; */ public class BindTagOutsideDispatcherServletTests extends BindTagTests { + @Override protected boolean inDispatcherServlet() { return false; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagTests.java index 03c39fa8def..4af3a47cde6 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/BindTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -27,9 +27,9 @@ import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.Tag; -import org.springframework.beans.IndexedTestBean; -import org.springframework.beans.NestedTestBean; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.IndexedTestBean; +import org.springframework.tests.sample.beans.NestedTestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; @@ -509,6 +509,7 @@ public class BindTagTests extends AbstractTagTests { IndexedTestBean tb = new IndexedTestBean(); DataBinder binder = new ServletRequestDataBinder(tb, "tb"); binder.registerCustomEditor(TestBean.class, null, new PropertyEditorSupport() { + @Override public String getAsText() { return "something"; } @@ -987,6 +988,7 @@ public class BindTagTests extends AbstractTagTests { pc.getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "tb", binder.getBindingResult()); FormTag formTag = new FormTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(new StringWriter()); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/EvalTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/EvalTagTests.java index 9dbbf6416f2..1cec18763fc 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/EvalTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/EvalTagTests.java @@ -40,6 +40,7 @@ public class EvalTagTests extends AbstractTagTests { private MockPageContext context; + @Override protected void setUp() throws Exception { context = createPageContext(); FormattingConversionServiceFactoryBean factory = new FormattingConversionServiceFactoryBean(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagOutsideDispatcherServletTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagOutsideDispatcherServletTests.java index 4d3e4c9f76a..5ac42a02d06 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagOutsideDispatcherServletTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagOutsideDispatcherServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ package org.springframework.web.servlet.tags; */ public class HtmlEscapeTagOutsideDispatcherServletTests extends HtmlEscapeTagTests { + @Override protected boolean inDispatcherServlet() { return false; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagTests.java index 51820dc8394..f33101a3b85 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/HtmlEscapeTagTests.java @@ -37,6 +37,7 @@ public class HtmlEscapeTagTests extends AbstractTagTests { tag.setPageContext(pc); tag.doStartTag(); HtmlEscapingAwareTag testTag = new HtmlEscapingAwareTag() { + @Override public int doStartTagInternal() throws Exception { return EVAL_BODY_INCLUDE; } @@ -113,9 +114,11 @@ public class HtmlEscapeTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer result = new StringBuffer(); EscapeBodyTag tag = new EscapeBodyTag() { + @Override protected String readBodyContent() { return "test text"; } + @Override protected void writeBodyContent(String content) { result.append(content); } @@ -131,9 +134,11 @@ public class HtmlEscapeTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer result = new StringBuffer(); EscapeBodyTag tag = new EscapeBodyTag() { + @Override protected String readBodyContent() { return "test & text"; } + @Override protected void writeBodyContent(String content) { result.append(content); } @@ -150,9 +155,11 @@ public class HtmlEscapeTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer result = new StringBuffer(); EscapeBodyTag tag = new EscapeBodyTag() { + @Override protected String readBodyContent() { return "' test & text \\"; } + @Override protected void writeBodyContent(String content) { result.append(content); } @@ -169,9 +176,11 @@ public class HtmlEscapeTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer result = new StringBuffer(); EscapeBodyTag tag = new EscapeBodyTag() { + @Override protected String readBodyContent() { return "' test & text \\"; } + @Override protected void writeBodyContent(String content) { result.append(content); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagOutsideDispatcherServletTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagOutsideDispatcherServletTests.java index d2205f8fcc0..3c5f1207594 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagOutsideDispatcherServletTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagOutsideDispatcherServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -22,6 +22,7 @@ package org.springframework.web.servlet.tags; */ public class MessageTagOutsideDispatcherServletTests extends MessageTagTests { + @Override protected boolean inDispatcherServlet() { return false; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagTests.java index 8e737c22578..8aa294af9ac 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/MessageTagTests.java @@ -43,6 +43,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -58,6 +59,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -74,6 +76,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -91,6 +94,7 @@ public class MessageTagTests extends AbstractTagTests { request.addPreferredLocale(Locale.CANADA); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -108,6 +112,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -123,6 +128,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -139,6 +145,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -155,6 +162,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -172,6 +180,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -188,6 +197,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -204,6 +214,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -221,6 +232,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -239,6 +251,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -256,6 +269,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -274,6 +288,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -290,6 +305,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -307,6 +323,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -323,6 +340,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -341,6 +359,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } @@ -357,6 +376,7 @@ public class MessageTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); MessageTag tag = new MessageTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTagTests.java index cbd498112e3..fc6321a2c4d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2002-2012 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. @@ -97,6 +97,7 @@ public class ParamTagTests extends AbstractTagTests { private Param param; + @Override public void addParam(Param param) { this.param = param; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTests.java index 49d305cc4e5..4231d24ad23 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ParamTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ThemeTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ThemeTagTests.java index fc92aeaa46c..d0113f95fe4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ThemeTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/ThemeTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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. @@ -40,6 +40,7 @@ public class ThemeTagTests extends AbstractTagTests { PageContext pc = createPageContext(); final StringBuffer message = new StringBuffer(); ThemeTag tag = new ThemeTag() { + @Override protected void writeMessage(String msg) { message.append(msg); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java index 3937e95dc10..edabd11d4fb 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractFormTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractFormTagTests.java index 4d9df5c6481..f1b27c493ed 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractFormTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractFormTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.web.servlet.tags.form; import javax.servlet.jsp.JspException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockPageContext; @@ -31,12 +31,14 @@ public abstract class AbstractFormTagTests extends AbstractHtmlElementTagTests { private FormTag formTag = new FormTag(); + @Override protected void extendRequest(MockHttpServletRequest request) { request.setAttribute(COMMAND_NAME, createTestBean()); } protected abstract TestBean createTestBean(); + @Override protected void extendPageContext(MockPageContext pageContext) throws JspException { this.formTag.setCommandName(COMMAND_NAME); this.formTag.setAction("myAction"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java index e101be304be..a114680a942 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java @@ -53,6 +53,7 @@ public abstract class AbstractHtmlElementTagTests extends AbstractTagTests { private MockPageContext pageContext; + @Override protected final void setUp() throws Exception { // set up a writer for the tag content to be written to this.writer = new StringWriter(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ButtonTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ButtonTagTests.java index 431f85d03d2..b471438f1e6 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ButtonTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ButtonTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -20,7 +20,7 @@ import java.io.Writer; import javax.servlet.jsp.tagext.Tag; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Rossen Stoyanchev @@ -29,6 +29,7 @@ public class ButtonTagTests extends AbstractFormTagTests { private ButtonTag tag; + @Override protected void onSetUp() { this.tag = createTag(getWriter()); this.tag.setParent(getFormTag()); @@ -82,6 +83,7 @@ public class ButtonTagTests extends AbstractFormTagTests { @SuppressWarnings("serial") protected ButtonTag createTag(final Writer writer) { return new ButtonTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(writer); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java index 1ac1ea619e3..657aab3c24a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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. @@ -32,9 +32,9 @@ import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import org.springframework.beans.Colour; -import org.springframework.beans.Pet; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.Colour; +import org.springframework.tests.sample.beans.Pet; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.BindingResult; @@ -50,9 +50,11 @@ public class CheckboxTagTests extends AbstractFormTagTests { private TestBean bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new CheckboxTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -636,6 +638,7 @@ public class CheckboxTagTests extends AbstractFormTagTests { return cal.getTime(); } + @Override protected TestBean createTestBean() { List colours = new ArrayList(); colours.add(Colour.BLUE); @@ -678,6 +681,7 @@ public class CheckboxTagTests extends AbstractFormTagTests { super(false); } + @Override public void setAsText(String text) { this.count++; super.setAsText(text); @@ -689,6 +693,7 @@ public class CheckboxTagTests extends AbstractFormTagTests { public int count = 0; + @Override public void setAsText(String text) { this.count++; setValue(new Integer(text.trim())); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java index 96bae8946cc..9ffeefbf2ca 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 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,9 +36,9 @@ import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import org.springframework.beans.Colour; -import org.springframework.beans.Pet; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.Colour; +import org.springframework.tests.sample.beans.Pet; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.format.Formatter; import org.springframework.format.support.FormattingConversionService; @@ -59,9 +59,11 @@ public class CheckboxesTagTests extends AbstractFormTagTests { private TestBean bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new CheckboxesTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -426,9 +428,11 @@ public class CheckboxesTagTests extends AbstractFormTagTests { BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(this.bean, COMMAND_NAME); FormattingConversionService cs = new FormattingConversionService(); cs.addFormatterForFieldType(String.class, new Formatter() { + @Override public String print(String object, Locale locale) { return object; } + @Override public String parse(String text, Locale locale) throws ParseException { return text.trim(); } @@ -728,6 +732,7 @@ public class CheckboxesTagTests extends AbstractFormTagTests { return cal.getTime(); } + @Override protected TestBean createTestBean() { List colours = new ArrayList(); colours.add(Colour.BLUE); @@ -770,6 +775,7 @@ public class CheckboxesTagTests extends AbstractFormTagTests { super(false); } + @Override public void setAsText(String text) { super.setAsText(text); this.allProcessedValues.add(getValue()); @@ -779,10 +785,12 @@ public class CheckboxesTagTests extends AbstractFormTagTests { private static class MyLowerCaseEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(text.toLowerCase()); } + @Override public String getAsText() { return ObjectUtils.nullSafeToString(getValue()).toUpperCase(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java index 90cdd281d20..a36012bb60e 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -25,7 +25,7 @@ import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.BodyTag; import javax.servlet.jsp.tagext.Tag; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockBodyContent; import org.springframework.mock.web.test.MockPageContext; import org.springframework.validation.BeanPropertyBindingResult; @@ -48,9 +48,11 @@ public class ErrorsTagTests extends AbstractFormTagTests { private ErrorsTag tag; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new ErrorsTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -60,6 +62,7 @@ public class ErrorsTagTests extends AbstractFormTagTests { this.tag.setPageContext(getPageContext()); } + @Override protected TestBean createTestBean() { return new TestBean(); } @@ -434,6 +437,7 @@ public class ErrorsTagTests extends AbstractFormTagTests { assertTrue(output.contains("field error")); } + @Override protected void exposeBindingResult(Errors errors) { // wrap errors in a Model Map model = new HashMap(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java index f8023dffb23..3bd879a1eac 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java @@ -47,9 +47,11 @@ public class FormTagTests extends AbstractHtmlElementTagTests { private MockHttpServletRequest request; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new FormTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/HiddenInputTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/HiddenInputTagTests.java index 4058788ffd9..613196224c0 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/HiddenInputTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/HiddenInputTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -19,7 +19,7 @@ package org.springframework.web.servlet.tags.form; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.Tag; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.validation.BeanPropertyBindingResult; /** @@ -31,9 +31,11 @@ public class HiddenInputTagTests extends AbstractFormTagTests { private TestBean bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new HiddenInputTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -120,6 +122,7 @@ public class HiddenInputTagTests extends AbstractFormTagTests { assertTrue(output.startsWith("")); } + @Override protected void extendRequest(MockHttpServletRequest request) { TestBean bean = new TestBean(); bean.setName("foo"); @@ -520,10 +529,12 @@ public class OptionTagTests extends AbstractHtmlElementTagTests { private static class TestBeanPropertyEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text + "k", 123)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } @@ -589,10 +600,12 @@ public class OptionTagTests extends AbstractHtmlElementTagTests { public class RulesVariantEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(RulesVariant.fromId(text)); } + @Override public String getAsText() { RulesVariant rulesVariant = (RulesVariant) getValue(); return rulesVariant.toId(); @@ -602,11 +615,13 @@ public class OptionTagTests extends AbstractHtmlElementTagTests { private static class FriendEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new TestBean(text)); } + @Override public String getAsText() { return ((TestBean) getValue()).getName(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionsTagTests.java index accbc09cf4d..964e2d412f5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionsTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -31,7 +31,7 @@ import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Node; import org.dom4j.io.SAXReader; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockPageContext; import org.springframework.validation.BeanPropertyBindingResult; @@ -54,17 +54,21 @@ public final class OptionsTagTests extends AbstractHtmlElementTagTests { private SelectTag selectTag; private OptionsTag tag; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new OptionsTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } }; selectTag = new SelectTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } + @Override public String getName() { // Should not be used other than to delegate to // RequestDataValueDataProcessor @@ -276,6 +280,7 @@ public final class OptionsTagTests extends AbstractHtmlElementTagTests { assertEquals(value2, rootElement.selectSingleNode("option[@selected]")); } + @Override protected void extendRequest(MockHttpServletRequest request) { TestBean bean = new TestBean(); bean.setName("foo"); @@ -295,6 +300,7 @@ public final class OptionsTagTests extends AbstractHtmlElementTagTests { request.setAttribute("floats", floats); } + @Override protected void exposeBindingResult(Errors errors) { // wrap errors in a Model Map model = new HashMap(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/PasswordInputTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/PasswordInputTagTests.java index 242135cb760..c4787c01058 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/PasswordInputTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/PasswordInputTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -78,6 +78,7 @@ public class PasswordInputTagTests extends InputTagTests { assertValueAttribute(output, ""); } + @Override public void testDynamicTypeAttribute() throws JspException { try { this.getTag().setDynamicAttribute(null, "type", "email"); @@ -88,6 +89,7 @@ public class PasswordInputTagTests extends InputTagTests { } } + @Override protected void assertValueAttribute(String output, String expectedValue) { if (this.getPasswordTag().isShowPassword()) { super.assertValueAttribute(output, expectedValue); @@ -96,13 +98,16 @@ public class PasswordInputTagTests extends InputTagTests { } } + @Override protected String getType() { return "password"; } + @Override @SuppressWarnings("serial") protected InputTag createTag(final Writer writer) { return new PasswordInputTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(writer); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java index 2c372aa6da0..42190d39f82 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -27,8 +27,8 @@ import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import org.springframework.beans.Pet; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.Pet; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.BindingResult; @@ -43,9 +43,11 @@ public class RadioButtonTagTests extends AbstractFormTagTests { private TestBean bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new RadioButtonTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -251,6 +253,7 @@ public class RadioButtonTagTests extends AbstractFormTagTests { return new Float("12.99"); } + @Override protected TestBean createTestBean() { this.bean = new TestBean(); bean.setSex("M"); @@ -262,10 +265,12 @@ public class RadioButtonTagTests extends AbstractFormTagTests { private static class MyFloatEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(text.substring(1)); } + @Override public String getAsText() { return "F" + getValue(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java index 8ac60397714..702e790c9a3 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -34,9 +34,9 @@ import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Node; import org.dom4j.io.SAXReader; -import org.springframework.beans.Colour; -import org.springframework.beans.Pet; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.Colour; +import org.springframework.tests.sample.beans.Pet; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.BindingResult; @@ -53,9 +53,11 @@ public final class RadioButtonsTagTests extends AbstractFormTagTests { private TestBean bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new RadioButtonsTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -582,6 +584,7 @@ public final class RadioButtonsTagTests extends AbstractFormTagTests { return cal.getTime(); } + @Override protected TestBean createTestBean() { List colours = new ArrayList(); colours.add(Colour.BLUE); @@ -619,6 +622,7 @@ public final class RadioButtonsTagTests extends AbstractFormTagTests { super(false); } + @Override public void setAsText(String text) { super.setAsText(text); this.allProcessedValues.add(getValue()); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java index dc9b9404e2a..8dfc3e3e0cf 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +38,7 @@ import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.propertyeditors.CustomCollectionEditor; import org.springframework.format.Formatter; import org.springframework.format.support.FormattingConversionService; @@ -64,9 +64,11 @@ public class SelectTagTests extends AbstractFormTagTests { private TestBeanWithRealCountry bean; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new SelectTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -175,9 +177,11 @@ public class SelectTagTests extends AbstractFormTagTests { this.tag.setItems("${countries}"); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), "testBean"); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { return ((Country) getValue()).getName(); } @@ -203,9 +207,11 @@ public class SelectTagTests extends AbstractFormTagTests { this.tag.setItemLabel("name"); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), "testBean"); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { return ((Country) getValue()).getName(); } @@ -230,6 +236,7 @@ public class SelectTagTests extends AbstractFormTagTests { testBean.setBean(withCountry); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean , "testBean"); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { if (text==null || text.length()==0) { setValue(null); @@ -237,6 +244,7 @@ public class SelectTagTests extends AbstractFormTagTests { } setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { Country value = (Country) getValue(); if (value==null) { @@ -263,9 +271,11 @@ public class SelectTagTests extends AbstractFormTagTests { testBean.setBean(getTestBean()); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean , "testBean"); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { return ((Country) getValue()).getName(); } @@ -287,9 +297,11 @@ public class SelectTagTests extends AbstractFormTagTests { testBean.setRealCountry(null); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean, "testBean"); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { Country value = (Country) getValue(); if (value==null) { @@ -325,7 +337,7 @@ public class SelectTagTests extends AbstractFormTagTests { catch (JspException expected) { String message = expected.getMessage(); assertTrue(message.indexOf("items") > -1); - assertTrue(message.indexOf("org.springframework.beans.TestBean") > -1); + assertTrue(message.indexOf("org.springframework.tests.sample.beans.TestBean") > -1); } } @@ -470,9 +482,11 @@ public class SelectTagTests extends AbstractFormTagTests { BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME); FormattingConversionService cs = new FormattingConversionService(); cs.addFormatterForFieldType(Country.class, new Formatter() { + @Override public String print(Country object, Locale locale) { return object.getName(); } + @Override public Country parse(String text, Locale locale) throws ParseException { return new Country(text, text); } @@ -515,9 +529,11 @@ public class SelectTagTests extends AbstractFormTagTests { BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME); FormattingConversionService cs = new FormattingConversionService(); cs.addFormatterForFieldType(Country.class, new Formatter() { + @Override public String print(Country object, Locale locale) { return object.getName(); } + @Override public Country parse(String text, Locale locale) throws ParseException { return new Country(text, text); } @@ -563,6 +579,7 @@ public class SelectTagTests extends AbstractFormTagTests { BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME); errors.getPropertyAccessor().registerCustomEditor(List.class, new CustomCollectionEditor(LinkedList.class) { + @Override public String getAsText() { return getValue().toString(); } @@ -671,10 +688,12 @@ public class SelectTagTests extends AbstractFormTagTests { BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), COMMAND_NAME); bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() { + @Override public void setAsText(final String text) throws IllegalArgumentException { setValue(Country.getCountryWithIsoCode(text)); } + @Override public String getAsText() { return ((Country) getValue()).getIsoCode(); } @@ -772,6 +791,7 @@ public class SelectTagTests extends AbstractFormTagTests { private Map getCountryToLocaleMap() { Map map = new TreeMap(new Comparator() { + @Override public int compare(Object o1, Object o2) { return ((Country)o1).getName().compareTo(((Country)o2).getName()); } @@ -793,6 +813,7 @@ public class SelectTagTests extends AbstractFormTagTests { return sexes; } + @Override protected void extendRequest(MockHttpServletRequest request) { super.extendRequest(request); request.setAttribute("countries", Country.getCountries()); @@ -834,6 +855,7 @@ public class SelectTagTests extends AbstractFormTagTests { } } + @Override protected TestBean createTestBean() { this.bean = new TestBeanWithRealCountry(); this.bean.setName("Rob"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SimpleFloatEditor.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SimpleFloatEditor.java index 075ea9e0114..fd2674f9ab0 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SimpleFloatEditor.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SimpleFloatEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -24,10 +24,12 @@ import java.beans.PropertyEditorSupport; */ class SimpleFloatEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { setValue(new Float(text)); } + @Override public String getAsText() { return getValue() + "f"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TagWriterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TagWriterTests.java index 965bd06a41f..9c64ac0e26e 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TagWriterTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TagWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -31,6 +31,7 @@ public class TagWriterTests extends TestCase { private StringWriter data; + @Override protected void setUp() throws Exception { this.data = new StringWriter(); this.writer = new TagWriter(this.data); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TestBeanWithRealCountry.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TestBeanWithRealCountry.java index e1a6a313d0d..4ea337bbd75 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TestBeanWithRealCountry.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TestBeanWithRealCountry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,7 @@ package org.springframework.web.servlet.tags.form; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; /** * @author Juergen Hoeller diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TextareaTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TextareaTagTests.java index 44521f112d9..bfa9bd8dbe1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TextareaTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/TextareaTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -18,7 +18,7 @@ package org.springframework.web.servlet.tags.form; import javax.servlet.jsp.tagext.Tag; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.validation.BeanPropertyBindingResult; /** @@ -33,9 +33,11 @@ public class TextareaTagTests extends AbstractFormTagTests { private TestBean rob; + @Override @SuppressWarnings("serial") protected void onSetUp() { this.tag = new TextareaTag() { + @Override protected TagWriter createTagWriter() { return new TagWriter(getWriter()); } @@ -110,6 +112,7 @@ public class TextareaTagTests extends AbstractFormTagTests { assertBlockTagContains(output, "12.34f"); } + @Override protected TestBean createTestBean() { // set up test data this.rob = new TestBean(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java index d3e02cc7c28..289fcbf064c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java @@ -309,6 +309,7 @@ public class BaseViewTests extends TestCase { */ private class ConcreteView extends AbstractView { // Do-nothing concrete subclass + @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { throw new UnsupportedOperationException(); @@ -330,6 +331,7 @@ public class BaseViewTests extends TestCase { this.wac = wac; } + @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // do nothing @@ -338,6 +340,7 @@ public class BaseViewTests extends TestCase { /** * @see org.springframework.context.support.ApplicationObjectSupport#initApplicationContext() */ + @Override protected void initApplicationContext() throws ApplicationContextException { if (inited) throw new RuntimeException("Already initialized"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java index 46d34e7b335..e46aa5449e5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java @@ -73,6 +73,7 @@ public class InternalResourceViewTests extends TestCase { InternalResourceView view = new InternalResourceView(); view.setUrl(url); view.setServletContext(new MockServletContext() { + @Override public int getMinorVersion() { return 4; } @@ -118,6 +119,7 @@ public class InternalResourceViewTests extends TestCase { InternalResourceView view = new InternalResourceView(); view.setUrl(url); view.setServletContext(new MockServletContext() { + @Override public int getMinorVersion() { return 4; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/RedirectViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/RedirectViewTests.java index d252550f18a..d3c45fb2493 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/RedirectViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/RedirectViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,7 +36,7 @@ import junit.framework.AssertionFailedError; import org.easymock.EasyMock; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.http.HttpStatus; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverNoCacheTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverNoCacheTests.java index 1695bd0c540..654378cf362 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverNoCacheTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverNoCacheTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,6 +21,7 @@ package org.springframework.web.servlet.view; */ public class ResourceBundleViewResolverNoCacheTests extends ResourceBundleViewResolverTests { + @Override protected boolean getCache() { return false; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverTests.java index 117063f7af5..b100a6a68eb 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverTests.java @@ -46,6 +46,7 @@ public class ResourceBundleViewResolverTests extends TestCase { private StaticWebApplicationContext wac; + @Override protected void setUp() throws Exception { rb = new ResourceBundleViewResolver(); rb.setBasename(PROPS_FILE); @@ -170,9 +171,11 @@ public class ResourceBundleViewResolverTests extends TestCase { } } + @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) { } + @Override protected void initApplicationContext() { ++initCount; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ViewResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ViewResolverTests.java index 286f628e22f..3836559480d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ViewResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/ViewResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -35,7 +35,7 @@ import org.junit.Test; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.context.ApplicationContextException; import org.springframework.core.io.ClassPathResource; @@ -249,8 +249,10 @@ public class ViewResolverTests { vr.setApplicationContext(wac); MockHttpServletRequest request = new MockHttpServletRequest(sc) { + @Override public RequestDispatcher getRequestDispatcher(String path) { return new MockRequestDispatcher(path) { + @Override public void forward(ServletRequest forwardRequest, ServletResponse forwardResponse) { assertTrue("Correct rc attribute", forwardRequest.getAttribute("rc") == null); assertEquals("value1", forwardRequest.getAttribute("key1")); @@ -287,8 +289,10 @@ public class ViewResolverTests { vr.setApplicationContext(wac); MockHttpServletRequest request = new MockHttpServletRequest(sc) { + @Override public RequestDispatcher getRequestDispatcher(String path) { return new MockRequestDispatcher(path) { + @Override public void forward(ServletRequest forwardRequest, ServletResponse forwardResponse) { assertTrue("Correct rc attribute", forwardRequest.getAttribute("rc") == null); assertEquals("value1", forwardRequest.getAttribute("key1")); @@ -432,6 +436,7 @@ public class ViewResolverTests { @Test public void testXmlViewResolverDefaultLocation() { StaticWebApplicationContext wac = new StaticWebApplicationContext() { + @Override protected Resource getResourceByPath(String path) { assertTrue("Correct default location", XmlViewResolver.DEFAULT_LOCATION.equals(path)); return super.getResourceByPath(path); @@ -453,6 +458,7 @@ public class ViewResolverTests { @Test public void testXmlViewResolverWithoutCache() throws Exception { StaticWebApplicationContext wac = new StaticWebApplicationContext() { + @Override protected Resource getResourceByPath(String path) { assertTrue("Correct default location", XmlViewResolver.DEFAULT_LOCATION.equals(path)); return super.getResourceByPath(path); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/ExcelViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/ExcelViewTests.java index 5f44339cbde..62ba99fb7bf 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/ExcelViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/ExcelViewTests.java @@ -57,6 +57,7 @@ public class ExcelViewTests extends TestCase { private MockHttpServletResponse response; private StaticWebApplicationContext webAppCtx; + @Override public void setUp() { servletCtx = new MockServletContext("org/springframework/web/servlet/view/document"); request = new MockHttpServletRequest(servletCtx); @@ -67,6 +68,7 @@ public class ExcelViewTests extends TestCase { public void testExcel() throws Exception { AbstractExcelView excelView = new AbstractExcelView() { + @Override protected void buildExcelDocument(Map model, HSSFWorkbook wb, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -101,6 +103,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("nl", "nl")); AbstractExcelView excelView = new AbstractExcelView() { + @Override protected void buildExcelDocument(Map model, HSSFWorkbook wb, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -135,6 +138,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("en", "US")); AbstractExcelView excelView = new AbstractExcelView() { + @Override protected void buildExcelDocument(Map model, HSSFWorkbook wb, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -169,6 +173,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("de", "")); AbstractExcelView excelView = new AbstractExcelView() { + @Override protected void buildExcelDocument(Map model, HSSFWorkbook wb, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -200,6 +205,7 @@ public class ExcelViewTests extends TestCase { public void testJExcel() throws Exception { AbstractJExcelView excelView = new AbstractJExcelView() { + @Override protected void buildExcelDocument(Map model, WritableWorkbook wb, HttpServletRequest request, @@ -229,6 +235,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("nl", "nl")); AbstractJExcelView excelView = new AbstractJExcelView() { + @Override protected void buildExcelDocument(Map model, WritableWorkbook wb, HttpServletRequest request, @@ -259,6 +266,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("en", "US")); AbstractJExcelView excelView = new AbstractJExcelView() { + @Override protected void buildExcelDocument(Map model, WritableWorkbook wb, HttpServletRequest request, @@ -289,6 +297,7 @@ public class ExcelViewTests extends TestCase { newDummyLocaleResolver("de", "")); AbstractJExcelView excelView = new AbstractJExcelView() { + @Override protected void buildExcelDocument(Map model, WritableWorkbook wb, HttpServletRequest request, @@ -316,10 +325,12 @@ public class ExcelViewTests extends TestCase { private LocaleResolver newDummyLocaleResolver(final String lang, final String country) { return new LocaleResolver() { + @Override public Locale resolveLocale(HttpServletRequest request) { return new Locale(lang, country); } + @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { // not supported! diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/PdfViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/PdfViewTests.java index c0b9938bb5a..933b8e0129e 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/PdfViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/document/PdfViewTests.java @@ -44,6 +44,7 @@ public class PdfViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractPdfView pdfView = new AbstractPdfView() { + @Override protected void buildPdfDocument(Map model, Document document, PdfWriter writer, HttpServletRequest request, HttpServletResponse response) throws Exception { document.add(new Paragraph(text)); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java index 8da83022c48..962b3fa33c3 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -85,12 +85,14 @@ public class FreeMarkerConfigurerTests extends TestCase { settings.setProperty("localized_lookup", "false"); fcfb.setFreemarkerSettings(settings); fcfb.setResourceLoader(new ResourceLoader() { + @Override public Resource getResource(String location) { if (!("file:/mydir".equals(location) || "file:/mydir/test".equals(location))) { throw new IllegalArgumentException(location); } return new ByteArrayResource("test".getBytes(), "test"); } + @Override public ClassLoader getClassLoader() { return getClass().getClassLoader(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java index d3af0683f4f..17a4c4f50c4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.FileSystemResource; import org.springframework.mock.web.test.MockHttpServletRequest; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerViewTests.java index d3a6bfab40a..ff233b9be2f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerViewTests.java @@ -202,9 +202,11 @@ public class FreeMarkerViewTests { private class TestConfiguration extends Configuration { + @Override public Template getTemplate(String name, final Locale locale) throws IOException { if (name.equals("templateName") || name.equals("prefix_test_suffix")) { return new Template(name, new StringReader("test")) { + @Override public void process(Object model, Writer writer) throws TemplateException, IOException { assertEquals(Locale.US, locale); assertTrue(model instanceof AllHttpScopesHashModel); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsTests.java index 5638a35db6c..f78a5f1b022 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsTests.java @@ -54,6 +54,7 @@ public abstract class AbstractJasperReportsTests extends TestCase { protected MockHttpServletResponse response; + @Override public void setUp() { request = new MockHttpServletRequest(); response = new MockHttpServletResponse(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsViewTests.java index a4a9fb610a6..5350f159999 100755 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsViewTests.java @@ -411,10 +411,12 @@ public abstract class AbstractJasperReportsViewTests extends AbstractJasperRepor super(clazz); } + @Override public JRDataSource create(JasperReport jasperReport) throws JRException { return new JRBeanCollectionDataSource(getData()); } + @Override public void dispose(JRDataSource jrDataSource) throws JRException { } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithStreamTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithStreamTests.java index 85ce6ff5ffc..3f248d1931c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithStreamTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithStreamTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ import net.sf.jasperreports.engine.export.JRHtmlExporter; */ public class ConfigurableJasperReportsViewWithStreamTests extends AbstractConfigurableJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { ConfigurableJasperReportsView view = new ConfigurableJasperReportsView(); view.setExporterClass(JRHtmlExporter.class); @@ -31,6 +32,7 @@ public class ConfigurableJasperReportsViewWithStreamTests extends AbstractConfig return view; } + @Override protected String getDesiredContentType() { return "application/pdf"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithWriterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithWriterTests.java index e35f3e93a88..2c509c49738 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithWriterTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ConfigurableJasperReportsViewWithWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2012 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. @@ -23,6 +23,7 @@ import net.sf.jasperreports.engine.export.JRPdfExporter; */ public class ConfigurableJasperReportsViewWithWriterTests extends AbstractConfigurableJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { ConfigurableJasperReportsView view = new ConfigurableJasperReportsView(); view.setExporterClass(JRPdfExporter.class); @@ -31,6 +32,7 @@ public class ConfigurableJasperReportsViewWithWriterTests extends AbstractConfig return view; } + @Override protected String getDesiredContentType() { return "text/html"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ExporterParameterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ExporterParameterTests.java index 18e25e2cd8c..0cd2f131f29 100755 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ExporterParameterTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/ExporterParameterTests.java @@ -41,6 +41,7 @@ public class ExporterParameterTests extends AbstractJasperReportsTests { params.put("net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IMAGES_URI", "/foo/bar"); AbstractJasperReportsView view = new AbstractJasperReportsView() { + @Override protected void renderReport(JasperPrint filledReport, Map model, HttpServletResponse response) throws Exception { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvViewTests.java index 2200bd3f6f8..7b32ec733c8 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsCsvViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,10 +21,12 @@ package org.springframework.web.servlet.view.jasperreports; */ public class JasperReportsCsvViewTests extends AbstractJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { return new JasperReportsCsvView(); } + @Override protected String getDesiredContentType() { return "text/csv"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlViewTests.java index 0c38a3b2a8c..88d83e4fcb1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsHtmlViewTests.java @@ -30,10 +30,12 @@ import org.springframework.web.servlet.DispatcherServlet; */ public class JasperReportsHtmlViewTests extends AbstractJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { return new JasperReportsHtmlView(); } + @Override protected String getDesiredContentType() { return "text/html"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewTests.java index e91dc32e572..bbb12663c20 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -29,6 +29,7 @@ import net.sf.jasperreports.engine.JasperPrint; */ public class JasperReportsMultiFormatViewTests extends AbstractJasperReportsViewTests { + @Override protected void extendModel(Map model) { model.put(getDiscriminatorKey(), "csv"); } @@ -48,6 +49,7 @@ public class JasperReportsMultiFormatViewTests extends AbstractJasperReportsView assertEquals("Invalid content type", "text/html", response.getContentType()); } + @Override public void testOverrideContentDisposition() throws Exception { if (!canCompileReport) { return; @@ -101,10 +103,12 @@ public class JasperReportsMultiFormatViewTests extends AbstractJasperReportsView return "format"; } + @Override protected AbstractJasperReportsView getViewImplementation() { return new JasperReportsMultiFormatView(); } + @Override protected String getDesiredContentType() { return "text/csv"; } @@ -121,6 +125,7 @@ public class JasperReportsMultiFormatViewTests extends AbstractJasperReportsView public static final String TEST_PARAM = "net.sf.jasperreports.engine.export.JRHtmlExporterParameter.IMAGES_URI"; + @Override protected void renderReport(JasperPrint filledReport, Map parameters, HttpServletResponse response) { assertNotNull("Exporter parameters are null", getExporterParameters()); assertEquals("Incorrect number of exporter parameters", 1, getExporterParameters().size()); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewWithCustomMappingsTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewWithCustomMappingsTests.java index 3bb3b30bd04..0ad16202a35 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewWithCustomMappingsTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatViewWithCustomMappingsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -25,6 +25,7 @@ import java.util.Map; */ public class JasperReportsMultiFormatViewWithCustomMappingsTests extends JasperReportsMultiFormatViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { JasperReportsMultiFormatView view = new JasperReportsMultiFormatView(); view.setFormatKey("fmt"); @@ -37,10 +38,12 @@ public class JasperReportsMultiFormatViewWithCustomMappingsTests extends JasperR return view; } + @Override protected String getDiscriminatorKey() { return "fmt"; } + @Override protected void extendModel(Map model) { model.put(getDiscriminatorKey(), "comma-separated"); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfViewTests.java index 84060185caf..0ab3e04aaf1 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsPdfViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,10 +21,12 @@ package org.springframework.web.servlet.view.jasperreports; */ public class JasperReportsPdfViewTests extends AbstractJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { return new JasperReportsPdfView(); } + @Override protected String getDesiredContentType() { return "application/pdf"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsViewTests.java index af86756cb43..4b3b6f0cd61 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/JasperReportsXlsViewTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2012 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,10 +21,12 @@ package org.springframework.web.servlet.view.jasperreports; */ public class JasperReportsXlsViewTests extends AbstractJasperReportsViewTests { + @Override protected AbstractJasperReportsView getViewImplementation() { return new JasperReportsXlsView(); } + @Override protected String getDesiredContentType() { return "application/vnd.ms-excel"; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/TestVelocityEngine.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/TestVelocityEngine.java index 401c914230a..63c320b73f5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/TestVelocityEngine.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/TestVelocityEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2012 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. @@ -44,6 +44,7 @@ public class TestVelocityEngine extends VelocityEngine { } + @Override public Template getTemplate(String name) throws ResourceNotFoundException { Template template = (Template) this.templates.get(name); if (template == null) { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java index af090a253bc..69f8ea613aa 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -87,6 +87,7 @@ public class VelocityConfigurerTests extends TestCase { VelocityEngineFactoryBean vefb = new VelocityEngineFactoryBean(); vefb.setResourceLoaderPath("file:/mydir"); vefb.setResourceLoader(new ResourceLoader() { + @Override public Resource getResource(String location) { if (location.equals("file:/mydir") || location.equals("file:/mydir/test")) { return new ByteArrayResource("test".getBytes(), "test"); @@ -98,6 +99,7 @@ public class VelocityConfigurerTests extends TestCase { throw new IllegalArgumentException(ex.toString()); } } + @Override public ClassLoader getClassLoader() { return getClass().getClassLoader(); } @@ -133,12 +135,14 @@ public class VelocityConfigurerTests extends TestCase { VelocityConfigurer vc = new VelocityConfigurer(); vc.setResourceLoaderPath("file:/mydir,file:/yourdir"); vc.setResourceLoader(new ResourceLoader() { + @Override public Resource getResource(String location) { if ("file:/yourdir/test".equals(location)) { return new DescriptiveResource(""); } return new ByteArrayResource("test".getBytes(), "test"); } + @Override public ClassLoader getClassLoader() { return getClass().getClassLoader(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityMacroTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityMacroTests.java index fb265453d98..04c8497df3c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityMacroTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityMacroTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,7 +27,7 @@ import org.apache.velocity.Template; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.context.Context; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.mock.web.test.MockServletContext; @@ -57,12 +57,14 @@ public class VelocityMacroTests extends TestCase { private MockHttpServletResponse response; + @Override public void setUp() throws Exception { wac = new StaticWebApplicationContext(); wac.setServletContext(new MockServletContext()); final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(TEMPLATE_FILE, expectedTemplate); } @@ -79,6 +81,7 @@ public class VelocityMacroTests extends TestCase { public void testExposeSpringMacroHelpers() throws Exception { VelocityView vv = new VelocityView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) { assertTrue(context.get(VelocityView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE) instanceof RequestContext); RequestContext rc = (RequestContext) context.get(VelocityView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE); @@ -100,6 +103,7 @@ public class VelocityMacroTests extends TestCase { final String helperTool = "wrongType"; VelocityView vv = new VelocityView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) { fail(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityRenderTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityRenderTests.java index 97dc0cb787e..b07a53716ea 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityRenderTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityRenderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -27,13 +27,13 @@ import org.apache.velocity.Template; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.exception.MethodInvocationException; import org.hamcrest.Description; +import org.hamcrest.TypeSafeMatcher; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; -import org.junit.internal.matchers.TypeSafeMatcher; import org.junit.rules.ExpectedException; -import org.springframework.beans.TestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.mock.web.test.MockServletContext; @@ -64,6 +64,7 @@ public class VelocityRenderTests { final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine("test.vm", expectedTemplate); } @@ -106,9 +107,11 @@ public class VelocityRenderTests { thrown.expect(NestedServletException.class); thrown.expect(new TypeSafeMatcher() { + @Override public boolean matchesSafely(Exception item) { return item.getCause() instanceof MethodInvocationException; } + @Override public void describeTo(Description description) { description.appendText("exception has cause of MethodInvocationException"); @@ -138,9 +141,11 @@ public class VelocityRenderTests { thrown.expect(NestedServletException.class); thrown.expect(new TypeSafeMatcher() { + @Override public boolean matchesSafely(Exception item) { return item.getCause() instanceof IOException; } + @Override public void describeTo(Description description) { description.appendText("exception has cause of IOException"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityToolboxViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityToolboxViewTests.java index 5bf06837bf0..4cdf72c4b36 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityToolboxViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityToolboxViewTests.java @@ -39,6 +39,7 @@ public class VelocityToolboxViewTests { wac.setServletContext(new MockServletContext()); final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(templateName, expectedTemplate); } @@ -49,6 +50,7 @@ public class VelocityToolboxViewTests { final HttpServletResponse expectedResponse = new MockHttpServletResponse(); VelocityToolboxView vv = new VelocityToolboxView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws Exception { assertTrue(template == expectedTemplate); assertTrue(response == expectedResponse); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewResolverTests.java index d8a43ebf481..e17f0b00878 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewResolverTests.java @@ -24,6 +24,7 @@ public class VelocityViewResolverTests { @Test public void testVelocityViewResolver() throws Exception { VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine("prefix_test_suffix", new Template()); } @@ -57,6 +58,7 @@ public class VelocityViewResolverTests { @Test public void testVelocityViewResolverWithToolbox() throws Exception { VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine("prefix_test_suffix", new Template()); } @@ -83,6 +85,7 @@ public class VelocityViewResolverTests { @Test public void testVelocityViewResolverWithToolboxSubclass() throws Exception { VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { TestVelocityEngine ve = new TestVelocityEngine(); ve.addTemplate("prefix_test_suffix", new Template()); @@ -113,6 +116,7 @@ public class VelocityViewResolverTests { @Test public void testVelocityLayoutViewResolver() throws Exception { VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { TestVelocityEngine ve = new TestVelocityEngine(); ve.addTemplate("prefix_test_suffix", new Template()); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewTests.java index 916e1f2fb1b..ac1a396f659 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityViewTests.java @@ -137,6 +137,7 @@ public class VelocityViewTests { final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(templateName, expectedTemplate); } @@ -157,6 +158,7 @@ public class VelocityViewTests { final HttpServletResponse expectedResponse = new MockHttpServletResponse(); VelocityView vv = new VelocityView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws Exception { assertTrue(template == expectedTemplate); assertTrue(context.getKeys().length >= 1); @@ -194,6 +196,7 @@ public class VelocityViewTests { final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(templateName, expectedTemplate); } @@ -215,10 +218,12 @@ public class VelocityViewTests { expectedResponse.setContentType("myContentType"); VelocityView vv = new VelocityView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) { assertTrue(template == expectedTemplate); assertTrue(response == expectedResponse); } + @Override protected void exposeHelpers(Map model, HttpServletRequest request) throws Exception { model.put("myHelper", "myValue"); } @@ -244,6 +249,7 @@ public class VelocityViewTests { final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { + @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(templateName, expectedTemplate); } @@ -268,6 +274,7 @@ public class VelocityViewTests { final HttpServletResponse expectedResponse = new MockHttpServletResponse(); VelocityView vv = new VelocityView() { + @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws Exception { assertTrue(template == expectedTemplate); assertTrue(response == expectedResponse); @@ -284,6 +291,7 @@ public class VelocityViewTests { assertTrue(numberTool.getLocale().equals(Locale.CANADA)); } + @Override protected void exposeHelpers(Map model, HttpServletRequest request) throws Exception { model.put("myHelper", "myValue"); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/xslt/TestXsltViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/xslt/TestXsltViewTests.java index 2b96a0c3e39..c760d74441d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/xslt/TestXsltViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/xslt/TestXsltViewTests.java @@ -52,6 +52,7 @@ import org.springframework.web.servlet.ModelAndView; * @author Juergen Hoeller * @since 11.03.2005 */ +@Deprecated public class TestXsltViewTests extends TestCase { private TestXsltView view; @@ -63,6 +64,7 @@ public class TestXsltViewTests extends TestCase { private int fatal = 0; + @Override public void setUp() { this.view = new TestXsltView(); } @@ -80,12 +82,15 @@ public class TestXsltViewTests extends TestCase { public void testCustomErrorListener() { view.setErrorListener(new ErrorListener() { + @Override public void warning(TransformerException ex) { incWarnings(); } + @Override public void error(TransformerException ex) { incErrors(); } + @Override public void fatalError(TransformerException ex) { incFatals(); } @@ -110,6 +115,7 @@ public class TestXsltViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractXsltView view = new AbstractXsltView() { + @Override protected Source createXsltSource(Map model, String root, HttpServletRequest request, HttpServletResponse response) throws Exception { Hero hero = (Hero) model.get("hero"); Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); @@ -136,6 +142,7 @@ public class TestXsltViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractXsltView view = new AbstractXsltView() { + @Override protected Source createXsltSource(Map model, String root, HttpServletRequest request, HttpServletResponse response) throws Exception { Hero hero = (Hero) model.get("hero"); Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); @@ -163,6 +170,7 @@ public class TestXsltViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractXsltView view = new AbstractXsltView() { + @Override protected Map getParameters(HttpServletRequest request) { Map parameters = new HashMap(); parameters.put("sex", "Male"); @@ -195,6 +203,7 @@ public class TestXsltViewTests extends TestCase { response.setWriterAccessAllowed(false); AbstractXsltView view = new AbstractXsltView() { + @Override protected Map getParameters(HttpServletRequest request) { Map parameters = new HashMap(); parameters.put("sex", "Male"); @@ -221,6 +230,7 @@ public class TestXsltViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractXsltView view = new AbstractXsltView() { + @Override protected Map getParameters(HttpServletRequest request) { Map parameters = new HashMap(); parameters.put("sex", "Male"); @@ -256,6 +266,7 @@ public class TestXsltViewTests extends TestCase { response.setOutputStreamAccessAllowed(false); AbstractXsltView view = new AbstractXsltView() { + @Override protected Source createXsltSource(Map model, String root, HttpServletRequest request, HttpServletResponse response) throws Exception { Hero hero = (Hero) model.get("hero"); Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); @@ -265,11 +276,13 @@ public class TestXsltViewTests extends TestCase { node.setAttribute("catchphrase", hero.getCatchphrase()); return new DOMSource(node); } + @Override protected Map getParameters(HttpServletRequest request) { Map parameters = new HashMap(); parameters.put("sex", "Male"); return parameters; } + @Override protected boolean useWriter() { return true; } @@ -299,6 +312,7 @@ public class TestXsltViewTests extends TestCase { MockHttpServletResponse response = new MockHttpServletResponse(); AbstractXsltView view = new AbstractXsltView() { + @Override protected Source createXsltSource( Map model, String rootName, HttpServletRequest request, HttpServletResponse response) throws Exception { diff --git a/spring-webmvc/src/test/resources/org/springframework/web/context/WEB-INF/sessionContext.xml b/spring-webmvc/src/test/resources/org/springframework/web/context/WEB-INF/sessionContext.xml index 7da590d1f21..eb7bf0f6eae 100644 --- a/spring-webmvc/src/test/resources/org/springframework/web/context/WEB-INF/sessionContext.xml +++ b/spring-webmvc/src/test/resources/org/springframework/web/context/WEB-INF/sessionContext.xml @@ -3,12 +3,12 @@ - + - + diff --git a/src/reference/docbook/mvc.xml b/src/reference/docbook/mvc.xml index 53150169770..ffe081c1e09 100644 --- a/src/reference/docbook/mvc.xml +++ b/src/reference/docbook/mvc.xml @@ -2484,9 +2484,9 @@ deferredResult.setResult(data); resumes with the asynchronously produced result. - Explaining the motivation for async request processing, when or why to use it - is beyond the scope of this document. For further information you may wish to read - this blog post series. + Explaining the motivation for async request processing and when or why to use it + are beyond the scope of this document. For further information you may wish to read + this blog post series.
diff --git a/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests-context.xml b/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests-context.xml index 4be55f0ea74..49e480a6644 100644 --- a/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests-context.xml +++ b/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests-context.xml @@ -11,19 +11,19 @@ - + - + - + - + diff --git a/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests.java b/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests.java index 231ae393a26..8a3c1786275 100644 --- a/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests.java +++ b/src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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,20 +17,22 @@ package org.springframework.aop.config; import static java.lang.String.format; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import test.beans.ITestBean; -import test.beans.TestBean; -import test.util.SerializationTestUtils; - import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; import org.springframework.context.ApplicationContext; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpSession; +import org.springframework.tests.sample.beans.ITestBean; +import org.springframework.tests.sample.beans.TestBean; import org.springframework.util.ClassUtils; +import org.springframework.util.SerializationTestUtils; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.support.XmlWebApplicationContext; diff --git a/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests-context.xml b/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests-context.xml index 4f9a0361c04..c5b04a53df3 100644 --- a/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests-context.xml +++ b/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests-context.xml @@ -22,20 +22,20 @@ 9 false - + 11 true - + true - - + + @@ -71,37 +71,37 @@ - + - - - - - + + + + + - test.beans.ITestBean.getName + org.springframework.tests.sample.beans.ITestBean.getName - + - + 4 - + - + - + diff --git a/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java b/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java index 7b2f7d94a42..d2fbb3e1e06 100644 --- a/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java +++ b/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2013 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. @@ -16,7 +16,9 @@ package org.springframework.aop.framework.autoproxy; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.IOException; import java.lang.reflect.Method; @@ -30,16 +32,13 @@ import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.support.ClassPathXmlApplicationContext; +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.TransactionDefinition; import org.springframework.transaction.interceptor.TransactionInterceptor; -import org.springframework.transaction.support.AbstractPlatformTransactionManager; -import org.springframework.transaction.support.DefaultTransactionStatus; - -import test.advice.CountingBeforeAdvice; -import test.advice.MethodCounter; -import test.beans.ITestBean; -import test.interceptor.NopInterceptor; /** * Integration tests for auto proxy creation by advisor recognition working in @@ -207,6 +206,7 @@ class NeverMatchAdvisor extends StaticMethodMatcherPointcutAdvisor { /** * @see org.springframework.aop.MethodMatcher#matches(java.lang.reflect.Method, java.lang.Class) */ + @Override public boolean matches(Method m, Class targetClass) { return false; } @@ -249,10 +249,12 @@ class OrderedTxCheckAdvisor extends StaticMethodMatcherPointcutAdvisor implement return (CountingBeforeAdvice) getAdvice(); } + @Override public void afterPropertiesSet() throws Exception { setAdvice(new TxCountingBeforeAdvice()); } + @Override public boolean matches(Method method, Class targetClass) { return method.getName().startsWith("setAge"); } @@ -260,6 +262,7 @@ class OrderedTxCheckAdvisor extends StaticMethodMatcherPointcutAdvisor implement private class TxCountingBeforeAdvice extends CountingBeforeAdvice { + @Override public void before(Method method, Object[] args, Object target) throws Throwable { // do transaction checks if (requireTransactionContext) { @@ -312,39 +315,3 @@ class Rollback { } } - - -@SuppressWarnings("serial") -class CallCountingTransactionManager extends AbstractPlatformTransactionManager { - - public TransactionDefinition lastDefinition; - public int begun; - public int commits; - public int rollbacks; - public int inflight; - - protected Object doGetTransaction() { - return new Object(); - } - - protected void doBegin(Object transaction, TransactionDefinition definition) { - this.lastDefinition = definition; - ++begun; - ++inflight; - } - - protected void doCommit(DefaultTransactionStatus status) { - ++commits; - --inflight; - } - - protected void doRollback(DefaultTransactionStatus status) { - ++rollbacks; - --inflight; - } - - public void clear() { - begun = commits = rollbacks = inflight = 0; - } - -} diff --git a/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java b/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java index b209a01d545..0f0fc64ac81 100644 --- a/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java +++ b/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -121,6 +121,7 @@ public class EnableCachingIntegrationTests { @Repository static class DummyFooRepository implements FooRepository { + @Override @Cacheable("primary") public List findAll() { return Collections.emptyList(); diff --git a/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java b/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java index c1d74a88d26..b213a2a4e0f 100644 --- a/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java +++ b/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -300,6 +300,7 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests { ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context); scanner.setIncludeAnnotationConfig(false); scanner.setScopeMetadataResolver(new ScopeMetadataResolver() { + @Override public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) { ScopeMetadata metadata = new ScopeMetadata(); if (definition instanceof AnnotatedBeanDefinition) { @@ -345,8 +346,10 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests { private String name = DEFAULT_NAME; + @Override public String getName() { return this.name; } + @Override public void setName(String name) { this.name = name; } } diff --git a/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java b/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java index 194c455f218..baa911c8f23 100644 --- a/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java +++ b/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. diff --git a/src/test/java/org/springframework/context/annotation/scope/ClassPathBeanDefinitionScannerScopeIntegrationTests.java b/src/test/java/org/springframework/context/annotation/scope/ClassPathBeanDefinitionScannerScopeIntegrationTests.java index dab551d075d..e0712b69c66 100644 --- a/src/test/java/org/springframework/context/annotation/scope/ClassPathBeanDefinitionScannerScopeIntegrationTests.java +++ b/src/test/java/org/springframework/context/annotation/scope/ClassPathBeanDefinitionScannerScopeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -284,6 +284,7 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests { ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context); scanner.setIncludeAnnotationConfig(false); scanner.setBeanNameGenerator(new BeanNameGenerator() { + @Override public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { return definition.getScope(); } @@ -311,8 +312,10 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests { private String name = DEFAULT_NAME; + @Override public String getName() { return this.name; } + @Override public void setName(String name) { this.name = name; } } diff --git a/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java b/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java index c4da57a4f82..f30afd1ca17 100644 --- a/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java +++ b/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -656,6 +656,7 @@ public class EnvironmentIntegrationTests { public Environment environment; + @Override public void setEnvironment(Environment environment) { this.environment = environment; } diff --git a/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java b/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java index 89010245486..8028a4cf0fd 100644 --- a/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java +++ b/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. diff --git a/src/test/java/org/springframework/expression/spel/support/BeanFactoryTypeConverter.java b/src/test/java/org/springframework/expression/spel/support/BeanFactoryTypeConverter.java index 032ab7c6fbf..366f338f113 100644 --- a/src/test/java/org/springframework/expression/spel/support/BeanFactoryTypeConverter.java +++ b/src/test/java/org/springframework/expression/spel/support/BeanFactoryTypeConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -57,6 +57,7 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware { this.conversionService = conversionService; } + @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { if (beanFactory instanceof ConfigurableBeanFactory) { Object typeConverter = ((ConfigurableBeanFactory) beanFactory).getTypeConverter(); @@ -80,6 +81,7 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware { return delegate.findCustomEditor(targetType, null) != null || delegate.getDefaultEditor(targetType) != null; } + @Override public boolean canConvert(TypeDescriptor sourceTypeDescriptor, TypeDescriptor targetTypeDescriptor) { if (conversionService.canConvert(sourceTypeDescriptor, targetTypeDescriptor)) { return true; @@ -90,6 +92,7 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware { return canConvert(sourceType, targetType); } + @Override public Object convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) { if (targetType.getType() == Void.class || targetType.getType() == Void.TYPE) { return null; diff --git a/src/test/java/org/springframework/expression/spel/support/Spr7538Tests.java b/src/test/java/org/springframework/expression/spel/support/Spr7538Tests.java index 0ddec74625e..5fe702c3bee 100644 --- a/src/test/java/org/springframework/expression/spel/support/Spr7538Tests.java +++ b/src/test/java/org/springframework/expression/spel/support/Spr7538Tests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2012 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 + * + * http://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.expression.spel.support; import java.lang.reflect.Method; diff --git a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java index 2970b5f0aa6..aca10a3fb26 100644 --- a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java +++ b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -16,10 +16,18 @@ package org.springframework.scheduling.annotation; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.replay; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.greaterThan; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Before; import org.junit.Test; - import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -28,16 +36,13 @@ import org.springframework.context.annotation.Configuration; import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; import org.springframework.dao.support.PersistenceExceptionTranslator; import org.springframework.stereotype.Repository; -import org.springframework.transaction.CallCountingTransactionManager; +import org.springframework.tests.Assume; +import org.springframework.tests.TestGroup; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; -import static org.easymock.EasyMock.*; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; - /** * Integration tests cornering bug SPR-8651, which revealed that @Scheduled methods may * not work well with beans that have already been proxied for other reasons such @@ -48,6 +53,11 @@ import static org.junit.Assert.*; */ public class ScheduledAndTransactionalAnnotationIntegrationTests { + @Before + public void setUp() { + Assume.group(TestGroup.PERFORMANCE); + } + @Test public void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); @@ -153,6 +163,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests { this.count.incrementAndGet(); } + @Override public int getInvocationCount() { return this.count.get(); } @@ -168,12 +179,14 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests { private final AtomicInteger count = new AtomicInteger(0); + @Override @Transactional @Scheduled(fixedDelay = 5) public void scheduled() { this.count.incrementAndGet(); } + @Override public int getInvocationCount() { return this.count.get(); } diff --git a/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java b/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java deleted file mode 100644 index 4b5aaa39de1..00000000000 --- a/src/test/java/org/springframework/transaction/CallCountingTransactionManager.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.springframework.transaction; -/* - * Copyright 2002-2007 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 - * - * http://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. - */ - - - -import org.springframework.transaction.support.AbstractPlatformTransactionManager; -import org.springframework.transaction.support.DefaultTransactionStatus; - -/** - * @author Rod Johnson - * @author Juergen Hoeller - */ -@SuppressWarnings("serial") -public class CallCountingTransactionManager extends AbstractPlatformTransactionManager { - - public TransactionDefinition lastDefinition; - public int begun; - public int commits; - public int rollbacks; - public int inflight; - - protected Object doGetTransaction() { - return new Object(); - } - - protected void doBegin(Object transaction, TransactionDefinition definition) { - this.lastDefinition = definition; - ++begun; - ++inflight; - } - - protected void doCommit(DefaultTransactionStatus status) { - ++commits; - --inflight; - } - - protected void doRollback(DefaultTransactionStatus status) { - ++rollbacks; - --inflight; - } - - public void clear() { - begun = commits = rollbacks = inflight = 0; - } - -} diff --git a/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java b/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java index 6391a5328e3..54511e7e7b4 100644 --- a/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java +++ b/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2013 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. @@ -46,7 +46,7 @@ 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.transaction.CallCountingTransactionManager; +import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor; @@ -219,6 +219,7 @@ public class EnableTransactionManagementIntegrationTests { return new CallCountingTransactionManager(); } + @Override public PlatformTransactionManager annotationDrivenTransactionManager() { return txManager1(); } @@ -327,6 +328,7 @@ public class EnableTransactionManagementIntegrationTests { public void setDataSource(DataSource dataSource) { } + @Override @Transactional public List findAll() { return Collections.emptyList(); @@ -336,6 +338,7 @@ public class EnableTransactionManagementIntegrationTests { @Repository static class DummyFooRepository implements FooRepository { + @Override @Transactional public List findAll() { return Collections.emptyList(); diff --git a/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java b/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java index 076f73b84c1..a3b509d8a7f 100644 --- a/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java +++ b/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -115,10 +115,12 @@ interface AnnotatedService { } class NonAnnotatedServiceImpl implements AnnotatedService { + @Override public void m() { } } class AnnotatedServiceImpl implements NonAnnotatedService { + @Override @Transactional public void m() { } } diff --git a/src/test/java/test/advice/CountingAfterReturningAdvice.java b/src/test/java/test/advice/CountingAfterReturningAdvice.java deleted file mode 100644 index 2e9aaa5a15b..00000000000 --- a/src/test/java/test/advice/CountingAfterReturningAdvice.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.advice; - -import java.lang.reflect.Method; - -import org.springframework.aop.AfterReturningAdvice; - -/** - * Simple before advice example that we can use for counting checks. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class CountingAfterReturningAdvice extends MethodCounter implements AfterReturningAdvice { - - public void afterReturning(Object o, Method m, Object[] args, Object target) throws Throwable { - count(m); - } - -} \ No newline at end of file diff --git a/src/test/java/test/advice/MethodCounter.java b/src/test/java/test/advice/MethodCounter.java deleted file mode 100644 index 8c29886a3df..00000000000 --- a/src/test/java/test/advice/MethodCounter.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.advice; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.HashMap; - -/** - * Abstract superclass for counting advices etc. - * - * @author Rod Johnson - * @author Chris Beams - */ -@SuppressWarnings("serial") -public class MethodCounter implements Serializable { - - /** Method name --> count, does not understand overloading */ - private HashMap map = new HashMap(); - - private int allCount; - - protected void count(Method m) { - count(m.getName()); - } - - 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); - ++allCount; - } - - public int getCalls(String methodName) { - Integer i = map.get(methodName); - return (i != null ? i.intValue() : 0); - } - - public int getCalls() { - return allCount; - } - - /** - * A bit simplistic: just wants the same class. - * Doesn't worry about counts. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - return (other != null && other.getClass() == this.getClass()); - } - - public int hashCode() { - return getClass().hashCode(); - } - -} diff --git a/src/test/java/test/beans/Colour.java b/src/test/java/test/beans/Colour.java deleted file mode 100644 index 5be4dfa761a..00000000000 --- a/src/test/java/test/beans/Colour.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import org.springframework.core.enums.ShortCodedLabeledEnum; - -/** - * @author Rob Harrop - */ -@SuppressWarnings("serial") -public class Colour extends ShortCodedLabeledEnum { - - public static final Colour RED = new Colour(0, "RED"); - public static final Colour BLUE = new Colour(1, "BLUE"); - public static final Colour GREEN = new Colour(2, "GREEN"); - public static final Colour PURPLE = new Colour(3, "PURPLE"); - - private Colour(int code, String label) { - super(code, label); - } - -} diff --git a/src/test/java/test/beans/ITestBean.java b/src/test/java/test/beans/ITestBean.java deleted file mode 100644 index c452bdc1dda..00000000000 --- a/src/test/java/test/beans/ITestBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2002-2007 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 - * - * http://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 test.beans; - -import java.io.IOException; - -/** - * Interface used for {@link TestBean}. - * - *

Two methods are the same as on Person, but if this - * extends person it breaks quite a few tests.. - * - * @author Rod Johnson - * @author Juergen Hoeller - */ -public interface ITestBean { - - int getAge(); - - void setAge(int age); - - String getName(); - - void setName(String name); - - ITestBean getSpouse(); - - void setSpouse(ITestBean spouse); - - ITestBean[] getSpouses(); - - String[] getStringArray(); - - void setStringArray(String[] stringArray); - - /** - * Throws a given (non-null) exception. - */ - void exceptional(Throwable t) throws Throwable; - - Object returnsThis(); - - INestedTestBean getDoctor(); - - INestedTestBean getLawyer(); - - IndexedTestBean getNestedIndexedBean(); - - /** - * Increment the age by one. - * @return the previous age - */ - int haveBirthday(); - - void unreliableFileOperation() throws IOException; - -} diff --git a/src/test/java/test/beans/IndexedTestBean.java b/src/test/java/test/beans/IndexedTestBean.java deleted file mode 100644 index 951b732346a..00000000000 --- a/src/test/java/test/beans/IndexedTestBean.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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 test.beans; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @author Juergen Hoeller - * @since 11.11.2003 - */ -public class IndexedTestBean { - - private TestBean[] array; - - private Collection collection; - - private List list; - - private Set set; - - private SortedSet sortedSet; - - private Map map; - - private SortedMap sortedMap; - - - public IndexedTestBean() { - this(true); - } - - public IndexedTestBean(boolean populate) { - if (populate) { - populate(); - } - } - - public void populate() { - TestBean tb0 = new TestBean("name0", 0); - TestBean tb1 = new TestBean("name1", 0); - TestBean tb2 = new TestBean("name2", 0); - TestBean tb3 = new TestBean("name3", 0); - TestBean tb4 = new TestBean("name4", 0); - TestBean tb5 = new TestBean("name5", 0); - TestBean tb6 = new TestBean("name6", 0); - TestBean tb7 = new TestBean("name7", 0); - TestBean tbX = new TestBean("nameX", 0); - TestBean tbY = new TestBean("nameY", 0); - this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); - this.list.add(tb2); - this.list.add(tb3); - this.set = new TreeSet(); - this.set.add(tb6); - this.set.add(tb7); - this.map = new HashMap(); - this.map.put("key1", tb4); - this.map.put("key2", tb5); - this.map.put("key.3", tb5); - List list = new ArrayList(); - list.add(tbX); - list.add(tbY); - this.map.put("key4", list); - } - - - public TestBean[] getArray() { - return array; - } - - public void setArray(TestBean[] array) { - this.array = array; - } - - public Collection getCollection() { - return collection; - } - - public void setCollection(Collection collection) { - this.collection = collection; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - this.set = set; - } - - public SortedSet getSortedSet() { - return sortedSet; - } - - public void setSortedSet(SortedSet sortedSet) { - this.sortedSet = sortedSet; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - public SortedMap getSortedMap() { - return sortedMap; - } - - public void setSortedMap(SortedMap sortedMap) { - this.sortedMap = sortedMap; - } - -} diff --git a/src/test/java/test/beans/NestedTestBean.java b/src/test/java/test/beans/NestedTestBean.java deleted file mode 100644 index b0f9df9d9b6..00000000000 --- a/src/test/java/test/beans/NestedTestBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.beans; - -/** - * Simple nested test bean used for testing bean factories, AOP framework etc. - * - * @author Trevor D. Cook - * @since 30.09.2003 - */ -public class NestedTestBean implements INestedTestBean { - - private String company = ""; - - public NestedTestBean() { - } - - public NestedTestBean(String company) { - setCompany(company); - } - - public void setCompany(String company) { - this.company = (company != null ? company : ""); - } - - public String getCompany() { - return company; - } - - public boolean equals(Object obj) { - if (!(obj instanceof NestedTestBean)) { - return false; - } - NestedTestBean ntb = (NestedTestBean) obj; - return this.company.equals(ntb.company); - } - - public int hashCode() { - return this.company.hashCode(); - } - - public String toString() { - return "NestedTestBean: " + this.company; - } - -} diff --git a/src/test/java/test/beans/Pet.java b/src/test/java/test/beans/Pet.java deleted file mode 100644 index b62b5c8bf3c..00000000000 --- a/src/test/java/test/beans/Pet.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2002-2006 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 - * - * http://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 test.beans; - -/** - * @author Rob Harrop - * @since 2.0 - */ -public class Pet { - - private String name; - - public Pet(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public String toString() { - return getName(); - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - final Pet pet = (Pet) o; - - if (name != null ? !name.equals(pet.name) : pet.name != null) return false; - - return true; - } - - public int hashCode() { - return (name != null ? name.hashCode() : 0); - } - -} diff --git a/src/test/java/test/beans/TestBean.java b/src/test/java/test/beans/TestBean.java deleted file mode 100644 index 2c42a8cca50..00000000000 --- a/src/test/java/test/beans/TestBean.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2002-2008 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 - * - * http://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 test.beans; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.BeanNameAware; -import org.springframework.util.ObjectUtils; - -/** - * Simple test bean used for testing bean factories, the AOP framework etc. - * - * @author Rod Johnson - * @author Juergen Hoeller - * @since 15 April 2001 - */ -public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable { - - private String beanName; - - private String country; - - private BeanFactory beanFactory; - - private boolean postProcessed; - - private String name; - - private String sex; - - private int age; - - private boolean jedi; - - private ITestBean[] spouses; - - private String touchy; - - private String[] stringArray; - - private Integer[] someIntegerArray; - - private Date date = new Date(); - - private Float myFloat = new Float(0.0); - - private Collection friends = new LinkedList(); - - private Set someSet = new HashSet(); - - private Map someMap = new HashMap(); - - private List someList = new ArrayList(); - - private Properties someProperties = new Properties(); - - private INestedTestBean doctor = new NestedTestBean(); - - private INestedTestBean lawyer = new NestedTestBean(); - - private IndexedTestBean nestedIndexedBean; - - private boolean destroyed; - - private Number someNumber; - - private Colour favouriteColour; - - private Boolean someBoolean; - - private List otherColours; - - private List pets; - - - public TestBean() { - } - - public TestBean(String name) { - this.name = name; - } - - public TestBean(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public TestBean(String name, int age) { - this.name = name; - this.age = age; - } - - public TestBean(ITestBean spouse, Properties someProperties) { - this.spouses = new ITestBean[] {spouse}; - this.someProperties = someProperties; - } - - public TestBean(List someList) { - this.someList = someList; - } - - public TestBean(Set someSet) { - this.someSet = someSet; - } - - public TestBean(Map someMap) { - this.someMap = someMap; - } - - public TestBean(Properties someProperties) { - this.someProperties = someProperties; - } - - - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public String getBeanName() { - return beanName; - } - - public void setBeanFactory(BeanFactory beanFactory) { - this.beanFactory = beanFactory; - } - - public BeanFactory getBeanFactory() { - return beanFactory; - } - - public void setPostProcessed(boolean postProcessed) { - this.postProcessed = postProcessed; - } - - public boolean isPostProcessed() { - return postProcessed; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - if (this.name == null) { - this.name = sex; - } - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public boolean isJedi() { - return jedi; - } - - public void setJedi(boolean jedi) { - this.jedi = jedi; - } - - public ITestBean getSpouse() { - return (spouses != null ? spouses[0] : null); - } - - public void setSpouse(ITestBean spouse) { - this.spouses = new ITestBean[] {spouse}; - } - - public ITestBean[] getSpouses() { - return spouses; - } - - public String getTouchy() { - return touchy; - } - - public void setTouchy(String touchy) throws Exception { - if (touchy.indexOf('.') != -1) { - throw new Exception("Can't contain a ."); - } - if (touchy.indexOf(',') != -1) { - throw new NumberFormatException("Number format exception: contains a ,"); - } - this.touchy = touchy; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String[] getStringArray() { - return stringArray; - } - - public void setStringArray(String[] stringArray) { - this.stringArray = stringArray; - } - - public Integer[] getSomeIntegerArray() { - return someIntegerArray; - } - - public void setSomeIntegerArray(Integer[] someIntegerArray) { - this.someIntegerArray = someIntegerArray; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Float getMyFloat() { - return myFloat; - } - - public void setMyFloat(Float myFloat) { - this.myFloat = myFloat; - } - - public Collection getFriends() { - return friends; - } - - public void setFriends(Collection friends) { - this.friends = friends; - } - - public Set getSomeSet() { - return someSet; - } - - public void setSomeSet(Set someSet) { - this.someSet = someSet; - } - - public Map getSomeMap() { - return someMap; - } - - public void setSomeMap(Map someMap) { - this.someMap = someMap; - } - - public List getSomeList() { - return someList; - } - - public void setSomeList(List someList) { - this.someList = someList; - } - - public Properties getSomeProperties() { - return someProperties; - } - - public void setSomeProperties(Properties someProperties) { - this.someProperties = someProperties; - } - - public INestedTestBean getDoctor() { - return doctor; - } - - public void setDoctor(INestedTestBean doctor) { - this.doctor = doctor; - } - - public INestedTestBean getLawyer() { - return lawyer; - } - - public void setLawyer(INestedTestBean lawyer) { - this.lawyer = lawyer; - } - - public Number getSomeNumber() { - return someNumber; - } - - public void setSomeNumber(Number someNumber) { - this.someNumber = someNumber; - } - - public Colour getFavouriteColour() { - return favouriteColour; - } - - public void setFavouriteColour(Colour favouriteColour) { - this.favouriteColour = favouriteColour; - } - - public Boolean getSomeBoolean() { - return someBoolean; - } - - public void setSomeBoolean(Boolean someBoolean) { - this.someBoolean = someBoolean; - } - - public IndexedTestBean getNestedIndexedBean() { - return nestedIndexedBean; - } - - public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) { - this.nestedIndexedBean = nestedIndexedBean; - } - - public List getOtherColours() { - return otherColours; - } - - public void setOtherColours(List otherColours) { - this.otherColours = otherColours; - } - - public List getPets() { - return pets; - } - - public void setPets(List pets) { - this.pets = pets; - } - - - /** - * @see ITestBean#exceptional(Throwable) - */ - public void exceptional(Throwable t) throws Throwable { - if (t != null) { - throw t; - } - } - - public void unreliableFileOperation() throws IOException { - throw new IOException(); - } - /** - * @see ITestBean#returnsThis() - */ - public Object returnsThis() { - return this; - } - - /** - * @see IOther#absquatulate() - */ - public void absquatulate() { - } - - public int haveBirthday() { - return age++; - } - - - public void destroy() { - this.destroyed = true; - } - - public boolean wasDestroyed() { - return destroyed; - } - - - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other == null || !(other instanceof TestBean)) { - return false; - } - TestBean tb2 = (TestBean) other; - return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); - } - - public int hashCode() { - return this.age; - } - - public int compareTo(Object other) { - if (this.name != null && other instanceof TestBean) { - return this.name.compareTo(((TestBean) other).getName()); - } - else { - return 1; - } - } - - public String toString() { - return this.name; - } - -} diff --git a/src/test/java/test/interceptor/SerializableNopInterceptor.java b/src/test/java/test/interceptor/SerializableNopInterceptor.java deleted file mode 100644 index c7b2acf82fa..00000000000 --- a/src/test/java/test/interceptor/SerializableNopInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2002-2005 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 - * - * http://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 test.interceptor; - -import java.io.Serializable; - - -/** - * Subclass of NopInterceptor that is serializable and - * can be used to test proxy serialization. - * - * @author Rod Johnson - */ -@SuppressWarnings("serial") -public class SerializableNopInterceptor extends NopInterceptor implements Serializable { - - /** - * We must override this field and the related methods as - * otherwise count won't be serialized from the non-serializable - * NopInterceptor superclass. - */ - private int count; - - public int getCount() { - return this.count; - } - - protected void increment() { - ++count; - } - -} \ No newline at end of file diff --git a/src/test/java/test/util/SerializationTestUtils.java b/src/test/java/test/util/SerializationTestUtils.java deleted file mode 100644 index 132bd33d4eb..00000000000 --- a/src/test/java/test/util/SerializationTestUtils.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2002-2009 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 - * - * http://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 test.util; - -import java.awt.*; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; - -import static org.junit.Assert.*; -import org.junit.Test; -import test.beans.TestBean; - -/** - * Utilities for testing serializability of objects. - * Exposes static methods for use in other test cases. - * Contains {@link org.junit.Test} methods to test itself. - * - * @author Rod Johnson - * @author Chris Beams - */ -public final class SerializationTestUtils { - - public static void testSerialization(Object o) throws IOException { - OutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - } - - public static boolean isSerializable(Object o) throws IOException { - try { - testSerialization(o); - return true; - } - catch (NotSerializableException ex) { - return false; - } - } - - public static Object serializeAndDeserialize(Object o) throws IOException, ClassNotFoundException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.flush(); - baos.flush(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream is = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(is); - Object o2 = ois.readObject(); - return o2; - } - - - @Test(expected=NotSerializableException.class) - public void testWithNonSerializableObject() throws IOException { - TestBean o = new TestBean(); - assertFalse(o instanceof Serializable); - assertFalse(isSerializable(o)); - - testSerialization(o); - } - - @Test - public void testWithSerializableObject() throws Exception { - int x = 5; - int y = 10; - Point p = new Point(x, y); - assertTrue(p instanceof Serializable); - - testSerialization(p); - - assertTrue(isSerializable(p)); - - Point p2 = (Point) serializeAndDeserialize(p); - assertNotSame(p, p2); - assertEquals(x, (int) p2.getX()); - assertEquals(y, (int) p2.getY()); - } - -}