source: java/main/src/test/java/com/framsticks/gui/console/TrackConsoleTest.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1package com.framsticks.gui.console;
2
3import org.testng.annotations.Test;
4
5import com.framsticks.gui.GuiTest;
6import com.framsticks.remote.RemoteTree;
7import com.framsticks.structure.Path;
8import com.framsticks.util.dispatching.Dispatching;
9import com.framsticks.util.dispatching.Dispatching.Waiter;
10import com.framsticks.util.dispatching.Future;
11import com.framsticks.util.dispatching.Joinable;
12import com.framsticks.util.dispatching.JoinableCollection;
13
14import static com.framsticks.structure.TreeOperations.*;
15
16@Test
17public class TrackConsoleTest extends GuiTest {
18
19        RemoteTree tree;
20        TrackConsole console;
21        JoinableCollection<Joinable> joinables;
22
23        @Override
24        protected Joinable createSubject() {
25                tree = new RemoteTree();
26
27                tree.setAddress("localhost:9009");
28
29                console = new TrackConsole().setConnection(tree.getConnection());
30                joinables = new JoinableCollection<>();
31                joinables.setObservableName("tree and console");
32                joinables.add(tree);
33                joinables.add(console);
34
35                return joinables;
36        }
37
38        @Test
39        public void testCommunication() {
40                Dispatching.sleep(2.0);
41                final Waiter waiter = produceWaiter(1.0);
42
43                tryGet(tree, "/simulator/genepools/groups/0", new Future<Path>(failOnException) {
44
45                        @Override
46                        protected void result(Path result) {
47                                waiter.pass();
48
49                        }
50                });
51                Dispatching.sleep(2.0);
52        }
53
54        @Test(dependsOnMethods = "testCommunication")
55        public void justWait() {
56                Dispatching.sleep(2.0);
57        }
58}
Note: See TracBrowser for help on using the repository browser.