Revert "Temp revert "Lazily instantiate shared Lettuce connection""
This reverts commit c6a2a4f7da.
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user