Revert "Temp revert "Lazily instantiate shared Lettuce connection""

This reverts commit c6a2a4f7da.
This commit is contained in:
Jennifer Hickey
2013-08-21 12:38:02 -07:00
parent b106f03bd7
commit 5d00542741
2 changed files with 8 additions and 18 deletions

View File

@@ -174,18 +174,21 @@ public class LettuceConnectionFactoryTests {
assertNotSame(nativeConn, factory.getConnection().getNativeConnection());
}
@Test(expected=RedisConnectionFailureException.class)
public void testInitConnectionException() {
public void testGetConnectionException() {
factory.setHostName("fakeHost");
factory.afterPropertiesSet();
try {
factory.getConnection();
fail("Expected connection failure exception");
} catch(RedisConnectionFailureException e) {
}
}
@Test(expected=RedisConnectionFailureException.class)
public void testGetConnectionSharedException() {
@Test
public void testGetConnectionNotSharedBadHostname() {
factory.setShareNativeConnection(false);
factory.setHostName("fakeHost");
factory.afterPropertiesSet();
factory.setShareNativeConnection(true);
factory.getConnection();
}
@@ -197,15 +200,6 @@ public class LettuceConnectionFactoryTests {
assertNull(factory.getSharedConnection());
}
@Test(expected=RedisConnectionFailureException.class)
public void testGetSharedConnectionSharedException() {
factory.setShareNativeConnection(false);
factory.setHostName("fakeHost");
factory.afterPropertiesSet();
factory.setShareNativeConnection(true);
factory.getSharedConnection();
}
@Test
public void testCreateFactoryWithPool() {
DefaultLettucePool pool = new DefaultLettucePool(SettingsUtils.getHost(),