Search in sources :

Example 1 with FirewallingNetworkingInstanceConstructor

use of com.hazelcast.test.starter.constructor.FirewallingNetworkingInstanceConstructor in project hazelcast by hazelcast.

the class FirewallingConnectionManagerConstructorTest method testConstructor.

@Test
public void testConstructor() throws Exception {
    Server delegate = mock(Server.class);
    Address address = new Address("172.16.16.1", 4223);
    Set<Address> blockedAddresses = Collections.singleton(address);
    FirewallingServer ns = new FirewallingServer(delegate, blockedAddresses);
    FirewallingNetworkingInstanceConstructor constructor = new FirewallingNetworkingInstanceConstructor(FirewallingServer.class);
    FirewallingServer clonedConnectionManager = (FirewallingServer) constructor.createNew(ns);
    assertEquals(delegate, getFieldValueReflectively(clonedConnectionManager, "delegate"));
    assertEquals(blockedAddresses, getFieldValueReflectively(clonedConnectionManager, "blockedAddresses"));
}
Also used : FirewallingServer(com.hazelcast.internal.server.FirewallingServer) Server(com.hazelcast.internal.server.Server) FirewallingServer(com.hazelcast.internal.server.FirewallingServer) Address(com.hazelcast.cluster.Address) FirewallingNetworkingInstanceConstructor(com.hazelcast.test.starter.constructor.FirewallingNetworkingInstanceConstructor) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

Address (com.hazelcast.cluster.Address)1 FirewallingServer (com.hazelcast.internal.server.FirewallingServer)1 Server (com.hazelcast.internal.server.Server)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 FirewallingNetworkingInstanceConstructor (com.hazelcast.test.starter.constructor.FirewallingNetworkingInstanceConstructor)1 Test (org.junit.Test)1