mhansonp commented on code in PR #7608:
URL: https://github.com/apache/geode/pull/7608#discussion_r854670769
##########
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java:
##########
@@ -50,81 +46,63 @@ public class DurableClientBug39997DUnitTest extends
JUnit4CacheTestCase {
@Override
public final void postTearDownCacheTestCase() {
-
Host.getHost(0).getVM(0).invoke(JUnit4DistributedTestCase::disconnectFromDS);
+ VM.getVM(0).invoke(JUnit4DistributedTestCase::disconnectFromDS);
}
@Test
public void testNoServerAvailableOnStartup() {
Host host = Host.getHost(0);
- VM vm0 = host.getVM(0);
- VM vm1 = host.getVM(1);
+ VM vm0 = VM.getVM(0);
+ VM vm1 = VM.getVM(1);
- final String hostName = NetworkUtils.getServerHostName(host);
+ final String hostName = VM.getHostName();
final int port = AvailablePortHelper.getRandomAvailableTCPPort();
- vm0.invoke(new SerializableRunnable("create cache") {
- @Override
- public void run() {
- getSystem(getClientProperties());
- PoolImpl p = (PoolImpl)
PoolManager.createFactory().addServer(hostName, port)
- .setSubscriptionEnabled(true).setSubscriptionRedundancy(0)
- .create("DurableClientReconnectDUnitTestPool");
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.LOCAL);
- factory.setPoolName(p.getName());
- Cache cache = getCache();
- Region region1 = cache.createRegion("region", factory.create());
- cache.readyForEvents();
+ vm0.invoke("create cache", () -> {
+ getSystem(getClientProperties());
+ PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(hostName,
port)
+ .setSubscriptionEnabled(true).setSubscriptionRedundancy(0)
+ .create("DurableClientReconnectDUnitTestPool");
+ Cache cache = getCache();
+ RegionFactory regionFactory = cache.createRegionFactory();
+ regionFactory.setScope(Scope.LOCAL);
+ regionFactory.setPoolName(p.getName());
+ Region region1 = regionFactory.create("region");
- try {
- region1.registerInterest("ALL_KEYS");
- fail("Should have received an exception trying to register
interest");
- } catch (NoSubscriptionServersAvailableException expected) {
- // this is expected
- }
+ try {
+ region1.registerInterestForAllKeys();
+ fail("Should have received an exception trying to register interest");
+ } catch (NoSubscriptionServersAvailableException expected) {
+ // this is expected
}
+ cache.readyForEvents();
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]