diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-06-04 21:12:52 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-06-04 21:12:52 +0000 |
commit | 98aecc09773c0403e7388efdd93d4b468994014a (patch) | |
tree | 5b6aa9341eaac2d014344353965243f29c8aa427 /src/test/java/org | |
parent | 569b0812112db3f4e03306f885ded361d47b4ba9 (diff) | |
download | gnunet-java-98aecc09773c0403e7388efdd93d4b468994014a.tar.gz gnunet-java-98aecc09773c0403e7388efdd93d4b468994014a.zip |
rename mesh to cadet
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/gnunet/cadet/CadetTest.java (renamed from src/test/java/org/gnunet/cadet/MeshTest.java) | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/java/org/gnunet/cadet/MeshTest.java b/src/test/java/org/gnunet/cadet/CadetTest.java index 18ae9f6..667b1e6 100644 --- a/src/test/java/org/gnunet/cadet/MeshTest.java +++ b/src/test/java/org/gnunet/cadet/CadetTest.java | |||
@@ -1,4 +1,4 @@ | |||
1 | package org.gnunet.mesh; | 1 | package org.gnunet.cadet; |
2 | 2 | ||
3 | import org.gnunet.core.Core; | 3 | import org.gnunet.core.Core; |
4 | import org.gnunet.core.PeerIdentityContinuation; | 4 | import org.gnunet.core.PeerIdentityContinuation; |
@@ -12,10 +12,10 @@ import org.junit.Test; | |||
12 | * | 12 | * |
13 | * @author Florian Dold | 13 | * @author Florian Dold |
14 | */ | 14 | */ |
15 | public class MeshTest extends TestingFixture { | 15 | public class CadetTest extends TestingFixture { |
16 | public static class MessageHandler1 extends MeshRunabout { | 16 | public static class MessageHandler1 extends CadetRunabout { |
17 | public Mesh m1; | 17 | public Cadet m1; |
18 | public Mesh m2; | 18 | public Cadet m2; |
19 | public void visit(TestMessage m) { | 19 | public void visit(TestMessage m) { |
20 | System.out.println("got test message"); | 20 | System.out.println("got test message"); |
21 | m1.destroy(); | 21 | m1.destroy(); |
@@ -24,11 +24,11 @@ public class MeshTest extends TestingFixture { | |||
24 | } | 24 | } |
25 | 25 | ||
26 | public static class MyChannelEndHandler implements ChannelEndHandler { | 26 | public static class MyChannelEndHandler implements ChannelEndHandler { |
27 | Mesh mesh1; | 27 | Cadet cadet1; |
28 | PeerIdentity peerIdentity; | 28 | PeerIdentity peerIdentity; |
29 | @Override | 29 | @Override |
30 | public void onChannelEnd(Mesh.Channel channel) { | 30 | public void onChannelEnd(Cadet.Channel channel) { |
31 | Mesh.Channel myChannel = mesh1.createChannel(peerIdentity, 42, false, true); | 31 | Cadet.Channel myChannel = cadet1.createChannel(peerIdentity, 42, false, true); |
32 | myChannel.send(new TestMessage()); | 32 | myChannel.send(new TestMessage()); |
33 | } | 33 | } |
34 | } | 34 | } |
@@ -37,9 +37,9 @@ public class MeshTest extends TestingFixture { | |||
37 | * Send a message locally, to our own peer. | 37 | * Send a message locally, to our own peer. |
38 | */ | 38 | */ |
39 | @Test (timeout = 5000) | 39 | @Test (timeout = 5000) |
40 | public void test_mesh_send() { | 40 | public void test_cadet_send() { |
41 | Program.configureLogging("DEBUG"); | 41 | Program.configureLogging("DEBUG"); |
42 | // we want the full arm here (starts both mesh and core) | 42 | // we want the full arm here (starts both cadet and core) |
43 | final TestingSubsystem ts = new TestingSubsystem("arm"); | 43 | final TestingSubsystem ts = new TestingSubsystem("arm"); |
44 | final Configuration cfg = ts.getConfiguration(); | 44 | final Configuration cfg = ts.getConfiguration(); |
45 | 45 | ||
@@ -51,25 +51,25 @@ public class MeshTest extends TestingFixture { | |||
51 | System.out.println("got peer identity from core"); | 51 | System.out.println("got peer identity from core"); |
52 | // | 52 | // |
53 | MyChannelEndHandler teh = new MyChannelEndHandler(); | 53 | MyChannelEndHandler teh = new MyChannelEndHandler(); |
54 | // first mesh handle, used to send the message | 54 | // first cadet handle, used to send the message |
55 | final Mesh mesh1 = new Mesh(cfg, teh); | 55 | final Cadet cadet1 = new Cadet(cfg, teh); |
56 | teh.mesh1 = mesh1; | 56 | teh.cadet1 = cadet1; |
57 | teh.peerIdentity = peerIdentity; | 57 | teh.peerIdentity = peerIdentity; |
58 | // second mesh handle, used to receive the message | 58 | // second cadet handle, used to receive the message |
59 | final Mesh mesh2 = new Mesh(cfg, new InboundChannelHandler() { | 59 | final Cadet cadet2 = new Cadet(cfg, new InboundChannelHandler() { |
60 | @Override | 60 | @Override |
61 | public void onInboundChannel(Mesh.Channel tunnel, PeerIdentity initiator) { | 61 | public void onInboundChannel(Cadet.Channel tunnel, PeerIdentity initiator) { |
62 | System.out.println("got inbound channel " + initiator); | 62 | System.out.println("got inbound channel " + initiator); |
63 | } | 63 | } |
64 | }, new ChannelEndHandler() { | 64 | }, new ChannelEndHandler() { |
65 | @Override | 65 | @Override |
66 | public void onChannelEnd(Mesh.Channel tunnel) { | 66 | public void onChannelEnd(Cadet.Channel tunnel) { |
67 | System.out.println("channel end handler called"); | 67 | System.out.println("channel end handler called"); |
68 | } | 68 | } |
69 | }, mh, 42); | 69 | }, mh, 42); |
70 | mh.m1 = mesh1; | 70 | mh.m1 = cadet1; |
71 | mh.m2 = mesh2; | 71 | mh.m2 = cadet2; |
72 | Mesh.Channel channel = mesh1.createChannel(peerIdentity, 42, false, true); | 72 | Cadet.Channel channel = cadet1.createChannel(peerIdentity, 42, false, true); |
73 | channel.send(new TestMessage()); | 73 | channel.send(new TestMessage()); |
74 | } | 74 | } |
75 | }); | 75 | }); |