mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-07 22:52:40 -04:00
use tomp2p master branch
This commit is contained in:
parent
79a52a6e38
commit
d943ee0918
14 changed files with 40 additions and 952 deletions
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
|||
import java.security.KeyPair;
|
||||
import java.security.KeyPairGenerator;
|
||||
import java.util.Random;
|
||||
import net.tomp2p.connection.Ports;
|
||||
import net.tomp2p.dht.FutureGet;
|
||||
import net.tomp2p.dht.FuturePut;
|
||||
import net.tomp2p.dht.FutureRemove;
|
||||
|
@ -29,7 +30,7 @@ public class P2PNodeTest
|
|||
@Test
|
||||
public void testSendData() throws Exception
|
||||
{
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, 41001);
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, new Ports().tcpPort());
|
||||
PeerDHT master = peers[0];
|
||||
PeerDHT client = peers[1];
|
||||
PeerDHT otherPeer = peers[2];
|
||||
|
@ -66,12 +67,14 @@ public class P2PNodeTest
|
|||
assertTrue(futureDirect.isSuccess());
|
||||
// we return true from objectDataReply
|
||||
assertTrue((Boolean) futureDirect.object());
|
||||
|
||||
master.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProtectedPutGet() throws Exception
|
||||
{
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, 41001);
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, new Ports().tcpPort());
|
||||
PeerDHT master = peers[0];
|
||||
PeerDHT client = peers[1];
|
||||
PeerDHT otherPeer = peers[2];
|
||||
|
@ -157,7 +160,7 @@ public class P2PNodeTest
|
|||
@Test
|
||||
public void testAddToListGetList() throws Exception
|
||||
{
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, 41001);
|
||||
PeerDHT[] peers = UtilsDHT2.createNodes(3, rnd, new Ports().tcpPort());
|
||||
PeerDHT master = peers[0];
|
||||
PeerDHT client = peers[1];
|
||||
PeerDHT otherPeer = peers[2];
|
||||
|
@ -367,7 +370,6 @@ public class P2PNodeTest
|
|||
assertTrue(foundData3);
|
||||
assertEquals(2, futureGet.dataMap().values().size());
|
||||
|
||||
|
||||
master.shutdown();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue