Temp revert "Lazily instantiate shared Lettuce connection"

This reverts commit f9cdad751c.
This commit is contained in:
Jennifer Hickey
2013-08-19 12:14:43 -07:00
parent e94fa9a35a
commit c6a2a4f7da
2 changed files with 18 additions and 8 deletions

View File

@@ -174,21 +174,18 @@ public class LettuceConnectionFactoryTests {
assertNotSame(nativeConn, factory.getConnection().getNativeConnection());
}
public void testGetConnectionException() {
@Test(expected=RedisConnectionFailureException.class)
public void testInitConnectionException() {
factory.setHostName("fakeHost");
factory.afterPropertiesSet();
try {
factory.getConnection();
fail("Expected connection failure exception");
} catch(RedisConnectionFailureException e) {
}
}
@Test
public void testGetConnectionNotSharedBadHostname() {
@Test(expected=RedisConnectionFailureException.class)
public void testGetConnectionSharedException() {
factory.setShareNativeConnection(false);
factory.setHostName("fakeHost");
factory.afterPropertiesSet();
factory.setShareNativeConnection(true);
factory.getConnection();
}
@@ -200,6 +197,15 @@ 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(),