diff --git a/.gitignore b/.gitignore index c79bac7342..c9e0aca55e 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 71739dc400..65db556fab 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 540694d2ee..8c0a1b4245 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 ffe4f87342..097e65ab93 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 0000000000..1d6134ab59 --- /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 5bfccb3d9b..9cef804165 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 0000000000..f5df417ad2 --- /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 4bbac88504..a2f752e726 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 11ce95641f..8c99e5a179 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 8fe320c032..8959552925 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 f79397741e..46362c2b13 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 404a1d0845..8c38ff4b81 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 37f9cb7500..17f7645e7c 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 aa49595d51..b576aa4b21 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 0ab9dd6b9b..ffefed7eee 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 36ac7ea99b..6ba69a833d 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 cf3c87d2d1..fb8b08e220 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 af2fb26fc1..15526c1fc8 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 05addda78b..489e7beb82 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 6fb4d88497..7b7c1e7864 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 e49c697f3c..935f745de4 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 53f308b332..e2eccfac57 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 bd3185952f..9633b4b33b 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 2d09d4f690..248e2f6416 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 a97872ab32..a8bf94dcae 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 4416fe866d..553b0e9d6d 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 3c16911977..2f1e7aaa6b 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 0ef76eba69..42a2c6f729 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 7f869ed80d..fd5b0d64c4 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 16308507e1..2155c81cd5 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 c4ddcaab9a..7e101ea57d 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 49fa6da5eb..70b6575076 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 8d80da138c..3463e8cc61 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 c8329e413a..4505e6f330 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 3838c7bda6..27618c9b46 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 a2e8a6a64c..fbdcf09313 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 4cc0b44f74..fa470759cd 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 3316e76582..40049e978e 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 58173805d7..7f550a333d 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 1ae00d2421..adb8c4db37 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 92721d5c77..5b3f48bce8 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 62d1414717..9eff81682b 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 a85a138ca2..36bf115105 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 3aefe815c9..ccf2aa610b 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 fecd7b2e2a..81a6c2a3ad 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 bf1856b6a4..b9863ab67a 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 c4401b17cc..1c45cbc2f6 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 5bea20f88f..bb623b372b 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 8478f7390d..ef9014a144 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 9f70ed53a0..dbfcbd380e 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 d05e67b5da..0dd176354e 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 e8decbf469..6e58344f80 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 180ea636a3..85e59523a7 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 b28e6d3e03..374e40290a 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 dc3b4f9ea8..13be36d8f3 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 6d97412f9d..3da1f13f0a 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 b250bf747e..611376efb9 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 9d19ec544b..73ff37197c 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 d9e5b43615..aa3d70d11e 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 f97d8230eb..9f75cba9be 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 e1cf5f65f3..10f6327e5c 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 797b5f6698..0d2daf364f 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 ffc317ce37..3c822cf2da 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 63d8711269..e5f89177b6 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 33e09ae1d6..26a45a4657 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 ca61dcc557..13a86ecb89 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 c002e43a51..80c6690564 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 595eb35c65..9a2e2298e4 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 a602cefe37..5ac4ed7f66 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 defb0bada9..90eeef7b48 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 e8decfcf94..fc7ae7b878 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 4adef07407..e1867efd7e 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 257f2f2190..a369f56c82 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 5062a916c5..c9ac099b48 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 b1f5a6396d..425c3f87c4 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 1c69281c70..9eacf479ba 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 07257fecb7..a921e6e509 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 9b6dfa3fd9..9f8f698faf 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 da5f7025ed..136f004586 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 222a63129d..6fc3cdef5e 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 3aebd50484..83d7b8e851 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 386d3a75df..687a6d5f8b 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 32f3d2d44d..69b0bd1cc5 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 c0e840b055..e95e513caa 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 c9aae651d5..035442282d 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 b48ae0905e..88a75e877a 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 ab056cd688..e417f92df0 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 7b517282c8..e91f9db74a 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 f84bf4f55d..953a751d32 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 d48716f9d0..90034eafbb 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 0adb7d7e2a..ce350d651b 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 5acae865f4..67f9638ce4 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 510b6d8da1..c1ef00cbe2 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 9667931793..d972b95cf1 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 82db223aa3..0159d307a1 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 438fa3cff7..7c29c775bc 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 4298008d9b..8f6f3ee479 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 93228b1af7..a5d1f50805 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 4f9b95a919..0a2c2ec8e9 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 bffad2c4d1..a4ce58d528 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 9d25008e91..c5443e7dc3 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 8f14116ac8..5ff0f9cba8 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 fd3f537560..4362c5de10 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 ec794cb5fd..e70f502fd1 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 cc07afc997..95009495ba 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 9e46d230cd..4b7046e359 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 2193d8b674..34bc7b9b74 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 e59267d30f..fdd0253d6e 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 938a7cb742..3715a9ca70 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 dc48762686..74a62a7ba9 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 c0fcb7c791..53494a14ce 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 4b362c8407..8dc2fb0a3e 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 4abb43c8f2..1dea2cb113 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 1ec8a01229..b537a6ab8e 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 008e9105c9..4de481fcba 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 1324847e12..92fb3c4552 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 f9a7e33e5d..e1aad6a170 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 64d6651af5..f4b16915f9 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 ac0199a69e..5eeeea60d6 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 53211519e3..c27d1872cf 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 6a6a70c985..9427a647de 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 e70530b098..35d765c297 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 1279087de1..c8807f7639 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 82409fc009..071da29247 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 75d56678ad..be8b5bca7f 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 ddbec48ffe..69389d0bf5 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 ef939cfb55..c2f85b5881 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 267083cc70..2bfbcb1c32 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 5cc14d909b..1edb2d746b 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 955f92ef03..461252e617 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 27209a18ac..6efebf1106 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 9bafe1bd49..acdbbeff88 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 8a2d9a6a27..3192fab5fe 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 86259b7abe..6fdd24ef92 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 ccb8b56637..91e1b72ee7 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 096fd2f46f..47a35f756e 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 f6358585e2..193259ba8d 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 37f5b99d46..dcb6108e87 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 ddaad78704..c671f024f5 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 ed372d085e..81642f6b2e 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 911eb837f1..14560404c4 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 844073a5ab..cd2dfb0c0c 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 688b891330..f3801a79db 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 865e4fa699..7aba951ee5 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 76c17e3337..f2f894dbec 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 82d16e7fd4..187544e6d8 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 0d523ba87e..5efbb2f893 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 73ec428395..7662195c0f 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 2b09c8a30d..429350b00d 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 37140304cb..057ad77309 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 e72e475abe..551756eea7 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 d9769685c5..2b92a5c661 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 c3e1f0c120..13635c2c6d 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 c10c50ddf8..088ba138c3 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 7ad0b7c768..0275360441 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 f6f82fb412..273869e8a0 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 ebb9f03c43..66d5e0f739 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 1627f57d69..966d289eb1 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 472b495a50..af55e122a6 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 d6c24cd0a1..16d6f0e9e7 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 085e8c5d9f..f01d1bb9c6 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 6b7d3ff096..f1ff305aad 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 de10e14b42..08d95808ed 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 939493b2eb..984f5ada7b 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 de575c8842..fec13dbbed 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 472b91f718..cd01ffd532 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 7654895cce..850fbc15d1 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 fcb34b4012..7320dd553c 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 40209c7d7b..9e0b3d14eb 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 fc5268c840..e2abdda799 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 9de8964805..eaaf2d8d42 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 f5c4a8edca..139ef6c415 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 1879f8a4cd..11b127d0bc 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 814b902540..d9d43527de 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 f8999fe674..7f85602888 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 ceae4f577e..633705f068 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 9b3aaf6d9a..db2751f513 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 1fe27b3dfc..77aad8e9ff 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); + MethodInvocation methodInvocation = mock(MethodInvocation.class); - Method toString = String.class.getMethod("toString", new Class[0]); - Object[] arguments = new Object[]{"$ One \\$", new Long(2)}; + 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!"); - 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)); - - 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 cd7f8b8bda..d0cee0780e 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 c5f6cf8fe4..3b0bd31e53 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 bea92760ce..5f00163fb5 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 72e2cf3693..5405d09831 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 5cc35f10ec..bf2c45fc2c 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); + MethodInvocation mi = mock(MethodInvocation.class); + given(mi.getMethod()).willReturn(String.class.getMethod("toString", new Class[0])); - Method toString = String.class.getMethod("toString", new Class[0]); - - expect(mi.getMethod()).andReturn(toString); - expect(mi.proceed()).andReturn(null); - log.trace(isA(String.class)); - - 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); + MethodInvocation mi = mock(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)); - - 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 7845f1268b..6efc651d27 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 80f62da86b..9ec42626db 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 83bb13216e..84c4decb19 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 b230ed7260..03cf0b719e 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 6b86cd7232..01be11617e 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 8df910eecb..51f18dde21 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 1c250e966d..35828d28e0 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 41c3e2dd54..513885ed21 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 e6c08c08f2..be21c52d2a 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 f74bb4c61e..1872a457f9 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 ca4f8839c8..0848ab58a9 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 a55b083a3f..8f06791335 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 a36856ddd3..5edde823db 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 e796719866..b24dccc2c9 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 1e3ae07f26..cbd660d7fe 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 bab75b7a3d..4a3d04cbd8 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 75be80560e..07e9e4d3d9 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 269d585e9d..af6b44c0ca 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 04cc623d30..33f30be78c 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 be9b929475..a4bb0c2554 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 d6dc8f426c..2a584f9a5c 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 9bfe5dfd96..f633c66d5b 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 74b1fe0ec2..10ef6a35ae 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 d08d6f5357..b5bb4a1751 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 3fe1c3ca70..91e1d087f5 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 b271b1f556..961269efde 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 - + + 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 2519e89f82..b8976f1958 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 ee0913a114..9732cfa4d9 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/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 src/test/java/test/advice/CountingAfterReturningAdvice.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingAfterReturningAdvice.java index 2e9aaa5a15..5b206516af 100644 --- a/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/spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java similarity index 89% rename from spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java index 7a7baa3ef2..2e34d50262 100644 --- a/spring-aop/src/test/java/test/aop/CountingBeforeAdvice.java +++ b/spring-aop/src/test/java/org/springframework/tests/aop/advice/CountingBeforeAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 the original author 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.aop; +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/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 src/test/java/test/advice/MethodCounter.java rename to spring-aop/src/test/java/org/springframework/tests/aop/advice/MethodCounter.java index 8c29886a3d..931b0ec668 100644 --- a/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 abe79f9dc3..96edd1280c 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 284cfc5193..0fa9d4b4da 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/spring-context/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 spring-context/src/test/java/test/interceptor/NopInterceptor.java rename to spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java index 79158e74ea..d152719261 100644 --- a/spring-context/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 3b8350e4c8..8c72878c9d 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 83761c2d3c..de4dfecff6 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-context/src/test/java/org/springframework/beans/Person.java b/spring-aop/src/test/java/org/springframework/tests/sample/beans/Person.java similarity index 77% rename from spring-context/src/test/java/org/springframework/beans/Person.java rename to spring-aop/src/test/java/org/springframework/tests/sample/beans/Person.java index a78998ad5d..38e0903e2e 100644 --- a/spring-context/src/test/java/org/springframework/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 org.springframework.beans; +package org.springframework.tests.sample.beans; /** * @@ -23,14 +23,16 @@ package org.springframework.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-webmvc/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-webmvc/src/test/java/org/springframework/beans/SerializablePerson.java rename to spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java index 13c2c5447a..2730d50c8e 100644 --- a/spring-webmvc/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 211e101023..45546b4cfd 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/DefaultLockable.java b/spring-aop/src/test/java/test/aop/DefaultLockable.java index 82c59d8bc5..1fddaca9f1 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 135a991424..039b06e8a7 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 745b7289cb..0000000000 --- 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 1dc341d427..0000000000 --- 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 cee2420138..3896f2dc7a 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 3b306743b2..0000000000 --- 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 8793fd3f94..0000000000 --- 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 8cb213cefe..0000000000 --- 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/INestedTestBean.java b/spring-aop/src/test/java/test/beans/INestedTestBean.java deleted file mode 100644 index 87bfc26773..0000000000 --- a/spring-aop/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-aop/src/test/java/test/beans/ITestBean.java b/spring-aop/src/test/java/test/beans/ITestBean.java deleted file mode 100644 index 74f371b054..0000000000 --- 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 a630f8662a..0000000000 --- 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 8f14fd61a2..0000000000 --- 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 4d9355f616..0000000000 --- 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 132bd33d4e..0000000000 --- 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-aop/src/test/java/test/util/TimeStamped.java b/spring-aop/src/test/java/test/util/TimeStamped.java deleted file mode 100644 index 484d5dda44..0000000000 --- a/spring-aop/src/test/java/test/util/TimeStamped.java +++ /dev/null @@ -1,34 +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; - -/** - * This interface can be implemented by cacheable objects or cache entries, - * to enable the freshness of objects to be checked. - * - * @author Rod Johnson - */ -public interface TimeStamped { - - /** - * Return the timestamp for this object. - * @return long the timestamp for this object, - * as returned by System.currentTimeMillis() - */ - long getTimeStamp(); - -} diff --git a/spring-aspects/aspects.gradle b/spring-aspects/aspects.gradle index 34cadf3538..0432414467 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 5abf0e2989..760cea9dc1 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 42a27944d4..390e1dc989 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 0a7303eca8..5cd0140d46 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 06e32f4bfb..5313df9ed1 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 9aca558660..869b7a72d8 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 d91b05d117..351c11d7d9 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 ca4d14a66b..a9a6da82e9 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 0687b3c54c..be3957a3a0 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 ec6bda35eb..740ddaddca 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 aa6ad3a9cb..e373607d55 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 56bf082939..1c50c64bbe 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 07aee0364a..913d147b3e 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 491f666992..3594725aae 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 3daa476116..ed0956ef9f 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 36ac0eb2cb..1fe8de9030 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 54c30a1af0..582de64462 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 d5667cd155..e6f8cb8459 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 374bc00909..0758d3a403 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/Colour.java b/spring-aspects/src/test/java/org/springframework/beans/Colour.java deleted file mode 100644 index 17fd24fec7..0000000000 --- a/spring-aspects/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-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 0940539f54..0000000000 --- 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/IOther.java b/spring-aspects/src/test/java/org/springframework/beans/IOther.java deleted file mode 100644 index 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 ddb091770e..0000000000 --- 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/NestedTestBean.java b/spring-aspects/src/test/java/org/springframework/beans/NestedTestBean.java deleted file mode 100644 index 0eb8df5c8a..0000000000 --- a/spring-aspects/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-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 7842bbfeac..0000000000 --- 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 b92077767b..6ff04cf7b8 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 16e2522d93..1c678ba6b1 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 47d3fef664..c5cc835a3d 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 89aa3964ea..bd6439bb54 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 b3f9d4937b..0000000000 --- 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 81a7793fc8..c85d84d083 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 a6d1b4f7bd..52a1b4265e 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 09e2fc4c4b..81dd758d19 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 33cc40d0a4..6d83d91c02 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 13364bdbd1..b4cc29458b 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 3bd1741699..5a531301c9 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 946e33aa01..d4b3206bc3 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 a3b15c59c6..ca98b77f92 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 9e13013bb1..a6a62cdbb6 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 6bfe60205e..b95ee6b807 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 0c0b3cb81c..0000000000 --- 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 f718e09385..938265b97c 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 18763dcc74..07abf06c64 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 7e8ef63d16..44c3ea36b3 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 437a1a4f07..3631b05550 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 6af0f02db3..0d08cdcb56 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 407a5e2e99..70892e3949 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 93bd225f7c..bca935ce3f 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 9fbac3fef8..ef170a1baa 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 6890b9e706..f806b9f6a5 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 ca62f6fa3c..c683f50ab8 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 70b3667bee..6b6229d416 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 070fdbf8de..628ee8e78a 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 2aae901c72..efbed41edf 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 fc44cd572d..5151193e8f 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 76c295490e..54467cd3ea 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 7e46211922..183ffe4e2a 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 d1d30a5e2f..84fe47bb23 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 20260432a2..0f0c593162 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 51ff5161f1..96db41d162 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 dc142e0f99..cba64d94f8 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 467c595ed6..e079bb0f56 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 7a21fbf0e1..390b3f8a12 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 cba93573fe..2001d09eed 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 2a5042c94f..de734c28c3 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 6ed4d3c578..f1ad856b3f 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 b2eafd4433..68bdde7412 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 80168252ac..621bae5325 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 9fa559a8e9..9da1ed0658 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 9768d25a26..1919a47122 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 c14de75ed1..549334393f 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 9eb3af78af..f76df2a2d8 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 6b3aa68b6d..81854100d4 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 9584b49107..82830a198c 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 f08d029108..feecaf0e59 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 6ecb77e16d..8af2c77ff7 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 bac7fc93ba..d1b7c48130 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 b27aa6f432..ab584354b8 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 bd5998cc7f..2ffe909a94 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 cb270e619c..480ff82857 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 9e3d1a5906..050444bb4e 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 1ba73bbde0..47a2ec8c14 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 f4b5be3df2..b935abfbb4 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 0debc41c7d..2d18e67b1a 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 1a7df36df2..a283217c24 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 aaace2cf34..c52d0ae766 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 46a99fc5a2..f7020130e8 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 43b2bddc75..af47ab3f80 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 b853cec073..3b2914e6c9 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 e620437b53..772da666e2 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 536c2e695c..5554afc2b3 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 d16bd68551..84763c37f6 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 791b30557e..9e8e0e2073 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 d48bdba6d7..7e6a347afc 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 420aefb2c0..365bf99bf1 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 6f8d57ff85..5f5b643f15 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 78640789b0..40f807dd54 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 a8e20e049c..143936f7b7 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 f700515bec..5a455420d3 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 ef2e40e34c..b917de2a17 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 efe23a7479..35c3d3f51f 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 2fb454543e..d2a72bc368 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 00fb3e690b..1dc3257819 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 6b439391e9..e97329df74 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 811898742d..7eef126d8d 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 205fed0aeb..dc594157ae 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 46ef046864..bb342c7854 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 5939524eea..5c1ad4b751 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 2040f6f420..e71eb1a899 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 4102753bfc..b0b4142ec6 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 d14e2f3c0b..c9d442c335 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 47db66447e..8cfbb7645f 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 52d03678bc..9739a62f8f 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 b396d2367b..80c22d87db 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 e7c232d97b..bbe7ddf804 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 ebaa3a44bb..d0e93c8b0c 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 956448d332..2dc8ec6fae 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 4d013fae16..1e59e7d134 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 9eff79944c..03e5716fdd 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 df8cb8447f..76de13907f 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 b0583f5886..31edfa9144 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 7eca9097c1..f508e3fff1 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 299b588fc6..736868bed3 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 b544f2f1e2..1615a8125f 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 a202e5a958..c1fd6a8e6b 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 8032c16335..b9b822e2e2 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 197c2ad306..bf9474138f 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 d9c775743d..7477e197cb 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 55ab063ef6..836098ff8c 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 7e299321f0..8777fa61e0 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 1fb0c2005a..e8f2b72b6c 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 2d94806085..79d0234c37 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 fe77b35478..13f5a9be56 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 3f79e9ff5a..e4f27fec8b 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 d37d64258c..828cdc8257 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 ff5da625e4..d281d86cd4 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 7e3d6b68a2..2d01b986a1 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 0f16202654..49c5f9f7b5 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 b5a99a8890..72357a8cc7 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 4462ef760f..76f3a2fd8a 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 e58a4276bb..ffc1cb2a1e 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 71a155efe4..9ff54665c7 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 6726bbac41..66dfae23d9 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 4f9882f293..3c4b68e339 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 f11e44e4f9..4611365c07 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 42f1bc82e0..9f78a2909d 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 0bbbb4deee..649b17123a 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 6d602ea28a..2f940269eb 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 4da479b234..e21707376e 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 88c2bcf9f4..0b0fe96658 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 615839c213..b07e211d16 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 964f7d83e6..6846390e1b 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 3906928b5f..cd2c41e115 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 6ea25abcc6..f8ffd5798b 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 2b354882df..6a2cb27e49 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 542f1d5b62..db7ccda800 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 813e8d4b6f..f5d1e77781 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 4a13bc1b2d..aa9bbe94e8 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 fd50469024..326e1fb58c 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 f14db8c8bc..330b699096 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 57f4ddbb80..04e96a7578 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 a09d69dded..b03ca67dcd 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 da0103b654..161eae7e99 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 d3206fdc99..82fddd2106 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 6be1f2399c..884ee9c3d9 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 9c1e9292e2..560943d309 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 bac4697f18..e7e7ec7dca 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 bac7a2a4fc..5c9aa55011 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 e4459d0296..4529b71441 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 b947affe43..95b444721b 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 7efcba3204..654cadc9fc 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 c29fbaaa7d..ecc984a7ce 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 d336ef8855..fc64caf648 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 0fa1b59046..d3c630491b 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 8927b9b073..7b7822f0df 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 261ccc0416..e570a24c57 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 6efe58e1e1..ac001c639e 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 7287049bc3..edb954ae7f 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 0e129d6e38..e46145f296 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 4ec68342d5..67f32d5d2c 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 ab648bdbb9..c306cb70bb 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 9782f086be..91c94990cc 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 99bd416cb9..0bfcb375da 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 f86dc30f70..ec5d368740 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 b1713f24e8..c5e4d9128a 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 ecf5980def..37ef1b4090 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 359975c1ce..de4c3e695e 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 a833a3c514..d7fcfc9e4d 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 c6d9f5140a..9900aa1651 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 4450b30bd7..07bfe7afa9 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 b927112b63..874eeaf034 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 348f4f6dc4..a7ebdb9c57 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 823e3015ce..8da64b6070 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 12e95b0b42..d8ccc41050 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 63e5a39f2d..b7e440d647 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 ab933ffc9b..a7ca4fbd54 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 259c592ef7..27d861bcb8 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 064ffd30cb..39676dc24d 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 c819bbb7a6..16b58500bc 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 cba28b0641..ceec57615e 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 2ff16bbbae..fb6889226c 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 6e51f97fe5..aee26b0ded 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 2c87af1f7a..e45a34149e 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 42420f9fd0..68ab64d576 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 59dba77c36..a6214171a5 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 433e126749..5d5eea0de1 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 934fa37bb3..985ba1723c 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 b78db5ea5e..cbf10da7a4 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 03e1d9c8f2..36718b20e9 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 81134a6931..14871687de 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 3e3072f0ec..c946c621fb 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 2fb351b55f..a57b69eaed 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 982f9438d6..92f47df1f1 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 efa3908b2d..220f381e88 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 753ba19c5b..25af77b5dd 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 886a1075c9..0c4c971fea 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 a608128bee..977c2b0a6c 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 19f8bf5393..24467400fa 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 716872c5e2..c8875b388b 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 f05dd43961..da9c1eea94 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 2059c660c4..632f60127c 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 84febdf01d..f5ac6d6a48 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 be8bf5c69c..c5f9755d85 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 fd938eef80..3662903df8 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 486d13ed74..a9ed9984aa 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 89490a664a..2c64bf5252 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 13a81da809..4d7ff96013 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 950f22cb06..afe74eac66 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 9ad02dade0..406e3b6faa 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 3483077e85..94dd439bfb 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 d85622e12b..97e77c5740 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 e62eab786e..ac47c4efea 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 3ccc7f167b..b29eeca061 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 4132763825..51ea30bb54 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 fb6831eb8c..9d53409e73 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 c9966af03b..73bdeaee1c 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 3946cccb25..8c7d8da1e8 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 c1f3b5e3ac..3d310bdc68 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 d420e860c5..9d4e022a64 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 4675d22dbf..a4fe92acc9 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 2a0cf025b0..95c3fbb8cc 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 5e05fc91db..aaf6e56092 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 2b114defc7..bc53e02ae2 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 dd52eea7b8..7c728a55a2 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 bf756e1bbc..71586ad8d3 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 2d12405074..c5fa5b2858 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 ff33aa0212..28f8d65277 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 636fbda545..553f9cef46 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 3ba946c962..27d839a891 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 d52f73e510..acf9f65a05 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 5b4c200f58..6f2704b1f7 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 c1e5f9acfe..62c85b60b2 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 15dd2bcf93..e422accf4b 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 a24c78d989..7181f0b8a1 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 4f96efc8d3..4fbb7b8cb1 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 fdaa110f36..a18a25e05a 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 e92f28b816..c01585a153 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 265fea19a6..252ee0ddb8 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 0e31d83c10..65e6debd15 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 6ae7cf7400..4ed025b09b 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 b9c8625b2f..2e2d9fd435 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 0c328ce481..66226340aa 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 616b025ad3..a35b1e2948 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 e02b77f2a1..dc56161776 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 e4446440b8..cc43afb4da 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 b33b3c9c65..490aab8790 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 5a564500eb..ce21ee9095 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 c0c65711bc..63e49fb18b 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 1f080734bc..1212913cb1 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 115f618a00..f7ab438e76 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 f6f4f4a0a2..1c1978456c 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 14b272ee0f..0a561dd336 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 5460f8bd01..e9ff4c6a31 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 d0c5227844..c2cc486e9d 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 d5e4441f20..20bdd50654 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 3ebe8ec705..622b7fda5d 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 56b9b1fbc6..fe85b49123 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 6eecc322e8..48bd97d15b 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 cb365b39fd..11aed3fa64 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 f01cc9b303..cab03e3823 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 e0f0875403..f9f1beba04 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 36745a65c0..ee00efdec9 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 22dbf41ba3..22972e96fd 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 3442e720d4..d62e43d060 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 72a90473e2..195ad77529 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 0cd040b469..5c1368c461 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 6c9d11f210..3e9a6577b5 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 cac02472ca..65e380d3e2 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 1d07565be6..0b65929fdd 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 0091998af7..cf72ae3a95 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 12f80e38b7..4df91dc136 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 b429cd8e4b..41bc80b8ab 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 f648206980..87a4ec27fc 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 62f379ee8b..2c371011e3 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 cf51e1cdd0..22131ab9ad 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 2a72cde701..625e8c7085 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 eba0541e09..4510487801 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 403b4735bb..4c1ac580bb 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 7c97931666..ae6232f40f 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 32e6134823..cfe24570a3 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 55f7f920f5..a9294e05fd 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 0f3be3b006..3a88ab9fa8 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 8b7d179e9e..082fc418b0 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 27ea4461be..7b02d0bed2 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 8662e52c78..d79ff06cbb 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 ec52dfaa8c..6b396933ae 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 fbc40ca302..a0d4f722e1 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 b897d98858..8e53cee293 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 e8bf2b4469..12a2fb0860 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 bd2d837038..bd92b0c391 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 a9e9925d51..ff691358a4 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 696ab6c0af..0d67448bc0 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 8ee4c39d63..a5ef87cb1f 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 52eb2b2938..fdf65f88d7 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 6e3f1df422..6c8872054e 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 b943361f1a..9a98ab4c15 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 a6feaedcec..5b9ddc18e6 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 bc4e58426f..62c5962f86 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 ed8167b112..231ca93a3d 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 8344d0b529..17552b1d59 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 173fe92642..601afa44fb 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 a7e543780d..45e89564e7 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 07d8371b6f..849da031cc 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 3345bf52fb..3bb04d4c59 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 eacf97579e..6960653ea6 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 49473c6dc5..c5da99f0e4 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 22d4fcb30c..2fd60f7a0e 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 eb936a57ef..2b2ee692e6 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 9be6a107f3..a66734f625 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 4bf47d014a..f2d77a2b68 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 c5a230a2c8..d205291620 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 e2baf25530..b1cc7ee18d 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 7050c656b9..9e5bd8911a 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 34bfbac3b9..320759d1b8 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 2be0637cf6..8779f9ed5e 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 c6f32d1f91..92484b7d1a 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-context-support/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-context-support/src/test/java/org/springframework/beans/Colour.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/Colour.java index 17fd24fec7..a4a7d9740b 100644 --- a/spring-context-support/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 5065764765..e5f6947de5 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-core/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-core/src/test/java/org/springframework/beans/CustomEnum.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/CustomEnum.java index 1e43492191..66a863772f 100644 --- a/spring-core/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 7387cdf600..b17d1028cc 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 fbc9fb5090..91416208a2 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 6c83aed209..cb5767eef5 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 75b585a498..dc08778c53 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 12ff808dc8..c192382a1b 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 43b6465df0..b7465b1bfa 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 94% 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 021c0cd1c1..a0fee60195 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 1c1708eca5..4639050b2a 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-aspects/src/test/java/org/springframework/beans/INestedTestBean.java b/spring-beans/src/test/java/org/springframework/tests/sample/beans/INestedTestBean.java similarity index 86% rename from spring-aspects/src/test/java/org/springframework/beans/INestedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/INestedTestBean.java index c5c4ed5e67..58c4b9d502 100644 --- a/spring-aspects/src/test/java/org/springframework/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 org.springframework.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 e5b576de3b..694f32d275 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 526c3dacfb..b467348a93 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 bd2a72662f..d319bbd0ed 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 145413deef..1a81d10340 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 1dcc1aaf72..cc83d69d83 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-context-support/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-context-support/src/test/java/org/springframework/beans/NestedTestBean.java rename to spring-beans/src/test/java/org/springframework/tests/sample/beans/NestedTestBean.java index 0eb8df5c8a..844c5ea692 100644 --- a/spring-context-support/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 e739da4738..489c933509 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 a77af92d12..142a5da2d2 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 eb78f612fb..61563f0dd8 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 82871af752..9477a5e548 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 b93bf96be3..cb276da9cb 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 b9999baa5e..b562f569fa 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 0000000000..575bd1933f --- /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 9ae4f54ec2..0000000000 --- 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 5be4dfa761..0000000000 --- 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 87bfc26773..0000000000 --- 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 9397b17550..0000000000 --- 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 a630f8662a..0000000000 --- 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 7e8089e6e7..0000000000 --- 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 c137adffe4..0000000000 --- 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 5beaf6d598..8d5f74fc31 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 c33326c857..4d3723c7de 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 be6700e142..d0f1eea326 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 12dbc60792..2edadb511e 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 6363230a06..2fcb117954 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 3f32de8aee..a2e966aab9 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 e32686f27f..9b93a16810 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 2883bd2383..089517cd42 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 22168ca8c8..7e262a0a0d 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 a614172a89..d8fc1db88e 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 44bd0b92dc..974ae6c3d9 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 7cd04cc145..8a31ff8696 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 f97701759b..4ff20b3d59 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 33cbb8dd8d..7802a4c935 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 f245c964dd..d961644301 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 7c10f7a32f..1773a1c9c6 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 e44a8c961c..8dd70708d3 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 d82595bac7..384171fdc0 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 9d1d1f7adb..933e66b7d0 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 8426c5d95e..25f20439fa 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 fab962d4dd..3cca869dbf 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 324fb483ff..20aa0f5374 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 7cb0723a4c..05c47afa53 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 f7474155f8..d4eb9cc604 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 bcbdd3cfb1..b254dc9073 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 de58b7613a..b6b47f1613 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 5b77c3825e..b1e99b5591 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 d86944fc16..4820c270a2 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 fb44ac572e..6b87d7bb99 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 1abeaa6a4f..7cc61122bb 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 f3ceba872e..ac683c5243 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 057d6f78e2..2cf0b89671 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 bae5d7fb96..7372f62512 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 ed9151bfdf..257b15b78e 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 840320741b..47a115e980 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 dd6417b182..9b0f49fc34 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 2e46fa1029..35b3ace313 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 25931464c9..c3e603882d 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 2eae87785d..8167f6a709 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 eb1d1b6087..c5e1c070b8 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 0971d96d54..3edec2aacb 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 1da0bb9b10..0a53406577 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 701b5c6ca0..d79bd3f69d 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 2b1f04a48b..c9664b28f8 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 e0307f6e25..6e5189e3b0 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 7886278857..b2d61536da 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 a81e39c83f..5eba86a105 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 17940bece4..84db22173a 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 06b273eb24..b35bb59ad9 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 c6811478ae..a9d837e7da 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 d4f050e8a8..574c7695e7 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 acc1e30b21..b2e7a85214 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 0ff54aeba0..2e81188968 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/INestedTestBean.java b/spring-context-support/src/test/java/org/springframework/beans/INestedTestBean.java deleted file mode 100644 index c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 ddb091770e..0000000000 --- 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/TestBean.java b/spring-context-support/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeac..0000000000 --- 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 5cb1549832..63fd1546a5 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 8ea783e17c..646a679717 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 3233099bac..4b397425a5 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 b0deb96a6a..97eb3e7863 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 a95a2408b5..0000000000 --- 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 ca7bb45d65..8ccc9c5b69 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 0607947d6c..ca55ed9a0e 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 7e22fe88f7..7b9ebb44aa 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 5035789d1e..dbfa1cba84 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 7116955e82..716b840ad0 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 cda9352b52..7c62a21af7 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 5ff3aaf9e8..3b687a86de 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 2565e481a3..776e9f492b 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 594af464c0..c8a20ef17e 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 1068bb9126..2a53416c09 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 464a440af6..e20d12cd85 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 d79e741cff..a7eea9b5f9 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 3339abe70e..d03b98774d 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 b1d00e13f2..cfc101e39b 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 62e1f9729b..13f1530b31 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 d344a6dadf..965a44bbe7 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 980464d36f..777bd389b7 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 b4b84d86d9..e815988e96 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 c13e5902f3..cf9edd7101 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 4a608ec060..b39ae88590 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 8372bb00b9..54b66347ad 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 2f9d9d5cc8..57df5694c8 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 9b55072489..1ac558f538 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 f166faac35..5fcd8a572d 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 9b6917c580..b3f9450f98 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 bcb433f5ca..2e556f5187 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 2f67592b0f..a13dfdd193 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 03a8a1306f..04fda90705 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 b095d47d98..1a758b60a9 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 256ee62064..c7ad16ac50 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 822f3667f5..fa84458568 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 abd6823838..8db8dc4dc7 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 b8f97520a4..d18b3970d2 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 d314430eed..5033d7dbb7 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 4e089149c5..98d95a8cef 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 abaddb72b3..ef32c7b6f7 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 dcaf8fc14e..2e13855d4a 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 ac51785295..155fefbbc1 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 6ace399333..2ca6ea2f85 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 b21e35e772..d3848ebe0a 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 a7f44dca16..768c963d3b 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 547f7519ee..44ba2589d8 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 5e8377c999..138f45526c 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 3f88a900db..1e7681aa0b 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 a2ce34e6ad..e88b26799c 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 a872b76b78..ebee90cc03 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 6930177ded..f81020673d 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 32bb029c0a..95b40263ed 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 b05eeaa4e7..e668c4e736 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 a1e4fdabab..7c3d8bcc11 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 5384a333be..e120f667fb 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 e026e5c98f..03fa94a525 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 4dd8bce351..8dc2c1ffb3 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 6c8cbc99d7..30aad8a078 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 4e82ef9cdb..495f3c7025 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 6c87480fe4..0f67d7aba6 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 58ac5f4254..d2c704f1a5 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 c80aef379b..1af0997e64 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 652205cd52..8a12977c8a 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 e3332791d5..3d555779e9 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 789130620c..7a27feafa2 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 3058f699aa..c824d4c917 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 c459d22a9a..ce39ce9a6c 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 6bcb775319..de6a45b1fe 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 b5841ca19d..2e106d8ed0 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 81ea064909..6b616ace25 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 eeb2191cf7..c5caff9ef5 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 0b1669a407..30469ead50 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 7349999328..89d5067451 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 801ffcd042..aaa6f7adff 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 26bdd8b79b..ecfb7baa98 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 e87447b648..bbfc158cbb 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 edf66f329c..5f4e2770b7 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 bbd9079b26..49716db834 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 2f91d248a4..ee013df6cb 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 0a620e9e8c..fb53938011 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 83d26b13a7..a1bbebc446 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 b754a738d1..96059b463b 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 5613c74eb8..eb6d3f130c 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 276a509305..ed62cc4e10 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 c852839858..ce2d5d85a8 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 55de49ff82..e4f1076ea7 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 c15a36eb8c..f80fcd6242 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 f1f0a76bfe..85ca71044a 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 ad3c1d4137..da34f935bc 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 00c14d8a7d..2108d9f5ae 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 a86ccf2c5f..2dc19dda74 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 8a4422d93e..94316c8f6d 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 74b24b9b90..166f1deb3e 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 9e143d576a..86907d33dd 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 7cf9200abc..3d15f1035c 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 b13ba8bd63..e35bd31fcb 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 ab17d2a991..a421f0418e 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 d5568e3b8d..92b997d615 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 2ad5bcf016..eb28f67ddf 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 0777391ad5..a128608d84 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 b5e1cd4ec3..8325e1b798 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 d3821e795e..723a947e1a 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 06498c5aef..dce5761898 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 eb6f98b7dc..03b49e1326 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 087872aded..aede3544be 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 4197c2f044..6662830c73 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 5d952e0a9e..c95684c4d6 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 215c8d5735..3312c37778 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 bbddbc3ec2..b7baa2eb6c 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 231fcfec8d..7c3155f10e 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 7f987272cf..115d0b3d66 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 fb1f10b411..af785e472b 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 a52413179b..e9bf348cc9 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 761996d8ba..36894535ed 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 2e2a9588d2..89354926ee 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 b14e4d98d1..fac8f2dc53 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 26fcda79bf..466a4ff8fb 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 c600f1279d..bb0b2021de 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 2d31820e7b..9321cca925 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 9969b74383..9e94a66df3 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 18b0c14b2d..d8a62beea1 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 821d0cafb4..610078c676 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 f6868aeb9f..5adfc012a9 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 bc8b02d6f3..1ddbd3400f 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 1bef5da10b..8c01f19195 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 ef5a2534b5..d5d1f3a774 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 07f976c0e9..ce2c24a185 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 1d5233570d..ef345cb710 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 538e247121..e464fa234b 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 32a713b399..1bb200b862 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 0a05442500..320a64790e 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 b3ba402b6b..e092c221cd 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 a28e57b465..c4467ab58a 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 9fbad2dd3b..25ef5084bd 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 7c6c59c006..2bc8b2663d 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 dec9a77ea8..8861079de2 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 93b6d1193f..9fd41123c2 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 f183061332..1e9e4ff432 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 65efbb76f7..07b459910d 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 ba4d86085a..f1d138d38b 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 edfe3f81dc..cfbda068c0 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 74fe92ec2b..cf083c7698 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 170c1c35d2..1c94273bbb 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 64d4dcbfe1..068b7a5a60 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 7c2c98f0f4..7996ffc953 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 888e7eb1cf..a717b8a1ab 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 9d95040119..1308f35087 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 00e0ffba6b..3d9b82bc34 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 304780f693..61b1086a4c 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 bce5672138..bc50838679 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 f6621a1dee..cf63334eee 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 52a2ab42e4..5cd37f3d65 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 325c4f8170..c7845ec84c 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 0f266c64ea..cd7ed96288 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 9eb73086ab..c168b56217 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 a2d6b6a04c..5a9bb616b1 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 168edb1bc6..441a113d88 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 dd4f4e2d27..9607258534 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 16e1d15cc4..f5ec23bc46 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 a123d72cb6..f565f37edf 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 063c94826a..f0464c4f39 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 027ca75078..35fb4af377 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 48ba3ccab3..388fe868e6 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 c1bd8f080f..476123fce0 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 8e0401d6fb..1bea9c145f 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 55461ba33e..8660e2cf5b 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 78b9f36a21..b4e884e260 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 fb2bab26a5..180ba0f563 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 3a8c2c5ceb..d4673dbff6 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 265d2f7034..431b4e6a0a 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 177b1982e9..ba9d8775d9 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 30c18ec60b..1a9d8413a3 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 d878cb33ba..77ddbaf44f 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 5d028402bc..22cac7f71f 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 ff2687a751..a635a1fa59 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 275c8b532b..fee68ce8d7 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 6f01f80e33..dcd5f91f85 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 7a3dc51aa4..8523ab97ed 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 6956ee370a..2cf59d0d74 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 b68a6cfd22..91f87ff65d 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 dc83e38c41..afb5dd37d4 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 8bf4bfe4c5..36324bf66f 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 e6c7a27e78..3348b7a839 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 7ed9e72b6e..05c521c7f0 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 fb95016a49..832d489962 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 9efdba4fc2..4dffa2335f 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 4d59efa390..468c207394 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 b567413985..deef622f85 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 b18e7baa58..defd101789 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 06f569011a..4c8d9a1ed7 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 5ba5980b1b..feeb2ecea6 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 4f0ee68183..f657d30680 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 cc1fa39abd..8d88bf85dd 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 ff7760c836..d467243131 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 8fe217f52b..8cfb86f2b3 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 b24b0935e7..ca237fe1af 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 bc9cf37b9f..ea5bc9ca89 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 bd41c76a41..b972db0601 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 6665e3836e..7ac8d4790e 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 92d7d2007d..964872e1d6 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 911ecd9922..40d48ad295 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 6eadb63739..07d8c02199 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 ae9a96ec74..19cd880bbb 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 1a7da1d616..31dc69d553 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 4d03d5c57c..e8961e05e3 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 009a163c28..39b86694d2 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 be34e5ad19..7f76bfc830 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 12e8aeab07..6ba1d5a552 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 3f5459e61e..b3530ebf78 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 09df2374da..eca37982e6 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 07a1803397..b494e4c5ff 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 4800543853..81c16bc9a5 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 677daa138d..6009513692 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 241a96c7cc..389e9a76b9 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 f1885b9701..90a34dabcf 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 6ddccd151a..c0de9b4eb9 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 42626b4e81..03979dc45a 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 e6a5cf238f..ccb8674500 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 c2d360fa22..2e2f255ae7 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 a3ccb89ed4..2e5a37e4d4 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 3f079267c6..2d94a16cb8 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 6c8f6ea616..d71298e29c 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 8e2b115e54..e66455a8d6 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 4cde7aa063..23cfe64423 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 ee87c28678..d0766b95f4 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 b8dd3e967a..cb4f5b1c17 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 d984d10cda..e40871defb 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 318b83e1a5..97b9a3bc43 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 9103452d03..68ba19653f 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 c3cce13a7f..23be717eac 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 abacdd4bfa..5afede47a8 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 4d4f37bb16..b2710d4bde 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 d68710fc61..4a51e9182c 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 28a6a687b5..238b0d9d7a 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 a67f083cd0..e20db315c9 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 6dc815ef07..a2ef92602f 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 a4a7e8704c..85c676aa06 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 4cf80c84c0..a0c195df32 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 e65da9b4bc..e1c5956efa 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 60d1364888..3ab515bc89 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 fb0199e1fc..52c86a2b1f 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 9043faffd8..dff8bdce9a 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 6650c3d1c7..4f877a571a 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 15d0981bfe..ae3c035768 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 64ea2a3727..08fc3b97e5 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 d21cb1f5d1..bea2a7061b 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 2f94663cfb..0c76cc1622 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 5fd476817f..d86acd476b 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 5b2dd29ee4..ccfab2f926 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 0e5004e5bd..9da8e3d26b 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 f076ea6fe2..d5d1e48ab1 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 452867a8b2..b9553992c3 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 2bdea2ecce..02fb1e5d2a 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 ef2b6094b3..1db44f5bb0 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 9a3311ac19..a4fc2d2614 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 34d3160098..74191d87e5 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 292b058656..eed10c0783 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 b4ea5b65d5..46daeb1892 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 2bf712344e..364d541592 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 9a55cc823e..66d0e85228 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 2c8e8a714b..c04a54f8e6 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 197afbf069..97c02b3452 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 0424250ca5..0760507924 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 9152fe1853..77dd0c3624 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 05b171f6bb..879e846b2b 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 91ca7c6540..2198e32f49 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 7f94710183..e00fa847a7 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 0355c8f7c3..585d180695 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 6dae894ae6..038614eccf 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 dbe4e3e51a..2b363cab83 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 8a23b5ad4d..9ec75d75aa 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 4b1d267b61..4ab6a83064 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 987a8b852c..b446755d57 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 2e998b24df..7c22506048 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 66ccb58495..42dafc3e90 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 a1f2fe9736..94e6e43f8a 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 d12031f34e..4aac362c73 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 cfeb2ca217..07542c3cab 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 cde853bf6a..bf495f0736 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 c3e652a3a3..c2948de1ab 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 d8b4887fe6..fc449b6943 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 4740e65677..f9d810c626 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 01bd862dd1..c88962cd53 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 fc02024d76..5c942d9ddc 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 1c10ec952f..6a4a56e7f0 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 3268b8ccec..f8ca001d0d 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 c5512be61d..4c79347978 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 57f3f9dd4d..94725cb5e3 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 70464c5312..e002a9fa1d 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 bc6a0a1b41..5551cbfcb2 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 93fd2a2b59..75e0aeabf0 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 bcd1234398..2c597c0f04 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 f440f0490b..f01bf14a47 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 6633bb808e..f71d16605d 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 bcd93c0523..3a2bc6fda8 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 935cf4bd58..1490cf357e 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 0829446808..10f054ab9c 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 925038414e..07f4d5c688 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 7d84660400..6490decb21 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 e88d5ada0b..9b6a0b6174 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 227903bab0..7ca3e87e15 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 3eedc35b00..da15419d11 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 8a399d0361..2b23fab302 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 c1c8376b30..88907c1b6c 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 a299f40e30..53c2a50c66 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 e02baf027b..efb221722a 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 408c547739..25f545b542 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 a916c5a1e5..e00377721c 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 047ef0daaf..9505a844d7 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 c6da3d6ea8..16293b388e 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 44bc1872f6..462d8bcdc6 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 9bb9c8d83a..2306641f0e 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 d585ce9621..b35902d133 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 0c6b68d805..b5c5b065d5 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 1868a63a3d..c5b7c8c5cf 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 66897ba62d..8060defdbf 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 8b0975e8a9..759e4c8944 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 d6c4ccccee..453d22ccaf 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 918dd87535..c750e8ae57 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 17e5943b3a..9d47785b85 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 336523137a..ea160ca113 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 b8c85fbef3..093a6fe69a 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 6260e98b06..f0f8d6ff04 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 1761a3552e..7abc4287b7 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 68681cf9fb..a68195265d 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 f2c174522b..9a0ddffb8f 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 2a83b2078a..f2b1e06472 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 88cad34d9a..4e098059b5 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 453040fe3d..45bd83f77e 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 38f9d7b620..855bda381c 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 417512a71e..3632c97803 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 1f84e8edac..9df36d7a38 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 3fe28a8663..c923829099 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 f7f4d3e812..fed5ac1eb5 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 90ead2afe5..5fc378d78f 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 09d3dacd84..4896d143b2 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 73ed03922c..1ddb6b9a00 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 8508052736..051d281260 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 dcb1d9c383..4af0a3b292 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 e06876b430..753fb3341a 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 0ca26dd953..b1327c8bdb 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 5af410a894..9fd4e9fa07 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 a52cbe3cc0..9b423759f7 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 b845070078..77101f6cc9 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 27e7988a7a..3cda6a7921 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 8c0a313a7c..7675fe6e0e 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 795cea6418..dde1f91017 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 45a4c2707b..d0f5a89896 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 92faa57c4f..e59244c49c 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 de65fec0fe..fd46c5552f 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 92ef595c55..47cd14f94d 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 f437df5edf..291385ce50 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 4131b85d78..396bfada12 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 4e9ab797ad..07f2825c1f 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 1efb2ae305..036dac321f 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 6c255751b4..f55c1a41b3 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 216510950e..ea1924b101 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 0aa3b46d64..a58e040b67 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 3671800330..69bd476f3b 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 39dc7410b8..e708c9f179 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 286f8c840d..c64c7e6ef7 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 185075670f..bf1fc8b5a7 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 f8b0e7a01f..d9a838ee2a 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 53d945697e..d53272f0d5 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 77bbaf3e3c..4921629248 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 0f4b265b72..c9727ea856 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 cf6e0789b6..5ec8db261f 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 17fd24fec7..0000000000 --- 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 0940539f54..0000000000 --- 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/FieldAccessBean.java b/spring-context/src/test/java/org/springframework/beans/FieldAccessBean.java deleted file mode 100644 index 61f911902c..0000000000 --- a/spring-context/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-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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 e44bac1740..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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/SerializablePerson.java b/spring-context/src/test/java/org/springframework/beans/SerializablePerson.java deleted file mode 100644 index 13c2c5447a..0000000000 --- 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 a04d179644..0000000000 --- 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 d683491a1f..0000000000 --- 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 19b7da62f8..0000000000 --- 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 0e8a09a5a7..0000000000 --- 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 39fdf5be5b..0000000000 --- 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 2dde7a31b3..0000000000 --- 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 822da917c5..c69ab5658b 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 8da9a81a6f..0000000000 --- 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 4a32d4582c..d7cf863def 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 f17b3dfc89..0000000000 --- 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 017af48520..9eaf910d08 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 96adebee0f..96e2ab404a 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 09bd64d34d..91d1d7565a 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 b1e6c818f0..c21ee9078f 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 cebec37bd6..6f68b6bf60 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 4fcad300ba..43510574ba 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 654e76e7fb..fc90f7905c 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 9a735571d8..7729dbc788 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 85eb3620b0..8370424f73 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 bc4f87d63a..d500c48881 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 ea061046ce..d703fddd21 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 0094234b09..3815538559 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 5021766b1c..3451c1b37c 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 feb3bea499..10ae8ae09f 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 f94371ee0c..86da8d595d 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 1a6eb55332..0628149017 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 e8b85a509a..cd232df3c0 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 da6d7405eb..2e49f71a54 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 bf0849bc98..0a92c7426d 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 98f2309673..f575bcb44a 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 c8adc19bb3..f8e3280906 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 3386242887..9eb0813411 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 e5515885ef..31fa7a16ba 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 4b315b7582..daa269998e 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 8c1d0d3f37..65fbd833c9 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 9298119502..9088b962e0 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 cc049ed23c..393028d4f1 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 e991af7167..90de544437 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 19faed7925..a771266aa9 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 df21ad7262..8cd2e72569 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 f18e9e77c2..a96c4d303d 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 8463f132a1..4968b12b3a 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 91c0c5f4b3..b4e6a07538 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 1fbd833086..17c9c7e8f5 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 d236686275..68accbae1d 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 80fa6f50e2..4c72d9d593 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 44b931dfe6..b6785792a5 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 09e2fc4c4b..81dd758d19 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 fc46127cd4..f9f19b4759 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 29114dd967..0a611c0bbf 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 3faf3ba364..c6a63ddb62 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 a0493b62ec..6f407fb24e 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 f525d38fe1..f4454c64da 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 3bda3d3723..479ddb33de 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 720a7cd9b4..96f39c3296 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 834439484c..8bcaa6d6c1 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 c93760bf67..33bdac26e8 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 30b7c590c8..81770ea423 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 6f5675fffd..99d732a164 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 eb3bc80d39..8001716e48 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 96750057f5..59137c7516 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 eee36e9d9b..633127e84b 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 50ed95df10..e3ed03301f 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 a829ee49f9..2397340003 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 8792128587..0a9cfdf655 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 8e8cf87095..16565d9b1d 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 01e25e8030..61b2612d29 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 50b8cd2045..55d08669d0 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 1f81d31669..4475d87e4a 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 b4135bf646..331a2f0af2 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 7b461584a0..f6d90975c2 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 4cbfd9b34e..31a87271ca 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 75bef42a0f..5a4508b903 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 c7237a2f6b..02749a2e51 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 d917b0d608..b35fc04574 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 eb288746fd..6972adada9 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 d52a9db656..815c487294 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 14d1932dca..81e7b1af66 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 b2c1db67d9..570d2a53aa 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 d89deb4415..7baf82681e 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 df6b5fb8e9..9a3ced52d7 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 4546a22de0..eab6f37b7f 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 50453f6b5d..48780c545f 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 1f77d726b9..f57fac7fd8 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 5471d438af..bde4c67cb0 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 0ec8a5b757..29a53ac60d 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 cc8c42f5ed..5039456d34 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 e061bc7edf..45bea62180 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 da770cb924..f0dcbab8ab 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 0db15b1d7f..ba336cdb8f 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 445397c384..39c2654d0b 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 c983ea4e3a..f846eb2632 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 1d21211ad7..c18cc981e7 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 8073f92b83..54846f4133 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 c81b3d9ab8..960b5ee805 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 c556e86898..0084406547 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 6250ffd310..7e5570ee4e 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 3ecf4accbb..59146595c2 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 7bdf1daac5..6bb97b2a95 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 c27d84c131..c39cff7977 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 68d5f0286d..344716316f 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 44fc77e3b5..1b95433a63 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 2d4783496a..e895a207c3 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 b0d617e9cf..52aaaac7e9 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 9c8f240003..02f0fd8e3e 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 be87313477..206ac4d8bc 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 64f491bd4e..5c53712e5a 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 125c77c636..6c59cf8522 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 b2cc55fec2..fcfe98d94a 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 67f0760177..415cf89519 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 8dbb67f34a..42098c96e7 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 8094915700..1c8bdb54dd 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 c319cde520..1771dd7cf5 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 5248cb2644..56090d3327 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 24dec9ad54..d124bac830 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 4e1f90468c..1a0e064b75 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 b1bbb815ac..380f29125d 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 cfd70979e9..17176f9dcd 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 4dda9faf6c..152cf5d758 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 60df14aeb8..26c750cff6 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 3ab4a12d95..d7592088c7 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 2e36dde141..152ecfb6ec 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 e339891102..6c95987712 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 717148bc4c..232374bd0e 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 68ddae1f8c..7ff83e35ea 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 34588e19a7..676ff05a30 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 a561e2cbf3..86c960f82f 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 a545e69e68..cd68925cc9 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 44dcf38bd6..450a7291a5 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 325ebc10a4..79daad0e29 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 68f1ce529c..9b4c7ec107 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 e3f9ada36f..24185526d6 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 bfb2adc69a..078b116979 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 f5834e8e6f..3e30e569cc 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 8778978bd8..ee9d5095d7 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 01d95795fa..887c6fc1cc 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 73c189e36e..6d82d77d88 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 9c7e9a2319..6fb17f353b 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 9ac7433589..b1f9d24ecd 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 2dba7fc9ea..bba7f77668 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 73d0cab651..908f5652c1 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 7ee7a9c006..5ce3da22d0 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 0fa4b0e392..f51d024715 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 57c2b5c8af..bcfae1cdb5 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 5e407ee0be..5ddcbab67d 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 1eab846bc5..6b9c028005 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 acec31ff7c..0dd6ce2cf2 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 bcfc34c71b..b8206b21a2 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 c2c9e07aaa..c0a78215bd 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 a48935c47c..c0fa18c2c3 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 396d347b17..8e03115c1f 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 d8c1aa1390..4eea7e8155 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 1afb7000f3..c2430271b4 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 6d1a3ddf83..e8767251a9 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 4cb1bfdd58..68c5b598f9 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 9d60580e5d..9503e82067 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 a5c07dbe80..ae9aa8be0e 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 c620be5b74..6b0fb87da7 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 09644b02c0..f39f28b40c 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 506a883136..3cafa8950e 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 db49e67a1b..b2efa269c1 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 bb94cbe364..a213fdd4ac 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 c40b734119..12dbf05a50 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 0a6ba49035..be001e23c4 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 e73f6106c7..d42fbf201b 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 a6af50e132..7842ee328c 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 77aefe6167..7082efec13 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 d9aba5b4c0..2c71236d78 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 5603c43abd..64f3f03b89 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 c61cd388aa..a59d950a8d 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 d95c6b4f28..59740fa0db 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 85865af76f..2d7d9e2639 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 3ab938d95d..4524412307 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 24d7f4b57d..a6abda7ed2 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 96167d24ec..c95000c59d 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 a52d6a7e78..53da8a6582 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 5f65e056f6..d74787b7f8 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 97a3581954..191b2f9ae3 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 3e47e82bfd..2dc4fa087b 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 8bfbc77ac0..9b0982d801 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 d409d1e8e2..97b24e29ec 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 79da547c13..59b71a58b2 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 6aa94facb2..68811d712a 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 93735097c6..99cefe7158 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 1d74177d3b..311b7c67a5 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 4be8a6cc92..d4034ed449 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 a0681cc398..dc9db0fc5e 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 6d8266b4ac..76b8ad5639 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 73d4fb56f5..2c2a8618eb 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 a3f11f9fef..35fe108270 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 c19ef5969d..f037d87bcb 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 2370488f80..8a49293006 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 496c3d7c9f..062a45febd 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 28cc9f5b53..2b0bbaeefc 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 91f97e0a1d..729e784464 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 c98f88489f..df11e8b4bb 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 9772ff4ae4..3050b6f8e8 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 fefc10ffc8..3521619c22 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 6f9ab8e724..14986a1959 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 b108c30e01..79790d3963 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 b72082cef1..c006f6fab7 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 d53d8366fe..598bc73e8c 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 5acfff7608..4ad2255d2c 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 5148742ca4..ad6ac8871a 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 cf2c73b506..b191a7ada5 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 4d658bc2cf..4018802475 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 bc635f183d..917e8dc918 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 2783f244b1..0000000000 --- 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 c71d6e8681..0000000000 --- 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 f21936897b..0000000000 --- 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 9c268b0f67..0000000000 --- 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 dbb46d5385..1c492f3759 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 be6ef187d2..8611615193 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 f5f0aca435..f679713eb9 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 e96c31f739..3b3329e0d9 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 9cab480483..60f96bdb17 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 4bde326119..e100da3d47 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 0d8729dfdf..eee6c1029a 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 0b0f791cc5..4f5b69735e 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 7d3b05f631..7320cea1d1 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 3425f60db5..74e3d76639 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 921a5c4e11..697c747d33 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 c0faca5e68..5d6aec6f41 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 2659b23576..3beaf36b84 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 0655210a42..c9397abba4 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 052209d92f..8c9a0ae2b8 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 95e40c1098..2bc727e4b4 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 ddc139475c..7ea2ee2590 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 90582292d4..0560184010 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 62bfe8b7bf..72a1e6a39c 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 5908749d75..116a7d6ab4 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 4a542c0c6e..c2648628ea 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 fc19107ced..5e85cc6424 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 6aab4f5df3..030ac6b046 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 132d9211c0..78e61a0607 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 763827a05a..96d3db7fdf 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 a7066c828c..28330777f3 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 d1b82bfece..0b0116d2e1 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 95b21bcda2..389b38d3b6 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 749fc42fde..ed90507212 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 58ce5e022a..eaad85d1f8 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 a8afa2447f..1516ac2dbc 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 3744ad4ea6..2cd55ee7df 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 a379176180..0e29267700 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 cc7e1ce392..55f3016d81 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 3e0589c7b3..41a3749ca1 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 13f5d3c9aa..5df3894c08 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 dd39e65576..5a5b72715c 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 d77ff16084..e1fe7c848e 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 db4323a318..d561ac7e7e 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 3a4ffb7043..7363033668 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 604d2595b0..9b63bfc333 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 a95a2408b5..118feabbc3 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 10ae6d4283..a4e8932e26 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 c71d6e8681..bdad96e32d 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 f21936897b..3d1452ac29 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/beans/Person.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/beans/Person.java rename to spring-context/src/test/java/org/springframework/tests/mock/jndi/package-info.java index d1a441945e..8847baab54 100644 --- a/spring-aop/src/test/java/test/beans/Person.java +++ b/spring-context/src/test/java/org/springframework/tests/mock/jndi/package-info.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,23 +14,12 @@ * limitations under the License. */ -package test.beans; - /** + * 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 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 +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 bb5e71f5cd..4448962d49 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 d93ca6ed60..7bed71f394 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 ee25e7042b..a98548867a 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-webmvc/src/test/java/org/springframework/beans/FieldAccessBean.java b/spring-context/src/test/java/org/springframework/tests/sample/beans/FieldAccessBean.java similarity index 95% rename from spring-webmvc/src/test/java/org/springframework/beans/FieldAccessBean.java rename to spring-context/src/test/java/org/springframework/tests/sample/beans/FieldAccessBean.java index 61f911902c..a250f329cb 100644 --- a/spring-webmvc/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 0831e05c58..a5b1eef734 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 336fe78e67..7b159f3b3a 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 9ae4f54ec2..0000000000 --- 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 b1ba9804d2..bf2031ba53 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 e85cf9a623..515a1013b0 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 db86c2384d..947677717c 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 4ab4f448f4..83a36cf955 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 b98fb42007..6d831328c1 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 ce29597e0c..214f797fa0 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 41f500d93e..5c2dad22a4 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/CountingAfterReturningAdvice.java b/spring-context/src/test/java/test/advice/CountingAfterReturningAdvice.java deleted file mode 100644 index 2e9aaa5a15..0000000000 --- a/spring-context/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/spring-context/src/test/java/test/advice/CountingBeforeAdvice.java b/spring-context/src/test/java/test/advice/CountingBeforeAdvice.java deleted file mode 100644 index 3dc49faf24..0000000000 --- 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/advice/MethodCounter.java b/spring-context/src/test/java/test/advice/MethodCounter.java deleted file mode 100644 index 8c29886a3d..0000000000 --- a/spring-context/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/spring-context/src/test/java/test/aspect/PerTargetAspect.java b/spring-context/src/test/java/test/aspect/PerTargetAspect.java index 47fb82e40b..b3d562e65f 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 193531bcbd..0000000000 --- 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 b047ae29c0..0000000000 --- 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 d784bae712..0000000000 --- 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 4cdf0cfc5c..0000000000 --- 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 cfd81f2bad..0000000000 --- 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 81c0e45e3b..0000000000 --- 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 8cef5b2321..0000000000 --- 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 2a37c6b8c1..0000000000 --- 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 990989bb19..0000000000 --- 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 c528573e4d..0000000000 --- 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/mixin/DefaultLockable.java b/spring-context/src/test/java/test/mixin/DefaultLockable.java index 2510395bf6..2e84161be9 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 b038bff1fd..e9463cdc9b 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 7ee37ed684..50667a7b0d 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 dd006ad449..a5f6d11146 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 1ca010f164..96f46e484e 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 1067cbc26c..3982b48c7c 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 2b71bd3001..efb31d0297 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 e67e310136..933e66b7d0 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 9eef548427..0b8aee62e9 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 ccc8039a8f..77115d08b5 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 c66d642fdd..fab56e5e5a 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 85253a810c..9dfb7214d2 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 925558f7ae..dea843c0a2 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 f7eba5c93b..ceff466c66 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 9986ad58b2..79644134e1 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 bdbebf2c8b..e5fbb959ad 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 350cdb2b0e..901ff9f053 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 f39ddfd6d3..02b3014195 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 dff92dd309..3f38f2c9bf 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 6139df1f2a..20be49cece 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 d3895ebccc..e2f6a3f25b 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 447c425da8..2529b9ca07 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 aa99d312e2..a83051b9b0 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 6ff085146a..19bf683cae 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 3fb94cddda..0f5dc4c0f1 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 9acf232285..f7535781b3 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 983655abf0..cf584efa88 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 9c208afcfb..7fbe4b4745 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 98dc0a248f..881a3ca20b 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 6d9604dde8..991d262645 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 f3e75920be..d5d668bac6 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 c2c26b3d46..04f53b6973 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 0c574a4df1..1ffc536304 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 4c5387aaa3..367b4aa5c1 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 90e8bdf738..38f0387679 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 503b01cc01..7a7a21d39c 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 a550a4daed..3d7a497867 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 92e98b4d06..5e982d7613 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 89e41d3c65..00daa798f4 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 aa445748bd..422f8d0035 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 0c3b71eca5..4123df65fd 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 0f6698f8db..15037de3a5 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 cf42f1bd78..7979e4d5c5 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 d48113b6e1..3bc05c28b3 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 3ac220ce33..4905e411f0 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 232f1b49ff..cbec367817 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 f46433e040..7e952690ea 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 e2eb6e1fb6..54c46c76a2 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 c12b895766..b87823a836 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 f14091729d..27a5368ca3 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 96a24c8c6e..c9df6c8492 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 74214470d5..d1d68e6995 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 b43d3f5152..860f79c241 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 32d08f5cf3..79fa122828 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 063ad2f9a7..a9ebf4d7c6 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 b614dd30b0..62ea98fc81 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 ff18cff838..b9a0b186de 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 1533d81a10..a6cb4ed109 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 b67b34f481..1187c84f9a 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 65bcd408b7..3cb29fb4e9 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 941dd59517..f554032e75 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 389c18f9b3..71839c1837 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 5e77137f53..ad97b300b5 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 68dda908f5..caded1a7f3 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 66e5e064ef..56d4c5b40d 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 c86e290137..60426d8075 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 926942869a..9320acd338 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 0eea853376..5902cb5e94 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 0a22f71ac0..f021e1355a 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 56539b9921..de8760c879 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 b62a0e3ded..b36043a7e4 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 9282d4885a..eaf01a5782 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 c71d6e8681..d35fbdc865 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 f21936897b..449c45faca 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 66ce8a2b07..f97e60e2eb 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 784e160483..2369417030 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 a6381e92ba..e8f5e91dfb 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 4894fe4eb9..6b69fdb704 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 2ea463ce8d..b492c1fa98 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 985c1e20dc..9d3a878026 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 89dbaf0d74..b1193ff5e1 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 d6ba452f23..70e90567b0 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 477493f4f0..93800340b8 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 83096ddf9f..0ef706abe1 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 bd83c9eaff..0d5d078480 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 c420225a63..d01144ede9 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 fae16151d2..0f697d115f 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 bae411345d..af3c68663e 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 b810d3381c..2958fe0254 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 7664b0f460..30c08a22cb 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 72ae28bb33..53a9b877e6 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 91962ee827..944f3aeaea 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 322c7a7fd9..c5c718468d 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 76983acf72..c853918664 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 ee1c07f14c..05ee407f5f 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 e21ace4ce7..4e240aa6ea 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 42fc03f1f4..922e34c629 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 7ab7906813..4c3dcd3a91 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 3498074cb1..bb0bc88cd5 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 96729e409e..a78960ce82 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 fc64520476..27100be94c 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 0b844447e9..0f2ceb73a4 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 7a820b42cb..50cfa74474 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 81658f379d..732c1e0bf5 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 91dc025aac..9b7fd03ec7 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 a01f214f60..5496b4ee63 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 f625c3fa5c..c3d6c8f5c7 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 3112cfcc5b..16c6f97d8c 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 c35ff65246..92d32ea517 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 51b04ce41f..093ae49b10 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 e324262158..0aa21888cb 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 beaa77ca1a..34dfe47ec7 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 ca380e68bd..cb85223717 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 fef3aa74cc..7c78474189 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 a4fa110e98..823688797f 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 1fffaebd96..9c636e0e70 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 21be2d3da4..bb25f1f8e6 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 f047b156d3..d36250099d 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 3ccb4000e6..dd55d0e78b 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 3afa516586..ba959d162f 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 8bb2d00acb..9cf1ded10a 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 887adccf10..fefc31e161 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 194e003797..0000000000 --- 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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 cd1724f264..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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 d84f85d096..0000000000 --- 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 e627a333be..a254398c4e 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 5a6c915365..493cdc755d 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 eb8f362d56..ba8c81c294 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 307a4e93df..7b96503a3f 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 d0da3c8e5a..07b0cf4b5e 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 ab6e42dc68..08523c7949 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 496bbc1b01..4b3223f4ba 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 7236045484..b1939de12f 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 8143c77511..192d005f4a 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 580b873b10..1568b6fbac 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 7ec007c016..bb715753af 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 613dc3acce..3768b03cb6 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 aace2b29a4..fdfa4eb4ac 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 9bd67303ba..35b64fa432 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 8ae941c107..d27e3ca50d 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 a504642a92..d765937940 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 69c5ba2d43..97f303b809 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 1efbb6201e..45d36076bb 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 869d41ab27..3a976747ea 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 1efbb6201e..45d36076bb 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 10f0e1ef41..77f079aec2 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 acdab7073c..9f2fdef412 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 b1a0a4e551..735f96a01f 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 39cf8624ad..6cecd0c267 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 419997161e..0e53eef482 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 ebe40daa0a..5ada9b5c61 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 1c18259f1f..7ae72d581f 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 78075bc3f3..02c0dcf0fa 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 a9284c78f0..4bb3fb5bfa 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 a219470ce6..a91178410a 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 01ec43a2fd..c88aed37d1 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 ad7de4f270..3ee77974a0 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 c51b95cb3f..08f91b536a 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 cc5ad01ff2..d7bfb8c2cd 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 80366aed5a..ca7b312662 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 8e422e1c0c..cea2a29c79 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 db69a60506..6cc35c641b 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 2f6eda6962..b40fed69ca 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 cb75b8accd..f6a90a62ea 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 75a32cda3a..a77f7239d1 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 62206fde4a..67590a6b58 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 ed2f58de11..bf07919721 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 0e62ef734f..6df81585fb 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 5c2d39499c..b5d74839f6 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 22f0c6ebe8..a662b7b8bf 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 61059c3639..3229df93d5 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 dffdb30f99..704b347873 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 85af698bd3..4973d7c68d 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 d8446ea579..2f293d8847 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 ad6090ab61..751ec07e92 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 2b38752082..4c257540b9 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 64d8cf2e48..f5424607d5 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 0f0858c4ba..1259b82d83 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 3c0b074a81..5d1459c4ce 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 30fe35276f..0bc08e1c45 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 d3fcf1dd82..2eac43320f 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 835398cb1b..219010f12b 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 70e1a8dd5c..a0c51ded52 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 223c5a6f59..54a9dd26ba 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 8773890968..e8a440a230 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 aed661d838..05c74a29eb 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 db1c4bca19..7af6a541b4 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 cfc0a5fd53..26dd5f470e 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 f2b001e10d..00da19f130 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 6ba03e1bc4..9b4793e462 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 b2e4fedb24..6613a695b4 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 f769cb1a13..a0f7668ae2 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 da02bb8228..7da5e68bd0 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 6a384d8c6a..cca20f4827 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 bd69ae15ff..19eefe388a 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 464ff84af0..dc06571f19 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 882578a189..c6f765ea95 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 56bd298739..409aade593 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 994b886b30..eac2522cd2 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 e8a7c2f5a5..76421e3706 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 039faa6894..92602e1527 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 cc26b849db..836dca41df 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 98cc3af149..44b5675a89 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 9fb695889a..cafc8b6e47 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 f6f2907f87..07a8d2d5ff 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 a4af38435a..818212dd3e 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 8427a674a3..3861d0ec59 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 1fc6d4ecfc..0e672de084 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 f79a9b0aa5..1ed4f5467a 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 55a4cff1e8..7238260bd4 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 2f6eda6962..b40fed69ca 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 fb373a0347..7131201d43 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 cb75b8accd..f6a90a62ea 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 9896e35880..1f488ec26c 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 1c9fbe9125..cd81b6becb 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 5c99fefa39..b01764251c 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 47d7dab773..6bdeeee234 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 d8b7fcacf3..54b55c8c44 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 373166d9b4..6e0f84f733 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 3f6a054ecb..622f0dfe68 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 de9e21b2e3..5dbba76acb 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 72af7e7a7b..78720a8f5e 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 6f1525229f..331342d4fc 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 d8c070c504..76a82b823c 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 bbc0951e4f..8492b02d5a 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 b9d6b4b6ae..363d47a9b2 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 b7a52aa961..957533f913 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 85da86b3f5..bb2e80b9f3 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 d56c24f5e5..9d071b1647 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 adaff61eb0..ea0c4e8401 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 847dbd97e8..1d930831d0 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 7cde8c0190..1c5d85d605 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 d8fc57b3f1..bf53acc542 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 e9e69e1a19..a9069a1d06 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 a8ae4fcc8b..db9d91790c 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 a569313555..427191bcfc 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 4cfb6b8abc..f20e466410 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 11e92153da..a46a6da3d1 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 27a08c054c..ee25cb32e4 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 66318987d0..05ba435f9b 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 cdc23e35bf..bedd776bce 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 5a1a8421dd..334983d807 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 c07b25a927..829d70ffec 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 3be9e53ca8..d5598c26f5 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 5b64657360..7e10a05453 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 eac5e7b76f..6630477957 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 0930460eea..7f2a6c5b23 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 b9c8aa80e9..82cd00574b 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 b75a74281e..1e303dd907 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 4e77ce5a16..b6801d20bc 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 4840493054..eda824bb3e 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 4ee94c17ae..bc1c8ce35b 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 c1af3068a7..c7b6c88e36 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 445e7e5171..ae06fa821f 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 c28811f4cc..4631790d62 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 17592afe47..7b41fe7d55 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 08de0dbaca..4ec0b72512 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 cec38dc16b..3179a3adc9 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 7a401c24d3..907f621809 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 fc29c8a0c1..f284362602 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 7970724c43..d41930a6d9 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 5bf9e38878..99bdcf324b 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 f42faa26a3..131bbd6fd9 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 ce08465ae4..4ec552b217 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 698e3d07d0..a5ab2dc9d8 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 5c30bd6baf..64e940b522 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 94f31e0bfb..699d2eca64 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 032abe67f4..592bf859a4 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 875db8c319..fe93de4cae 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 0b5d532c33..69d5e94cc2 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 19b5cba0a1..2b8358d678 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 4310c88371..bdaddb8c55 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 cc78d086e5..4b5f6865c7 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 cbfeceb996..d4c086695e 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 5cd145bb30..9cf7432c43 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 b86d256a62..0c660ce0d6 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 71025dbf6f..d211087b37 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 d977f44576..252a5255e6 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 8ecf30261d..e6b6646146 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 14185f7920..7e3200a3d5 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 8eefbd7cc8..d0256cb1c7 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 e2061896c8..aa7d38943d 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 d9860a38ba..482a8dc0c9 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 693345dc62..d6ad87f02b 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 532f12c007..78f3b29a71 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 24337ad0c0..f01ac83100 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 2fb9c1378e..bf1808db81 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 e9d43f4094..fe391c8805 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 fed1e44a99..f5b2b5d0ec 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 11a9c147c9..d55909ebe0 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 70ff9111e9..df138bdc0a 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 969a90115d..7145d36b00 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 fea0d11ac9..f19f6ac2c3 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 8dbfd91b21..51ec87b265 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 107391e0a2..65cf565287 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 f69c1137ac..982b43064b 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 638ae9d23a..79612bea39 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 006ef3b8b3..413a034ae7 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 b7ad70d01c..efbec34e4a 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 d256310dfe..326b7f977c 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 8e91d93394..25bac95668 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 df965959bc..01f27f23ff 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 731467a77c..fac5eba990 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 ac6ed06d32..d26fea7332 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 76a84a5341..6e6fde8405 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 bd4910f1ae..1b60ca1606 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 c234ec1a18..b5380bd9d1 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 5db61b3740..196caa86d2 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 2e48388152..bf6f4c3967 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 a237550a01..e4831a6660 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 57ebb3804b..40c34d52a6 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 406efe17ac..2c2030f6bc 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 1d5a102d42..56cb13e474 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 df7afdc1c8..5eda8a28d2 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 8facfc5a6c..7bb67d4780 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 f3274c2e92..7076fe0f5f 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 8871368899..43518ee930 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 e98eb1c4f4..e8e9a351fe 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 5c757474a0..8a6c2e4d46 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 1a48ca044e..03b4a28af2 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 457eb87d47..e574705c69 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 3a140590d5..707207574e 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 e6722d469c..cc07a9ae16 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 312169b6fd..856d24ace5 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 4c897e2fd6..07bea12ee5 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 bf4647cb22..28736d0177 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 514dd625e6..551eb287da 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 8837a05eb4..1deed0c720 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 eea06e2706..f505b8bf5c 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 c4ef1953f5..32c66e68dd 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 fbf824f5c5..b67ed6982b 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 c6745d9d9b..c71f01d681 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 9d52c141b5..8fa8be22a3 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 2588187ddd..f6748ef890 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 5e7021b0f2..0f605308ad 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 eeb0046bab..0d45ed9b9c 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 9f6a0bddfd..debf7a9523 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 055d42c797..a7d2abdfed 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 f253c2a8b5..a5a632411d 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 31c739cbd7..21e8e92baf 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 53f78b9a53..4b9314edf7 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 75133366d9..11f72759a7 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 d60cf2f8af..fded50e167 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 47e6773bd4..35f30be7f7 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 2026ada3ba..e4ecffce74 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 50d4cf7c38..aac7f91e5e 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 6381bea66d..d493e950b4 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 d622ff9799..de51a5425c 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 6d0f16f8ed..ef30ce0af4 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 3b4a4c10da..1e2f4455c9 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 f3d62a4b82..6a1f9decf0 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 b7e77b6f60..f1a63abc11 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 8b73072267..9569dc1098 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 30bfd66a02..4bc84fb392 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 7dab8d5618..b9e668fc57 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 c2188a108f..760d7b6951 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 85be9f8bca..fd6f184304 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 0ba452e84f..98841f3cbe 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 0083f2dd24..e3168e1b7b 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 1d576966b5..bc1ffbc820 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 c9600ca0a1..bfb35698bc 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 c18ee98515..7b20382104 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 f7f429a798..b31eab96af 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 8d7df115f9..47d8319af6 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 17fd24fec7..0000000000 --- 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 0940539f54..0000000000 --- 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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 ddb091770e..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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 7842bbfeac..0000000000 --- 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 e2bfda3f1d..0000000000 --- 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 8099156006..c7c1970cc3 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 3b759466a5..fb6259de93 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 5cd19f8f02..9998d9af65 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 e0a4523bfb..74953d4d37 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 16f1012a75..2038b8ecc0 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 50bdd4c2de..ddbdc80069 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 bd8f7fb5d0..4e5a3281d4 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 10ae6d4283..0000000000 --- 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 8713dbe5ee..d3852d4e34 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-orm/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-orm/src/test/java/org/springframework/transaction/MockJtaTransaction.java rename to spring-tx/src/test/java/org/springframework/tests/transaction/MockJtaTransaction.java index c9c8709c48..eb68f25517 100644 --- a/spring-orm/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 0c0b3cb81c..0000000000 --- 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 c78fdcf43c..04e937b7ec 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 480b869d3a..c13ea6bc41 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 f810e715b9..df1604401f 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/MockJtaTransaction.java b/spring-tx/src/test/java/org/springframework/transaction/MockJtaTransaction.java deleted file mode 100644 index c9c8709c48..0000000000 --- a/spring-tx/src/test/java/org/springframework/transaction/MockJtaTransaction.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.transaction; - -import javax.transaction.Status; -import javax.transaction.Synchronization; -import javax.transaction.xa.XAResource; - -/** - * @author Juergen Hoeller - * @since 31.08.2004 - */ -public class MockJtaTransaction implements javax.transaction.Transaction { - - private Synchronization synchronization; - - public int getStatus() { - return Status.STATUS_ACTIVE; - } - - public void registerSynchronization(Synchronization synchronization) { - this.synchronization = synchronization; - } - - public Synchronization getSynchronization() { - return synchronization; - } - - public boolean enlistResource(XAResource xaResource) { - return false; - } - - public boolean delistResource(XAResource xaResource, int i) { - return false; - } - - public void commit() { - } - - public void rollback() { - } - - public void setRollbackOnly() { - } - -} 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 1fdd0659eb..67f965a650 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 1364632258..2e42257b42 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 e2a96b972a..3f4286e51b 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 cfae77ca56..813a905e07 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 1dfd6a1bb1..ad05997a07 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 608512aefa..556cb59965 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 36c076ce52..92f1ed6514 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 fcbc5e880a..5c11e26d5d 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 d30fd87be1..bd659fd893 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 ec6f49fe14..ee458c0cf8 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 11a649ad50..965a0db01e 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 4ae36b3c1d..f7ecfb89c0 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 ea4f7189c8..a707e84fd3 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 59947292cf..2b01ef4a91 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 27d72c2dc4..1ff4a262f4 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 75e100602f..79885dd3ee 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 a260d3ef71..e21ded175d 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 1e804de132..4778f5925d 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 7aa4a1e275..0970132a94 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 d1884954fd..0a45d64be4 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 f32779ef36..327675aaa2 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 81364f12b4..bfd9071cdc 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 ff21ee0a8b..5aa4746542 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 5255b972ac..9b41bc3997 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 09c860fffd..e9ef193b44 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 94ca902580..aed9bdb27f 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 b6dbf51348..5630bd8219 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 7f699d8e90..ff819d3ede 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 0a4b7e9f1c..a8adf10c6d 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 dbe6421093..0000000000 --- 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 7c1bfcfdc8..eac003d0c8 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 55a3f5188d..7137365507 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 ab13bc68c7..3e833d4459 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 de141afc41..9d39760479 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 c95a20c430..680225e928 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 23543c384f..f1ddc0080f 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 600082bfe4..a27bef02c4 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 4b7b747d2f..6271a198da 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 5c2cebb357..d8f8f33f97 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 ae0c080131..189bf9b218 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 1aee1d6a05..87cddf189f 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 9b819edc8d..28b6bd5087 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 e02fb1e230..ff89f1bb86 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 55ffc30c63..5aba1cb154 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 7dd174260b..5a024973ea 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 2177d0d297..7e894a53e4 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 7f6c8eeb64..18668f5300 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 7a754e198b..373b301dc7 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 9f6a53ef8b..610168c678 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 1242cad121..9087aaf209 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 f6ef74740f..9713e21d21 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 4a27d8b7a4..35d8afa8c5 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 1e642e3755..4a3d34185b 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 cf2cb7d221..65ff59c815 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 b9f2357dca..f41a2b8f92 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 2c015834c3..0434e6174b 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 1f76983228..f76aad06fb 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 97be285920..a70b37386c 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 84880225b5..448bd4eddf 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 10863f82fc..67144395e2 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 7161989057..4d685333ca 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 d27a5dd628..24a69ad9eb 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 2c28431a4c..240f29d8c2 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 83c0660e5a..2b59850fbc 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 febc333f2b..fa5d2c6746 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 1bb0351ea6..0745e9494f 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 8adf208b32..4adf614f9a 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 d48e3d611d..175750c027 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 a071859af9..7f469a4318 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 760fd840ff..90191f1d8d 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 3608d9c7e4..2f6096168e 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 73b1ab5682..1f29473baa 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 24ade7d0fd..9d094d75d3 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 0782b22a67..43032ba598 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 a6e90fb981..a299313dce 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 6ea979dea5..04d7d8cb09 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 3d2717c4c1..fda9ae23dd 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 b6c07ee59a..98ad9992b3 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 f9ea11e44b..4e77885aba 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 92b78c1721..bab588d5a4 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 db5ce0aef9..47a9b103c7 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 7eac9e58e9..f9d1d7c102 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 6faa10fddc..143edb28e4 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 d10d7c81dd..03f13d86ff 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 3b14991df2..bc870ea5d5 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 31bc57888c..b4232ff47c 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 de03dc3669..39ddfe4dd1 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 5529a0dbb0..b9585787d8 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 e65e7a7505..155eadeb7e 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 46dc423438..27202c36be 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 42615d3401..8570211fa3 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 839c13b5a6..f921d2a541 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 820f57a2a1..2b0df14d95 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 b7c201f7fc..8286de1beb 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 20fe615e23..8cf39688a3 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 207e6a6c26..6c8ff6de88 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 a92085dfb7..b95814a00e 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 dedc298753..19bcb0d772 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 f45ef255aa..cce42d4c5f 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 2ffa1e99fe..1a5089bd96 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 c01de6e6fc..34df1b1de1 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 685a057142..343aad71c5 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 fec95de6ff..6af3d80863 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 97a9e86073..ea6cda9767 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 4dc22c2449..d5c3cdbf1c 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 e1e54b6b21..8ce1a65392 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 59b043910f..180645580f 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 37e5d2519d..a2eca47b11 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 7a64224ce0..15af5f435d 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 a0ef9e29fc..9aa2547d62 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 b85cb1e23e..a3551ff767 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 9864566193..816a52c3c1 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 45a76d97a0..5d9ea1a0d3 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 84c41caa59..d554e05cf5 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 f044157f48..4b3b4858bf 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 eb9edbaf16..3c2519f5a6 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 7dcaf3ebfc..949f0042e4 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 cb4af40c70..be9f6888af 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 f1ae54882d..712e50f341 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 c0ea3fc345..4d93eff7f2 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 4f25d7633b..07c44b32a8 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 083e6fe5e5..92a2aa88d1 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 c7520687e1..b00f6e46d8 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 5cac3e8eb6..ee5672cfa4 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 57a622118e..e7b46bdb6a 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 79a49c1cad..e2a7b7d798 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 4b77ba622e..d97fe876d1 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 94aa67671e..36eb573b57 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 6aec889ab6..c4a74bdd0d 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 632e9fb472..86f73591a4 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 ed1ce75a97..f24bb2207d 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 93e0ee5b65..3fd05f9151 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 c50df92d4b..e05e110a7d 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 677613a61a..ae9ae6ecf1 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 92e20f3044..25f743befc 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 ab995b112f..ee0a9b7f65 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 ad002782ae..b78ad775f9 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 2d8c260ef6..1329c78232 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 7d8e8dff17..9b6b909283 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 3d7c91cee0..0fc4ee78e8 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 23e9a81f66..2c93058c5b 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 cb0367c2e2..ab7a710147 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 0d0e7de648..bf0ed911b4 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 6ee0c08626..0ca9e35d32 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 81d3e0f597..adeddf78af 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 cf8d45148c..ee9daf8fea 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 6682a0a009..a8699042e9 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 ea8382ee01..67b7a4c024 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 437216a969..832ea24d31 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 0a901294a0..c7acf09502 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 bb5e71f5cd..0000000000 --- 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 17fd24fec7..0000000000 --- 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 0940539f54..0000000000 --- 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 61f911902c..0000000000 --- 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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 ddb091770e..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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 a78998ad5d..0000000000 --- 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/SerializablePerson.java b/spring-web/src/test/java/org/springframework/beans/SerializablePerson.java deleted file mode 100644 index 13c2c5447a..0000000000 --- a/spring-web/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-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 282a18352d..0000000000 --- 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 006228975a..0000000000 --- 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 42b9adbfd5..3ee1f452da 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 4461024f64..18412ce33c 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 323fff1af3..c8dfbfc079 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 2af35321ff..3a3d4a6885 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 7408552ff5..4904ea3191 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 4fd3017ca2..c067159017 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 113f3d4910..0000000000 --- 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 917e5de114..0eabc67d93 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 70f5e257d2..2df6331b8e 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 8507cdbfe8..ccb91450a4 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 0771b1f4c7..2344269b63 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 803bd80d24..d29b2b7129 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 3f5171390d..2af8ea3816 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 e2545123fe..2f12bc988b 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 a273cfffab..c34e202330 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 d3e3ff6785..f0a259edd2 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 5f32208ecb..58aa59d49d 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 00a632f47d..f4ff566922 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 7160e64155..eb3ebe8e8b 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 e13749eef1..95e5c5d436 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 a6fa2f6b26..5b4b68b94d 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 9db10c665b..12fbe613ec 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 4544448afa..5694b66610 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 ce6ef7fa9b..6f52ab8e3e 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 ae7d58af43..12301763b6 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 dc1dc5c51c..e83ff23521 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 c9bf074296..8cad672a2d 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 dc915eec4f..868d786bdd 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 efa1319b92..d4d5f2011e 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 ef594bc757..f26dfc2b9c 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 d2766fcb0f..b8679b8020 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 9447b10d7e..d7738c9527 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 3a0e23e293..d18678dc4a 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 3e3b09b159..505aa3f6bc 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 b2ca68eb7f..d26b34565f 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 56569a8e04..b436e306ec 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 1f249589b5..975d9537a3 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 6fec403c7e..de4b1e9f14 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 6c9ba36462..b109cdcd6d 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 113f3d4910..9f5a3d9c33 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 dbe6421093..0000000000 --- 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 9f6a1df756..25d63e8b3a 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 a34e3749b9..34340bd3e1 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 51e2f501d8..ada52ec33c 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 49be202f58..b3e347fd5f 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 8c8686df69..ea09d9a3dd 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 5c18203da6..a4b7d6018a 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 55a115e2d4..6d9d28e0a7 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 80a3a1b80c..6f88b6a948 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 250e50c75c..4a5703f34a 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 cb45ad363a..4e540a7d20 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 53e2e0a458..5c2ef5823c 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 bcb780ae9a..2590481d3d 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 50df5a3a35..506201f5ba 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 6ffbec1d7a..936be8d79a 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 1d38301342..8412e2b667 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 4f7d5451d3..200546dd02 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 0d54f55d48..5af02f2cbe 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 13f74da0aa..2793790da6 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 5eed6a55ac..d8c4128bf4 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 a05f09a2fa..15ab9998a4 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 f5fdf08499..8ff31eb224 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 e106045cf9..d74bf8a6ae 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 76e8c829b1..053a53150a 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 1e6c9d3f9f..485f1a757e 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 5cda13aead..a9e9b97e48 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 4ac6a73348..ba216f20bf 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 573b1c54b3..170e8e2c9b 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 a9699262e4..1da1934391 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 4b700225e8..f93d915eca 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 9acab34ec6..2fcd856e62 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 9eb740031e..d4e681abe3 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 bd0c80565c..3e09c5e523 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 45c84b353b..2110548d81 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 7f88809354..ca63af0236 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 ae2f318b4c..29df40fbf3 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 72f1019cdc..8da5c1adb3 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 bb078da54c..1baf35219c 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 3803551a63..9fb45c609a 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 0439504c8c..f3ffc519c1 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 f2d06c527f..3ed39dfd7a 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 ee1313d4dc..92759852b5 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 e4f05b9abe..e92f639f8c 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 a7763c7a35..13b981b941 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 e1aa117b1c..9785904d11 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 b3a1a4ecc1..c43b889215 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 74e7157d45..80c64e2954 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 ee051a334e..d741971ca5 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 e41af64b5c..388d0ec21d 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 74478d3376..fb6f8521b4 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 0893d4be7f..5ff78ab1e5 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 64fefc1f73..758794d754 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 693c33643b..630f2e89b7 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 3ac235dcaf..69cc5ff3d3 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 776731753d..88a495abf5 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 32420d02e4..358fc9370e 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 269b7ce045..43eef92bef 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 f8dbdbdc3e..12c490b777 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 bd56e6bda2..a6572e537f 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 2f074204e9..0007c187e4 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 7e64034a49..d3fcbb4ce3 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 5b0b1e40ae..b11a4707e4 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 07e60b45ad..b9df018158 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 100b3fb0a7..dd2bb54909 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 6564db90d1..5dd52cfd49 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 e0a6eb783d..6a7e1c83db 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 4d3c6e5277..cf52db05c3 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 e1dfa25f9a..fe6348dd6d 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 ce44602bb6..d1c1b2ad2a 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 db031e1717..64365dfa48 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 e5ae5a0095..9c3bff5f2a 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 235a25f8fb..ae24f49208 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 5d9f1c4b15..dc7166db01 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 b23756f87c..4ac0d32e41 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 9c9391c498..2957d73aed 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 5b2f7745d0..e53dcb0b6d 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 53ead92e54..7037f83126 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 7c4b8687e3..0911834e61 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 2be0716c96..5025a024e0 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 f727716bb3..5ef81bb0ae 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 bdab9c3380..c9cde4b1b0 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 9fb40675df..6026dd17b4 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 c8b8b268f7..0489721509 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 a2b8184f9a..a46f14b9b1 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 b2a607f4e2..2cb58beffd 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 233ba4fb86..dca2fd1717 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 dc4b3c2288..271906d4a2 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 edf58821fc..b901b5314e 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 bd7971d5bb..e9f98b1cac 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 ebb1bcc83f..d1d1451e59 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 8f93ba48af..38bfb5075e 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 fa2dcb2606..ab4818effa 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 db95e9edea..f8a1df3d20 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 2839a209c3..3d679dccff 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 47e5f5e345..980afcd3e9 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 6195038690..d9dae6dcdb 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 17fd24fec7..0000000000 --- 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 0940539f54..0000000000 --- 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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 ddb091770e..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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 7842bbfeac..0000000000 --- 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 a04d179644..0000000000 --- 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 d683491a1f..0000000000 --- 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 006228975a..0000000000 --- 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 19b7da62f8..0000000000 --- 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 4715fe448f..0000000000 --- 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 72c129ca4e..7fa8a8263d 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 a0493b62ec..0000000000 --- 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 8137de62f6..f316363682 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 9ab3f8ea40..ab40da4b89 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 50c9936c44..37d4c9715f 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 29f375105f..739222190f 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 784e160483..0000000000 --- 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 a6381e92ba..0000000000 --- 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 c86e95a93a..0000000000 --- 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 1855230d2c..0000000000 --- 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 f71992aed7..0000000000 --- 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 88660bb3ae..0000000000 --- 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 e3fa23eff3..0000000000 --- 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 bec6687887..423cbb0c34 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 aad992058b..28662358c0 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 0ee9fbeb7c..109133a2b6 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 8f36c3a764..beccbcf59a 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 0dc7efaba8..daa15e5156 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 2406f18d01..d29d7865c4 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 1a00e8b2d5..1114d0081b 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 e606fc808d..0a48975f69 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 7df8b547b0..e269a621e1 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 949d077b9a..824df6f70d 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 985c1e20dc..cf7f48bb17 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 cd8c997e37..902991ab98 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 b885f35852..2cbefb79c1 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 ca8695f90e..f4e0dc98fd 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 b556209fcd..513a6c8c9c 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 d9632906f7..da8aa73cac 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 12abdf57c9..89fe6a5b17 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 d86ba7f2ad..8b9ed2e41a 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 a2feeb3726..e359b0b52c 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 7cce4ba3c6..5878e7b96e 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 297a19682e..4c7f45279b 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 cce36b18d5..a0cf72f022 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 6853658447..93ddad81d0 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 a333984f48..8a7150757a 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 f2fc531e76..b1b1459ee7 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 b624737c1b..fdb7d9df46 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 e0256a341d..7028c8bb33 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 b2bc75c703..3f53c7edfa 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 da9b841c1b..3bf2462489 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 765e4c6552..a40f0d47c0 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 3730a69e12..8092d835b3 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 98f3b17858..bec09daa5e 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 452ddb3c52..288b901f37 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 3492556e9a..a5186f3b65 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 b89b393ea7..0773459f5e 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 28b89a96cf..2f526c27e8 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 5ae9880292..e52c722b2c 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 04bc32bb88..9a4a216313 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 4002703b21..85885f238d 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 148943c06d..2df278bba0 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 8f3c4a539d..b942d1dfb3 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 4c071f7402..dea0e2c82a 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 cff6418b88..26e4d9600f 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 687e4938e4..6cfd9440f4 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 aecf7ef773..e00e74589a 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 ef70c03718..873b7a5fad 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 fdf57bb0af..2ea777d8c4 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 dc35d85acd..3cb40f68cf 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 008ccfaeeb..1f2f9a8d62 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 1bda3ed3d2..2058bbb224 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 71fd56e812..600dc7e8fa 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 88cec55802..7a58b4a1c4 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 a55e0d8e96..8fd99d5357 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 056fa247bc..db4ae5973d 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 f200ccb119..1340775876 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 0b59d5f6d3..3ed6dbf357 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 daf05bcf7e..791e169a01 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 bed0733813..d580afe766 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 b07d4d5082..d58ea7de6a 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 08bd4f6abd..ffb22c02f5 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 d0a503ca37..7c47cd3aa8 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 d280c8229c..b286661489 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 209c1bc092..31539c1653 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 c44619e313..39c0cbd8b1 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 db6f31186c..dbc4ad5f3d 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 8e2429af86..e6a50cc2df 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 68f0220540..d842b4d689 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 2b4af21e86..d1d887700b 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 a0defb43f1..abf53b4e2c 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 8a05cf7382..97df07e544 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 d218be939c..e580aea38b 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 eaae024b2b..6b6f5d1acf 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 2daa59c476..178569b4c4 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 b406d284ae..8ce3914180 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 914c9cfaa3..96fdcaf4e0 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 155aa38536..bc3b1738ce 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 9cbbadf4f1..fcc284989f 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 9cbc2c1489..c06bb4eeff 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 a86ed1ddb7..fdef487e48 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 0e74e57384..ea079c4938 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 4501a8fe37..5a4c7d9248 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 f9b8cbc344..f7349c93de 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 f9e1e7c393..8716f20cef 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 9f149b1949..e72e011c7a 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 e3ca75d02d..663786ff29 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 b581ca2b38..abef0a7ff7 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 551c790d53..661bb62ac7 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 66f5bcae6a..94c7d03723 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 a2abd43715..f56590f469 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 66f7b3990f..de1bdd57c7 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 fad6bb9dc9..6c4731ff1f 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 a6d5775463..a0ef16cc32 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 f3a3939a10..da72de2f51 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 8033b21fe8..14b1e82caa 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 0b40a12d04..a53836a7a4 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 b34b7f9923..2f47edaa25 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 87d6a01901..1bd9ef8970 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 b02d72d3cd..654062ed95 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 6ed540dcdd..8ca1b33a3d 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 f8365a1470..c5493d0ec6 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 c96e356e60..73607f6d7f 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 79c8bf3851..10dffda157 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 c589641dde..030c2dca2c 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 604bea9b6c..50a20e51b9 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 d4c6cccab3..d204e33e89 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 a7580c500a..0d58e8c134 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 62bbc4ebc7..5c0282f527 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 dd050ca81c..3915ffc761 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 5328d5e799..921ecb249a 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 20b4ee8381..3ece7e8d73 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 9df8949dac..986d9a4fe9 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 83a01ea56a..6bb9c81872 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 66d6e51009..294d4e6ed1 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 d6bce0d482..9824b80e0e 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 765ed74a64..6d0e3941e6 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 f271cfe479..14c74c6077 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 ee09382f23..8d3d77acd9 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 54a4e2265e..5513dddae0 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 444b45dce5..ed781d99c7 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 4df1b6acff..d67f3019f8 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 5dc2d264fa..00917177e8 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 8c5d93844d..bd9405b65b 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 ed43904a3f..3cbcb08a8f 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 40f7aa68d5..7c4f94535f 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 c824754eb1..dfa46ec0ec 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 6977c4e559..168781491f 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 34a3e0a2e8..4b8f9b33c5 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 daeaa970c5..d23b050cbc 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 27c0e25bbc..6db27a10d4 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 4c1ca19ef1..0a928be3a4 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 e78a6ac549..c5f9e6a3e3 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 4b44bd9832..69d5cefe80 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 34d44b5c72..f568f36213 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 e5a7464621..3f586a9446 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 a8ca8ca256..6dd24b7826 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 3cc1b41fca..7f759e8c97 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 28e5aa5722..cf037fc115 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 0b6e91eb02..f5b45233e1 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 05fd7845a3..290c70f2a9 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 73cf45267f..2c0056def4 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 dbf878f047..6ec63b58c8 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 578c9e69ce..8e61045810 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 6e72f1f91d..05db5eb70a 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 c195208d98..a3a0c4c7f5 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 bc3ee3b24f..1f8ddd2843 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 d37d05a9eb..8909c3598d 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 32df5d7412..a99f4378bb 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 8b222e3d3a..a0b62747ea 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 8e8091f5ff..b02021fbb6 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 370a842360..182247bf6f 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 90f8b3ae56..a0379d8800 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 0bdaef89ce..370bf19688 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 cebf23c64f..a1035d4da1 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 b526096c23..a0d569a509 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 08200ab8d9..67f62f3d36 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 f0e48baaae..a31cc1ebe6 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 5b70045309..6316ac8b3c 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 d1d3dcf9ed..1718b08fea 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 be41b85a6e..5c431cc735 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 71ca75cd65..9d26dc554a 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 db85b752d2..d3468aed0b 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 51a846808f..6244a2d537 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 29d6e93376..50cd7447ee 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 60a00ffe32..c05a446887 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 4b776488ad..f827631d62 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 b1d32e4b86..7a6de1dd26 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 a451f8840e..514d9400ab 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 474f9c913a..f8dd7f28e8 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 278887344a..3e9ee381ce 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 1c47096591..062b4900d4 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 02712da246..0c57b8dd9b 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 6ee579519a..02b5b9b7a8 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 facbde6d24..3d4dc77995 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 90033186c9..e95064e4f9 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 c840f3e847..e0afe0f431 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 63c41341ee..8446f9f2b1 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 8062d17c57..ae4185f86f 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 a316367172..b4d2d914f8 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 c2ac715ca8..09539fbbb8 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 c10ac1ee02..70ae90264b 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 12ab0f5fea..2666098734 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 2c6bdee435..75aae57b61 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 766058f463..686f7a2708 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 757a42aadf..9e17d98f8f 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 066242271d..a8ca84e664 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 c73b81cc18..9ffb54e7b7 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 b19385c107..83c2bb55c2 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 9b50d346d6..cd55f05377 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 164f51b2b5..7906b33f04 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 22e6a1fafc..2726e0537c 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 f9b4a77e31..56a3a3effb 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 68ecc69edb..59b45a8a80 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 0050f40313..2ce37aeea3 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 34bc3071cf..8940255709 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 6773d689c8..643231404a 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 6ace4da3fe..f2a579bef6 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 61ba6142ef..f8297f3b14 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 b6bc188d17..83ac59115c 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 54cbae7e85..00bb4439fb 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 4d7199e71e..f10937f2e2 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 d496d56fd0..f646898b93 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 712b7ca740..33ae346f0a 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 84fe7d1d03..ef4faaf2e0 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 6f1e2b9b0c..050aad09cf 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 f8b7c47592..9bffdadf10 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 1eaf045c1f..5d547a639e 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 0933aeb57c..65493af17c 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 8678b62e58..873421473e 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 5a8081c30b..d094d75e9f 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 d0eec2ea82..11ce8c62d8 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 dd68939008..c08daa0a85 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 1db1ef7da7..24a6d018db 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 7fad0bf329..9753b9b576 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 cb731e19de..8ba15e391c 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 bb5e71f5cd..0000000000 --- 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 17fd24fec7..0000000000 --- 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/CustomEnum.java b/spring-webmvc/src/test/java/org/springframework/beans/CustomEnum.java deleted file mode 100644 index 1e43492191..0000000000 --- a/spring-webmvc/src/test/java/org/springframework/beans/CustomEnum.java +++ /dev/null @@ -1,30 +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; - -/** - * @author Juergen Hoeller - */ -public enum CustomEnum { - - VALUE_1, VALUE_2; - - public String toString() { - return "CustomEnum: " + name(); - } - -} \ No newline at end of file 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 0940539f54..0000000000 --- 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/GenericBean.java b/spring-webmvc/src/test/java/org/springframework/beans/GenericBean.java deleted file mode 100644 index 00dd127e47..0000000000 --- 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 c5c4ed5e67..0000000000 --- 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 6a8f74187c..0000000000 --- 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 cdf5ef510d..0000000000 --- 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 ddb091770e..0000000000 --- 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 0eb8df5c8a..0000000000 --- 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 a78998ad5d..0000000000 --- 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 35d9c736c1..0000000000 --- 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/TestBean.java b/spring-webmvc/src/test/java/org/springframework/beans/TestBean.java deleted file mode 100644 index 7842bbfeac..0000000000 --- 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 006228975a..0000000000 --- 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 19b7da62f8..0000000000 --- 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 4715fe448f..0000000000 --- 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 3a77af2f71..ac3b91c5ff 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 72c129ca4e..7fa8a8263d 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 8137de62f6..f316363682 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 9ab3f8ea40..ab40da4b89 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 50c9936c44..37d4c9715f 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 29f375105f..739222190f 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 3d0bce4c84..0000000000 --- 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 070fa2dc42..0000000000 --- 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 9ae4f54ec2..0000000000 --- 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 ce3c45d2e7..0000000000 --- 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 cd81c78fa6..0000000000 --- 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 6a2d204d68..0000000000 --- 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 8169998a93..15a7e36fea 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 ff462f3650..0000000000 --- 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 c3dc6275e1..7276af86ae 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 a868f2f30d..9363468268 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 e25d331737..6080b76eb0 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 3a59552ded..b4d7c366f2 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 2e4938383b..5f178d50eb 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 7da590d1f2..eb7bf0f6ea 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 4002703b21..85885f238d 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 dd10e5fcab..89c42365d4 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 cca608e9f1..4dce1e9fac 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 96429a28cd..c6a5025c13 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 75af2c0b5a..07823327e6 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 cae1504005..b5b4f0206f 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 9eadbf6461..147875e4ca 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 dba9624609..f9ad57ba05 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 70c40be9fd..ce525f937d 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 e1c8898604..3f72adf22e 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 9ced7b5ddd..8ff997204f 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 6c43c1ea0f..b1433e2986 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 888cdfe9b2..0695958fa7 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 c14ad7735c..40f10ea7e6 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 6e018218fd..c8e3a860d7 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 d066e44525..ff3ebd962f 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 26b73b097f..da2da2e174 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 584e03d14c..208225c433 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 ac926b224f..3c40caacd6 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 1d48f052d5..1d37caff85 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 2384b320c0..62ac0171a6 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 cbf9da3061..6c495b31ab 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 bac4f505bb..45249d3e4b 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 22299a891f..1b941da624 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 cd36fa2508..bbfa7e2990 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 9bff022421..c0c7fce758 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 b88c10fa9f..b48a146501 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 f9c1b200c2..c963438df2 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 d13a82607b..dcd2e6ec3d 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 3f42bdd83a..00f6ea145c 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 307b6ab80d..e8025b835a 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 fce0eca69a..a0822913bc 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 bb2ee10976..15cdacd232 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 5c36b0989d..eb05fe9bba 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 ea7e21b24f..676e44729d 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 b97f1c034a..228ead8c9b 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 32ac81d668..33307032e5 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 eaabf4c2d9..fa7a9f8130 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 467fff6dcf..cd431d6154 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 1ff5a6303e..e0a515c3b0 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 e86b96b373..caa7fbcea6 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 43c8c22dd6..a15466aabc 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 813c7819a9..5f9869e1dc 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 85ab677a0a..315040419e 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 e42a2aa967..5c69b6f424 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 21ef1b1959..26e95d0c33 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 d1872128cb..6c5c7327e0 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 50d30583af..5365749ed5 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 f3c51db5a8..0b0afcee8d 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 22e924e600..3739046c59 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 18ae25f7e0..64de09b05a 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 852c95fd8a..fe492bab94 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 e229bac169..cb7b41e9d6 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 92b5d65487..d3d0547fba 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 2b0e15a4db..958f1755b4 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 84e940352a..4d5b846832 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 e4fce1213f..95a8e0ddf0 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 03c39fa8de..4af3a47cde 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 9dbbf6416f..1cec18763f 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 4d3e4c9f76..5ac42a02d0 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 51820dc839..f33101a3b8 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 d2205f8fcc..3c5f120759 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 8e737c2257..8aa294af9a 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 cbd498112e..fc6321a2c4 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 49d305cc4e..4231d24ad2 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 fc92aeaa46..d0113f95fe 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 3937e95dc1..edabd11d4f 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 4d9df5c648..f1b27c493e 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 e101be304b..a114680a94 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 431f85d03d..b471438f1e 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 1ac1ea619e..657aab3c24 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 96bae8946c..9ffeefbf2c 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 90cdd281d2..a36012bb60 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 f8023dffb2..3bd879a1ea 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 4058788ffd..613196224c 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 accbc09cf4..964e2d412f 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 242135cb76..c4787c0105 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 2c372aa6da..42190d39f8 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 8ac6039771..702e790c9a 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 dc9b9404e2..8dfc3e3e0c 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 075ea9e011..fd2674f9ab 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 965bd06a41..9c64ac0e26 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 e1a6a313d0..4ea337bbd7 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 44521f112d..bfa9bd8dbe 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 d3e02cc7c2..289fcbf064 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 46d34e7b33..e46aa5449e 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 d252550f18..d3c45fb249 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 1695bd0c54..654378cf36 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 117063f7af..b100a6a68e 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 286f628e22..3836559480 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 5f44339cbd..62ba99fb7b 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 c0b9938bb5..933b8e0129 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 8da83022c4..962b3fa33c 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 d3af0683f4..17a4c4f50c 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 d3a6bfab40..ff233b9be2 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 5638a35db6..f78a5f1b02 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 a4a9fb610a..5350f15999 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 85ce6ff5ff..3f248d1931 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 e35f3e93a8..2c509c4973 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 18e25e2cd8..0cd2f131f2 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 2200bd3f6f..7b32ec733c 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 0c38a3b2a8..88d83e4fcb 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 e91dc32e57..bbb12663c2 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 3bb3b30bd0..0ad16202a3 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 84060185ca..0ab3e04aaf 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 af86756cb4..4b3b6f0cd6 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 401c914230..63c320b73f 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 af090a253b..69f8ea613a 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 fb265453d9..04c8497df3 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 97dc0cb787..b07a53716e 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 5bf06837bf..4cdf72c4b3 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 d8a43ebf48..e17f0b0087 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 916e1f2fb1..ac1a396f65 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 2b96a0c3e3..c760d74441 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 7da590d1f2..eb7bf0f6ea 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 5315016977..ffe081c1e0 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 4be55f0ea7..49e480a664 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 231ae393a2..8a3c178627 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 4f9a0361c0..c5b04a53df 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 7b2f7d94a4..d2fbb3e1e0 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 b209a01d54..0f0fc64ac8 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 c1d74a88d2..b213a2a4e0 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 194c455f21..baa911c8f2 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 dab551d075..e0712b69c6 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 c4da57a4f8..f30afd1ca1 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 8901024548..8028a4cf0f 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 032ab7c6fb..366f338f11 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 0ddec74625..5fe702c3be 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 2970b5f0aa..aca10a3fb2 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 4b5aaa39de..0000000000 --- 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 6391a5328e..54511e7e7b 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 076f73b84c..a3b509d8a7 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/CountingBeforeAdvice.java b/src/test/java/test/advice/CountingBeforeAdvice.java deleted file mode 100644 index 3dc49faf24..0000000000 --- a/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/src/test/java/test/beans/Colour.java b/src/test/java/test/beans/Colour.java deleted file mode 100644 index 5be4dfa761..0000000000 --- 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 c452bdc1dd..0000000000 --- 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 951b732346..0000000000 --- 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 b0f9df9d9b..0000000000 --- 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 b62b5c8bf3..0000000000 --- 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 2c42a8cca5..0000000000 --- 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/NopInterceptor.java b/src/test/java/test/interceptor/NopInterceptor.java deleted file mode 100644 index 79158e74ea..0000000000 --- a/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/src/test/java/test/interceptor/SerializableNopInterceptor.java b/src/test/java/test/interceptor/SerializableNopInterceptor.java deleted file mode 100644 index c7b2acf82f..0000000000 --- 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 132bd33d4e..0000000000 --- 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()); - } - -}