Package tahrir

Examples of tahrir.TrNodeConfig


    final TrNetworkInterface iface1 = new UdpNetworkInterface(udpNetIfaceConf1, kp1);

    final TrNetworkInterface iface2 = new UdpNetworkInterface(udpNetIfaceConf2, kp2);

    final TrNodeConfig trCfg1 = new TrNodeConfig();
    setTrConfig(trCfg1);

    final TrNodeConfig trCfg2 = new TrNodeConfig();
    setTrConfig(trCfg2);

    final TrNode node1 = new TrNode(TestUtils.createTempDirectory(), trCfg1);
    final TrSessionManager sessionMgr1 = new TrSessionManager(node1, iface1, false);
View Full Code Here


    public static TrNode makeNode(final int port, final boolean maintenance, final boolean assimilate,
        final boolean topologyMaintenace, final boolean broadcast,
        final int minPeers, final int maxPeers) throws Exception {
      final File nodeDir = createTempDirectory();

      final TrNodeConfig nodeConfig = new TrNodeConfig();

      nodeConfig.udp.listenPort = port;
      nodeConfig.localHostName = "127.0.0.1";
      nodeConfig.peers.runMaintainance = maintenance;
      nodeConfig.peers.assimilate = assimilate;
View Full Code Here

    @Test
  public void twoPeerTest() throws Exception {
    System.out.println("Joiner (7644) will assimilate to seed (7643)");

    final TrNodeConfig seedConfig = new TrNodeConfig();
    seedConfig.capabilities.allowsAssimilation = true;
    seedConfig.capabilities.allowsUnsolicitiedInbound = true;
    seedConfig.peers.runMaintainance = false;
    seedConfig.peers.runBroadcast = false;
    seedConfig.localHostName = "localhost";
    seedConfig.udp.listenPort = 7643;
    final File seedDir = TestUtils.createTempDirectory();
    final TrNode seedNode = new TrNode(seedDir, seedConfig);
    final RemoteNodeAddress seedPublicNodeId = seedNode.getRemoteNodeAddress();

    final File joinerDir = TestUtils.createTempDirectory();

    final TrNodeConfig joinerConfig = new TrNodeConfig();

    joinerConfig.udp.listenPort = 7644;
    joinerConfig.localHostName = "localhost";
    joinerConfig.peers.runMaintainance = true;
    joinerConfig.peers.topologyMaintenance = false;
View Full Code Here

    Assert.assertTrue(seedNode.getPeerManager().peers.containsKey(joinerNode.getRemoteNodeAddress().physicalLocation), "The seed peer manager should contain the joiner peer");
  }

    @Test(enabled = false) // This launches the GUI, it shouldn't.
    public void threePeerTest() throws Exception{
        final TrNodeConfig seedConfig = new TrNodeConfig();
        seedConfig.capabilities.allowsAssimilation = true;
        seedConfig.capabilities.allowsUnsolicitiedInbound = true;
        seedConfig.peers.runMaintainance = false;
        seedConfig.peers.runBroadcast = false;
        seedConfig.localHostName = "localhost";
        seedConfig.udp.listenPort = 7643;
        final File seedDir = TestUtils.createTempDirectory();
        final TrNode seedNode = new TrNode(seedDir, seedConfig);
        final RemoteNodeAddress seedPublicNodeId = seedNode.getRemoteNodeAddress();

        final File joinerDir = TestUtils.createTempDirectory();

        final TrNodeConfig joinerConfig = new TrNodeConfig();

        joinerConfig.udp.listenPort = 7644;
        joinerConfig.localHostName = "localhost";
        joinerConfig.peers.runMaintainance = true;
        joinerConfig.peers.topologyMaintenance = true;
        joinerConfig.peers.runBroadcast = true;
        joinerConfig.capabilities.allowsAssimilation = true;
        joinerConfig.capabilities.allowsUnsolicitiedInbound = false;
        joinerConfig.capabilities.receivesMessageBroadcasts = true;

        final File joinerPubNodeIdsDir = new File(joinerDir, joinerConfig.publicNodeIdsDir);

        joinerPubNodeIdsDir.mkdir();

        final File joinerDir2 = TestUtils.createTempDirectory();

        final TrNodeConfig joinerConfig2 = new TrNodeConfig();

        joinerConfig2.udp.listenPort = 7645;
        joinerConfig2.localHostName = "localhost";
        joinerConfig2.peers.runMaintainance = true;
        joinerConfig2.peers.topologyMaintenance = true;
View Full Code Here

TOP

Related Classes of tahrir.TrNodeConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.