use of org.infinispan.server.test.junit4.InfinispanServerRule in project infinispan by infinispan.
the class StartupFailureIT method testAddressAlreadyBound.
@Test
public void testAddressAlreadyBound() throws Throwable {
try (ServerSocket serverSocket = new ServerSocket(11222)) {
AtomicBoolean ran = new AtomicBoolean();
InfinispanServerRule rule = InfinispanServerRuleBuilder.server(false);
Statement serverStatement = rule.apply(new Statement() {
@Override
public void evaluate() throws Throwable {
ran.set(true);
}
}, Description.createTestDescription(StartupFailureIT.class, "testAddressAlreadyBound"));
try {
serverStatement.evaluate();
} catch (Throwable e) {
// Expected?
}
assertFalse(ran.get());
}
}
Aggregations