Register JndiPropertySource by default in servlet environments

Prior to this change, StandardServletEnvironment evaluated a
"jndiPropertySourceEnabled" flag to determine whether or not to add a
JndiPropertySource.  Following the changes introduced in SPR-8490, there
is now no reason not to enable a JNDI property source by default. This
change eliminates the support for "jndiPropertySourceEnabled" and adds
a JndiPropertySource automatically.

Issue: SPR-8545, SPR-8490
This commit is contained in:
Chris Beams
2011-08-20 03:02:31 +00:00
parent 76bf72c9f8
commit 6db594c79d
4 changed files with 21 additions and 91 deletions

View File

@@ -36,7 +36,7 @@ public class JndiPropertySourceTests {
@Test
public void nonExistentProperty() {
JndiPropertySource ps = new JndiPropertySource();
JndiPropertySource ps = new JndiPropertySource("jndiProperties");
assertThat(ps.getProperty("bogus"), nullValue());
}
@@ -55,7 +55,7 @@ public class JndiPropertySourceTests {
jndiLocator.setResourceRef(true);
jndiLocator.setJndiTemplate(jndiTemplate);
JndiPropertySource ps = new JndiPropertySource(jndiLocator);
JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
assertThat((String)ps.getProperty("p1"), equalTo("v1"));
}
@@ -74,7 +74,7 @@ public class JndiPropertySourceTests {
jndiLocator.setResourceRef(true);
jndiLocator.setJndiTemplate(jndiTemplate);
JndiPropertySource ps = new JndiPropertySource(jndiLocator);
JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
assertThat((String)ps.getProperty("p1"), equalTo("v1"));
}