source: java/main/src/test/java/com/framsticks/gui/LocalTreeBrowserTest.java @ 105

Last change on this file since 105 was 105, checked in by psniegowski, 11 years ago

HIGHLIGHTS:

  • import refactorization: move Tree, Path, etc.

from core to structure package

  • initial serialization implementation
  • improve PrimeExperiment? test
  • many organizational changes and convenience improvements

CHANGELOG:
Make registry in AbstractTree? final.

Move most classes from core to structure package.

Minor changes.

Switch names of Future and FutureHandler?.

Rename ExceptionResultHandler? to ExceptionHandler?.

Rename ExceptionHandler? to ExceptionDispatcherHandler?.

Fix bug in ParamCandidate? cache.

Add missing synchronization to the BufferedDispatcher?.

Develop @Serialized support.

Rework serialization further.

Add serialization/deserialization interface to ValueParam?.

Move getStorageType and isNumeric from Param down to params hierarchy.

Minor changes.

Improve param type induction.

Add TestSerializedClass? for testing new serialization.

Add info files gor GenePool? and Population.

Add standard.expt exemplary netfile.

Add type name field to PropertiesObject?.

Use PropertiesObject? for PropertiesAccess? instead of ordinary map.

Hide getFramsClass is several more places.

More unification accross FramsClass?, Access and Path.

Add ParamCollection?.

Simplify interface for getting params from FramsClass?, Access
or Path.

Make Access.call() interface variadic.

Add arguments(args) convenience wrapper around new Object[] {args}.

Upgrade to apache.commons.lang version 3.1

Minor improvement with Response constructors.

Develop proper result printing in ClientAtServer?.

Add experimentNetsave to PrimeExperiment?.

File size: 1.5 KB
Line 
1package com.framsticks.gui;
2
3import static org.fest.assertions.Assertions.assertThat;
4
5import org.testng.annotations.Test;
6
7import com.framsticks.model.Model;
8import com.framsticks.params.types.FloatParam;
9import com.framsticks.parsers.XmlLoader;
10import com.framsticks.structure.LocalTree;
11import com.framsticks.structure.Tree;
12import com.framsticks.util.dispatching.RunAt;
13
14import static com.framsticks.params.ParamsUtil.getParam;
15import static com.framsticks.structure.TreeOperations.*;
16
17@Test
18public class LocalTreeBrowserTest extends BrowserBaseTest {
19
20        LocalTree tree;
21
22        @Override
23        protected void configureBrowser() {
24                browser = new XmlLoader().load(Browser.class, getClass().getResourceAsStream("/configs/LocalTreeBrowserTest.xml"));
25
26                assertThat(browser.getTrees().size()).isEqualTo(1);
27                assertThat(browser.getTrees().get("model")).isInstanceOf(LocalTree.class);
28
29                tree = (LocalTree) browser.getTrees().get("model");
30        }
31
32        @Test(timeOut = 30000)
33        public void testShow() {
34                tree.dispatch(new RunAt<Tree>(failOnException) {
35                        @Override
36                        protected void runAt() {
37                                assertThat(tree.getRootObject()).isInstanceOf(Model.class);
38                        }
39                });
40
41                clickAndExpandPath("model");
42                clickAndExpandPath("model/parts");
43                clickAndExpandPath("model/parts/2");
44
45                tree.dispatch(new RunAt<Tree>(failOnException) {
46                        @Override
47                        protected void runAt() {
48                                assertThat(getParam(bindAccess(tree, "/parts/2"), "m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
49                        }
50                });
51
52        }
53
54
55}
Note: See TracBrowser for help on using the repository browser.