Search in sources :

Example 6 with StackType

use of org.jgroups.util.StackType in project JGroups by belaban.

the class TCPGOSSIP_Test method startRouter.

@BeforeClass
void startRouter() throws Exception {
    String tmp = Util.getProperty(Global.BIND_ADDR);
    if (tmp == null) {
        StackType type = Util.getIpStackType();
        tmp = type == StackType.IPv6 ? "::1" : "127.0.0.1";
    }
    bind_addr = InetAddress.getByName(tmp);
    gossip_router_port = ResourceManager.getNextTcpPort(bind_addr);
    gossipRouter = new GossipRouter(null, gossip_router_port);
    gossipRouter.start();
}
Also used : StackType(org.jgroups.util.StackType) GossipRouter(org.jgroups.stack.GossipRouter) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with StackType

use of org.jgroups.util.StackType in project JGroups by belaban.

the class TUNNELDeadLockTest method setUp.

@BeforeMethod
void setUp() throws Exception {
    StackType type = Util.getIpStackType();
    if (type == StackType.IPv6)
        bind_addr = "::1";
    else
        bind_addr = "127.0.0.1";
    promise = new Promise<>();
    gossip_router_port = ResourceManager.getNextTcpPort(InetAddress.getByName(bind_addr));
    gossip_router_hosts = bind_addr + "[" + gossip_router_port + "]";
    gossipRouter = new GossipRouter(bind_addr, gossip_router_port).useNio(false);
    gossipRouter.start();
}
Also used : StackType(org.jgroups.util.StackType) GossipRouter(org.jgroups.stack.GossipRouter) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 8 with StackType

use of org.jgroups.util.StackType in project JGroups by belaban.

the class TUNNEL_Test method startRouter.

@BeforeClass
void startRouter() throws Exception {
    StackType type = Util.getIpStackType();
    String bind_addr_str = type == StackType.IPv6 ? "::1" : "127.0.0.1";
    gossip_router_bind_addr = InetAddress.getByName(bind_addr_str);
    gossip_router_port = ResourceManager.getNextTcpPort(gossip_router_bind_addr);
    gossip_router_hosts = gossip_router_bind_addr.getHostAddress() + "[" + gossip_router_port + "]";
    gossipRouter = new GossipRouter(bind_addr_str, gossip_router_port);
    gossipRouter.start();
}
Also used : StackType(org.jgroups.util.StackType) GossipRouter(org.jgroups.stack.GossipRouter) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with StackType

use of org.jgroups.util.StackType in project JGroups by belaban.

the class GossipRouterTest method setUp.

@BeforeClass
protected void setUp() throws Exception {
    StackType type = Util.getIpStackType();
    bind_addr_str = type == StackType.IPv6 ? "::1" : "127.0.0.1";
    bind_addr = InetAddress.getByName(bind_addr_str);
    gossip_router_port = ResourceManager.getNextTcpPort(bind_addr);
    gossip_router_hosts = bind_addr.getHostAddress() + "[" + gossip_router_port + "]";
}
Also used : StackType(org.jgroups.util.StackType) BeforeClass(org.testng.annotations.BeforeClass)

Example 10 with StackType

use of org.jgroups.util.StackType in project JGroups by belaban.

the class IpAddressTest method setUp.

@BeforeClass
void setUp() throws Exception {
    StackType type = Util.getIpStackType();
    if (type == StackType.IPv6) {
        a = new IpAddress("::1", 5555);
        b = new IpAddress("::1", 5555);
        d = new IpAddress("::1", 5556);
        e = new IpAddress("::1", 5555);
        f = new IpAddress("2001:0db8:0000:0000:0000:002e:0370:2334", 80);
        g = new IpAddress("2001:0db8:0000:0000:0000:002e:0370:2334", 8080);
        h = new IpAddress("ff0e::3:4:5", 5555);
        j = new IpAddressUUID("::1", 5555);
        k = new IpAddressUUID("::1", 5555);
    } else {
        a = new IpAddress("localhost", 5555);
        b = new IpAddress("localhost", 5555);
        d = new IpAddress("localhost", 5556);
        e = new IpAddress("127.0.0.1", 5555);
        f = new IpAddress("www.ibm.com", 80);
        g = new IpAddress("www.ibm.com", 8080);
        h = new IpAddress("224.0.0.1", 5555);
        j = new IpAddressUUID("localhost", 5555);
        k = new IpAddressUUID("localhost", 5555);
    }
    c = b;
}
Also used : StackType(org.jgroups.util.StackType) IpAddress(org.jgroups.stack.IpAddress) IpAddressUUID(org.jgroups.stack.IpAddressUUID) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

StackType (org.jgroups.util.StackType)10 BeforeClass (org.testng.annotations.BeforeClass)4 InetAddress (java.net.InetAddress)3 GossipRouter (org.jgroups.stack.GossipRouter)3 Inet4Address (java.net.Inet4Address)2 Inet6Address (java.net.Inet6Address)2 IpAddress (org.jgroups.stack.IpAddress)2 Address (org.jgroups.Address)1 IpAddressUUID (org.jgroups.stack.IpAddressUUID)1 BeforeMethod (org.testng.annotations.BeforeMethod)1