Changeset 105 for java/main/src/test


Ignore:
Timestamp:
09/10/13 21:11:41 (11 years ago)
Author:
psniegowski
Message:

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?.

Location:
java/main/src/test
Files:
5 added
18 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/test/java/com/framsticks/core/ListChangeTest.java

    r102 r105  
    66import org.testng.annotations.Test;
    77
    8 import com.framsticks.core.ListChange.Action;
    98import static com.framsticks.params.AccessOperations.*;
    109import com.framsticks.params.FramsClass;
     
    1211import com.framsticks.params.ListSource;
    1312import com.framsticks.params.ReflectionAccess;
     13import com.framsticks.structure.messages.ListChange;
     14import com.framsticks.structure.messages.ListChange.Action;
    1415import com.framsticks.test.TestConfiguration;
    1516
  • java/main/src/test/java/com/framsticks/core/LocalTreeTest.java

    r100 r105  
    1212import com.framsticks.model.f0.Schema;
    1313import com.framsticks.model.f0.SchemaBuilder;
     14import com.framsticks.structure.LocalTree;
     15import com.framsticks.structure.Path;
     16import com.framsticks.structure.Tree;
     17import com.framsticks.structure.TreeOperations;
    1418import com.framsticks.test.TestConfiguration;
    1519import com.framsticks.util.dispatching.Dispatching;
     
    2024import com.framsticks.params.types.FloatParam;
    2125
    22 import static com.framsticks.core.TreeOperations.*;
    2326
    2427
    2528import static org.fest.assertions.Assertions.*;
     29import static com.framsticks.params.ParamsUtil.getParam;
     30import static com.framsticks.structure.TreeOperations.*;
    2631
    2732@Test
     
    7580                                assertThat(access.get("se", Double.class)).isEqualTo(1.0);
    7681
    77                                 assertThat(bindAccess(tree, "/parts/2").getFramsClass().getParamEntry("m", FloatParam.class).getDef(Double.class)).isEqualTo(1.0);
    78                                 assertThat(bindAccess(tree, "/parts/2").getFramsClass().getParamEntry("m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
     82                                assertThat(getParam(bindAccess(tree, "/parts/2"), "m", FloatParam.class).getDef(Double.class)).isEqualTo(1.0);
     83                                assertThat(getParam(bindAccess(tree, "/parts/2"), "m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
    7984                                assertThat(bindAccess(tree, "/parts/2")).isInstanceOf(ReflectionAccess.class);
    8085                                assertThat(Path.to(tree, "/neurodefs").getTopObject()).isInstanceOf(ArrayList.class);
  • java/main/src/test/java/com/framsticks/core/PathTest.java

    r99 r105  
    1111import org.testng.annotations.Test;
    1212
     13import com.framsticks.structure.Path;
    1314import com.framsticks.test.TestConfiguration;
    1415import com.framsticks.util.lang.Pair;
  • java/main/src/test/java/com/framsticks/gui/LocalTreeBrowserTest.java

    r100 r105  
    55import org.testng.annotations.Test;
    66
    7 import com.framsticks.core.Tree;
    8 import com.framsticks.core.LocalTree;
    97import com.framsticks.model.Model;
    108import com.framsticks.params.types.FloatParam;
    119import com.framsticks.parsers.XmlLoader;
     10import com.framsticks.structure.LocalTree;
     11import com.framsticks.structure.Tree;
    1212import com.framsticks.util.dispatching.RunAt;
    1313
    14 import static com.framsticks.core.TreeOperations.*;
     14import static com.framsticks.params.ParamsUtil.getParam;
     15import static com.framsticks.structure.TreeOperations.*;
    1516
    1617@Test
     
    4546                        @Override
    4647                        protected void runAt() {
    47                                 assertThat(bindAccess(tree, "/parts/2").getFramsClass().getParamEntry("m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
     48                                assertThat(getParam(bindAccess(tree, "/parts/2"), "m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
    4849                        }
    4950                });
  • java/main/src/test/java/com/framsticks/gui/ProcedureBrowserTest.java

    r103 r105  
    77import org.testng.annotations.Test;
    88
    9 import com.framsticks.core.Path;
    10 import com.framsticks.core.Tree;
    11 import com.framsticks.core.LocalTree;
    12 import com.framsticks.core.ValueChange;
    139import com.framsticks.params.Access;
    1410import com.framsticks.params.EventListener;
    15 import com.framsticks.params.FramsClass;
    1611import com.framsticks.params.ReflectionAccess;
    1712import com.framsticks.params.types.EventParam;
    1813import com.framsticks.params.types.StringParam;
    1914import com.framsticks.parsers.XmlLoader;
     15import com.framsticks.structure.LocalTree;
     16import com.framsticks.structure.Path;
     17import com.framsticks.structure.Tree;
     18import com.framsticks.structure.messages.ValueChange;
    2019import com.framsticks.test.TestClass;
    21 import com.framsticks.util.dispatching.FutureHandler;
     20import com.framsticks.util.dispatching.Future;
    2221// import com.framsticks.util.dispatching.Dispatching;
    2322import com.framsticks.util.dispatching.RunAt;
    24 import static com.framsticks.core.TreeOperations.*;
     23import static com.framsticks.params.ParamsUtil.getParam;
     24import static com.framsticks.structure.TreeOperations.*;
    2525
    2626@Test
     
    5353                        @Override
    5454                        protected void runAt() {
    55                                 assertThat(bindAccess(tree, "/").getFramsClass().getParam("history")).isInstanceOf(StringParam.class);
     55                                assertThat(getParam(bindAccess(tree, "/"), "history")).isInstanceOf(StringParam.class);
    5656                        }
    5757                });
     
    6464                                Access access = bindAccess(tree, "/");
    6565                                assertThat(access).isInstanceOf(ReflectionAccess.class);
    66                                 FramsClass framsClass = access.getFramsClass();
    67                                 assertThat(framsClass.getParam(0).getId()).isEqualTo("name");
    68                                 assertThat(framsClass.getParam(1).getId()).isEqualTo("history");
    69                                 assertThat(framsClass.getParam(2).getId()).isEqualTo("history_changed");
    70                                 assertThat(framsClass.getParam(3).getId()).isEqualTo("appendHistory");
    71                                 assertThat(framsClass.getParam(4).getId()).isEqualTo("resetHistory");
     66                                assertThat(getParam(access, 0).getId()).isEqualTo("name");
     67                                assertThat(getParam(access, 1).getId()).isEqualTo("history");
     68                                assertThat(getParam(access, 2).getId()).isEqualTo("history_changed");
     69                                assertThat(getParam(access, 3).getId()).isEqualTo("appendHistory");
     70                                assertThat(getParam(access, 4).getId()).isEqualTo("resetHistory");
    7271
    7372                                assertThat(access.get("history", String.class)).isEqualTo("initial|");
     
    9695                                assertThat(access.get("history", String.class)).isEqualTo("initial|Żółw|");
    9796
    98                                 tree.addListener(Path.to(tree, "/"), access.getFramsClass().getParamEntry("history_changed", EventParam.class), listener, ValueChange.class, FutureHandler.doNothing(Void.class, failOnException));
     97                                tree.addListener(Path.to(tree, "/"), getParam(access, "history_changed", EventParam.class), listener, ValueChange.class, Future.doNothing(Void.class, failOnException));
    9998                        }
    10099                });
     
    109108                                assertThat(access.get("history", String.class)).isEqualTo("");
    110109
    111                                 tree.removeListener(Path.to(tree, "/"), access.getFramsClass().getParamEntry("history_changed", EventParam.class), listener, FutureHandler.doNothing(Void.class, failOnException));
     110                                tree.removeListener(Path.to(tree, "/"), getParam(access, "history_changed", EventParam.class), listener, Future.doNothing(Void.class, failOnException));
    112111                        }
    113112                });
  • java/main/src/test/java/com/framsticks/gui/console/TrackConsoleTest.java

    r101 r105  
    33import org.testng.annotations.Test;
    44
    5 import com.framsticks.core.Path;
    65import com.framsticks.gui.GuiTest;
    76import com.framsticks.remote.RemoteTree;
     7import com.framsticks.structure.Path;
    88import com.framsticks.util.dispatching.Dispatching;
    99import com.framsticks.util.dispatching.Dispatching.Waiter;
    10 import com.framsticks.util.dispatching.FutureHandler;
     10import com.framsticks.util.dispatching.Future;
    1111import com.framsticks.util.dispatching.Joinable;
    1212import com.framsticks.util.dispatching.JoinableCollection;
    1313
    14 import static com.framsticks.core.TreeOperations.*;
     14import static com.framsticks.structure.TreeOperations.*;
    1515
    1616@Test
     
    4141                final Waiter waiter = produceWaiter(1.0);
    4242
    43                 tryGet(tree, "/simulator/genepools/groups/0", new FutureHandler<Path>(failOnException) {
     43                tryGet(tree, "/simulator/genepools/groups/0", new Future<Path>(failOnException) {
    4444
    4545                        @Override
  • java/main/src/test/java/com/framsticks/hosting/ServerTest.java

    r103 r105  
    88import org.testng.annotations.Test;
    99
    10 import com.framsticks.core.ListChange;
    11 import com.framsticks.core.LocalTree;
    12 import com.framsticks.core.Path;
    13 import com.framsticks.core.Result;
    14 import com.framsticks.core.TreeOperations;
    15 import com.framsticks.core.ValueChange;
    1610import com.framsticks.core.XmlBasedTest;
    1711import com.framsticks.remote.RemoteTree;
     12import com.framsticks.structure.LocalTree;
     13import com.framsticks.structure.Path;
     14import com.framsticks.structure.Tree;
     15import com.framsticks.structure.TreeOperations;
     16import com.framsticks.structure.messages.ListChange;
     17import com.framsticks.structure.messages.Result;
     18import com.framsticks.structure.messages.ValueChange;
    1819
    1920import com.framsticks.test.TestClass;
    20 import com.framsticks.core.Tree;
    2121import com.framsticks.params.FramsClass;
    2222import com.framsticks.params.Access;
     
    2929import com.framsticks.params.types.ProcedureParam;
    3030import com.framsticks.util.dispatching.Dispatching.Waiter;
    31 import com.framsticks.util.dispatching.FutureHandler;
     31import com.framsticks.util.dispatching.Future;
    3232import com.framsticks.util.dispatching.RunAt;
    3333
    34 import static com.framsticks.core.TreeOperations.*;
     34import static com.framsticks.params.ParamsUtil.arguments;
    3535
    3636import static org.fest.assertions.Assertions.*;
     37import static com.framsticks.params.ParamsUtil.getParam;
     38import static com.framsticks.structure.TreeOperations.*;
    3739
    3840@Test
     
    7274                final Waiter waiter = produceWaiter(1.0);
    7375
    74                 TreeOperations.tryGet(remote, "/testClass", new FutureHandler<Path>(failOnException) {
     76                TreeOperations.tryGet(remote, "/testClass", new Future<Path>(failOnException) {
    7577                        @Override
    7678                        protected void result(Path path) {
     
    8890                final Waiter waiter = produceWaiter(1.0);
    8991
    90                 TreeOperations.tryGet(remote, "/testClass", new FutureHandler<Path>(failOnException) {
     92                TreeOperations.tryGet(remote, "/testClass", new Future<Path>(failOnException) {
    9193                        @Override
    9294                        protected void result(Path path) {
     
    105107                final Waiter waiter = produceWaiter(2.0);
    106108
    107                 set(remotePath, remoteTestFramsClass.getParamEntry("name", PrimitiveParam.class), "new name", new FutureHandler<Integer>(failOnException) {
     109                set(remotePath, getParam(remoteTestFramsClass, "name", PrimitiveParam.class), "new name", new Future<Integer>(failOnException) {
    108110                        @Override
    109111                        protected void result(Integer flags) {
     
    132134                };
    133135
    134                 TreeOperations.tryGet(remote, "/cli/events", new FutureHandler<Path>(failOnException) {
     136                TreeOperations.tryGet(remote, "/cli/events", new Future<Path>(failOnException) {
    135137                        @Override
    136138                        protected void result(Path path) {
     
    139141                });
    140142
    141                 addListener(remotePath, remoteTestFramsClass.getParamEntry("history_changed", EventParam.class), listener, ValueChange.class, produceWaiter(1.0).passInFuture(Void.class));
     143                addListener(remotePath, getParam(remoteTestFramsClass, "history_changed", EventParam.class), listener, ValueChange.class, produceWaiter(1.0).passInFuture(Void.class));
    142144        }
    143145
     
    146148                final Waiter waiter = produceWaiter(2.0);
    147149
    148                 call(remotePath, remoteTestFramsClass.getParamEntry("resetHistory", ProcedureParam.class), new Object[] {}, Object.class, produceWaiter(2.0).passInFuture(Object.class));
    149 
    150                 call(remotePath, remoteTestFramsClass.getParamEntry("appendHistory", ProcedureParam.class), new Object[] {"next word"}, Result.class, new FutureHandler<Result>(failOnException) {
     150                call(remotePath, getParam(remoteTestFramsClass, "resetHistory", ProcedureParam.class), arguments(), Object.class, produceWaiter(2.0).passInFuture(Object.class));
     151
     152                call(remotePath, getParam(remoteTestFramsClass, "appendHistory", ProcedureParam.class), arguments("next word"), Result.class, new Future<Result>(failOnException) {
    151153                        @Override
    152154                        protected void result(final Result result) {
     
    167169        @Test(dependsOnMethods = "callMethod")
    168170        public void deregisterListener() {
    169                 removeListener(remotePath, remoteTestFramsClass.getParamEntry("history_changed", EventParam.class), listener, produceWaiter(1.0).passInFuture(Void.class));
     171                removeListener(remotePath, getParam(remoteTestFramsClass, "history_changed", EventParam.class), listener, produceWaiter(1.0).passInFuture(Void.class));
    170172
    171173                assertThat(listenerArguments).isEqualTo(Arrays.asList("", "next word|"));
     
    183185                };
    184186
    185                 addListener(remotePath, remoteTestFramsClass.getParamEntry("children_changed", EventParam.class), childListener, ListChange.class, produceWaiter(1.0).passInFuture(Void.class));
     187                addListener(remotePath, getParam(remoteTestFramsClass, "children_changed", EventParam.class), childListener, ListChange.class, produceWaiter(1.0).passInFuture(Void.class));
    186188        }
    187189
     
    189191        public void createChild() {
    190192                final Waiter waiter = produceWaiter(2.0);
    191                 call(remotePath, "createChild", new Object[] { "a child" }, Object.class, produceWaiter(2.0).passInFuture(Object.class));
    192                 call(remotePath, "createChild", new Object[] { "another child" }, Object.class, produceWaiter(2.0).passInFuture(Object.class));
    193 
    194                 tryGet(remote, "/testClass/children/c0", new FutureHandler<Path>(failOnException) {
     193                call(remotePath, "createChild", arguments("a child"), Object.class, produceWaiter(2.0).passInFuture(Object.class));
     194                call(remotePath, "createChild", arguments("another child"), Object.class, produceWaiter(2.0).passInFuture(Object.class));
     195
     196                tryGet(remote, "/testClass/children/c0", new Future<Path>(failOnException) {
    195197
    196198                        @Override
    197199                        protected void result(Path result) {
    198                                 set(result, getFramsClass(result).getParamEntry("name", StringParam.class), "new_name", new FutureHandler<Integer>(failOnException) {
     200                                set(result, getParam(result, "name", StringParam.class), "new_name", new Future<Integer>(failOnException) {
    199201
    200202                                        @Override
     
    209211        @Test(dependsOnMethods = "createChild")
    210212        public void deregisterChildListener() {
    211                 removeListener(remotePath, remoteTestFramsClass.getParamEntry("children_changed", EventParam.class), childListener, produceWaiter(1.0).passInFuture(Void.class));
     213                removeListener(remotePath, getParam(remoteTestFramsClass, "children_changed", EventParam.class), childListener, produceWaiter(1.0).passInFuture(Void.class));
    212214        }
    213215
  • java/main/src/test/java/com/framsticks/model/CreatureTest.java

    r87 r105  
    1111
    1212import static org.fest.assertions.Assertions.*;
     13import static com.framsticks.params.ParamsUtil.getParam;
    1314
    1415@Test
     
    2728                assertThat(framsClass.getParam("name")).describedAs("name").isInstanceOf(StringParam.class);
    2829                assertThat(framsClass.getParam("parts")).describedAs("parts").isInstanceOf(ArrayListParam.class);
    29                 partsParam = framsClass.getParamEntry("parts", ArrayListParam.class);
     30                partsParam = getParam(framsClass, "parts", ArrayListParam.class);
    3031                assertThat(partsParam).describedAs("partsParam").isNotNull();
    3132                assertThat(partsParam).isInstanceOf(ArrayListParam.class);
  • java/main/src/test/java/com/framsticks/model/ModelPackageTest.java

    r101 r105  
    1515
    1616import static org.fest.assertions.Assertions.*;
     17import static com.framsticks.params.ParamsUtil.getParam;
    1718
    1819@Test
     
    4142                                Object defaultValue = args[1];
    4243
    43                                 ValueParam param = framsClass.getParamEntry(paramName, ValueParam.class);
     44                                ValueParam param = getParam(framsClass, paramName, ValueParam.class);
    4445                                assertThat(param.getDef(Object.class)).isEqualTo(defaultValue);
    4546
  • java/main/src/test/java/com/framsticks/model/f0/SchemaTest.java

    r97 r105  
    1111
    1212import static org.fest.assertions.Assertions.*;
     13import static com.framsticks.params.ParamsUtil.getParam;
    1314
    1415public class SchemaTest extends TestConfiguration {
     
    2324
    2425                assertThat(schema.getNeuroClass("|").getName()).isEqualTo("Bend muscle");
    25                 assertThat(schema.getNeuroClass("VEye").getParam("p")).isInstanceOf(FloatParam.class);
    26                 assertThat(schema.getNeuroClass("VEye").getParamEntry("p", FloatParam.class).getMax(Double.class)).isEqualTo(10.0, delta(0.0));
     26                assertThat(getParam(schema.getNeuroClass("VEye"), "p")).isInstanceOf(FloatParam.class);
     27                assertThat(getParam(schema.getNeuroClass("VEye"), "p", FloatParam.class).getMax(Double.class)).isEqualTo(10.0, delta(0.0));
    2728
    2829                FramsClass partClass = schema.getFramsClass("p");
    2930                assertThat(partClass).isNotNull();
    30                 assertThat(partClass.getParamEntry("as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
     31                assertThat(getParam(partClass, "as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
    3132                assertThat(partClass.getGroupCount()).isEqualTo(3);
    3233                assertThat(partClass.getGroup(1).getName()).isEqualTo("Other properties");
  • java/main/src/test/java/com/framsticks/params/FramsClassBuilderTest.java

    r103 r105  
    66import org.testng.annotations.Test;
    77
    8 import com.framsticks.core.ValueChange;
    98import com.framsticks.params.types.EventParam;
    109import com.framsticks.params.types.ProcedureParam;
    1110import com.framsticks.params.types.StringParam;
    1211import com.framsticks.parsers.Savers;
     12import com.framsticks.structure.messages.ValueChange;
    1313import com.framsticks.test.TestClass;
    1414import com.framsticks.test.TestConfiguration;
     
    1616
    1717import static org.fest.assertions.Assertions.*;
     18import static com.framsticks.params.ParamsUtil.arguments;
     19import static com.framsticks.params.ParamsUtil.getParam;
    1820
    1921@Test
     
    4345                assertThat(framsClass.getParam("resetHistory")).isInstanceOf(ProcedureParam.class);
    4446
    45                 ProcedureParam appendHistory = framsClass.getParamEntry("appendHistory", ProcedureParam.class);
     47
     48                ProcedureParam appendHistory = getParam(framsClass, "appendHistory", ProcedureParam.class);
    4649                assertThat(appendHistory.getArgumentsType().size()).isEqualTo(1);
    4750                assertThat(appendHistory.getArgumentsType().get(0).getId()).isEqualTo("arg0");
     
    111114
    112115                assertThat(access.get("history", String.class)).isEqualTo("initial|first|");
    113                 Object result = access.call("appendHistory", new Object[] {"second"});
     116                Object result = access.call("appendHistory", arguments("second"));
    114117
    115118                assertThat(result).isInstanceOf(Integer.class);
     
    117120                assertThat(access.get("history", String.class)).isEqualTo("initial|first|second|");
    118121
    119                 result = access.call("resetHistory", null);
     122                result = access.call("resetHistory");
    120123                assertThat(result).isNull();
    121124
     
    136139                };
    137140
    138                 final EventParam eventParam = access.getFramsClass().getParamEntry("history_changed", EventParam.class);
     141                final EventParam eventParam = getParam(access, "history_changed", EventParam.class);
    139142                access.reg(eventParam, listener);
    140143
     
    142145                final String addition = "test";
    143146
    144                 access.call("appendHistory", new Object[] { addition });
     147                access.call("appendHistory", arguments(addition));
    145148
    146149                String expected = currentHistory + addition + "|";
  • java/main/src/test/java/com/framsticks/params/ParamBuilderTest.java

    r103 r105  
    99import com.framsticks.test.TestConfiguration;
    1010import static org.fest.assertions.Assertions.*;
     11import static com.framsticks.params.ParamsUtil.getParam;
    1112
    1213@Test
     
    2425                assertThat(builderFramsClass.getName()).isEqualTo("prop");
    2526                assertThat(builderFramsClass.getId()).isEqualTo("prop");
    26                 assertThat(builderFramsClass.getParamEntry("flags", ValueParam.class).getDef(Object.class)).isEqualTo(new Integer(0));
    27                 assertThat(builderFramsClass.getParamEntry("id", Param.class)).isInstanceOf(StringParam.class);
     27                assertThat(getParam(builderFramsClass, "flags", ValueParam.class).getDef(Object.class)).isEqualTo(new Integer(0));
     28                assertThat(getParam(builderFramsClass, "id", Param.class)).isInstanceOf(StringParam.class);
    2829        }
    2930
  • java/main/src/test/java/com/framsticks/parsers/F0ParserTest.java

    r101 r105  
    1717import static org.fest.assertions.Assertions.*;
    1818import static org.fest.assertions.Delta.*;
     19import static com.framsticks.params.ParamsUtil.getParam;
    1920
    2021/**
     
    4849        public void primitiveParam() {
    4950                FramsClass joint = schema.getFramsClass("j");
    50                 PrimitiveParam<?> dx = joint.getParamEntry("dx", PrimitiveParam.class);
     51                PrimitiveParam<?> dx = getParam(joint, "dx", PrimitiveParam.class);
    5152                assertThat(dx).isInstanceOf(FloatParam.class);
    5253                assertThat(schema.getNeuroClasses().size()).isEqualTo(21);
     
    5455                assertThat(dx.getMin(Double.class)).isEqualTo(-2.0, delta(0.0));
    5556
    56                 assertThat(schema.getRegistry().getFramsClass("n").getParamEntry("d", StringParam.class).getDef(String.class)).isEqualTo("N");
     57                assertThat(getParam(schema.getRegistry().getFramsClass("n"), "d", StringParam.class).getDef(String.class)).isEqualTo("N");
    5758        }
    5859
     
    6061        public void readF0() throws IOException, ParseException {
    6162                assertThat(schema.getFramsClass("p")).isInstanceOf(FramsClass.class);
    62                 assertThat(schema.getRegistry().getFramsClass("p").getParamEntry("as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
     63                assertThat(getParam(schema.getRegistry().getFramsClass("p"), "as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
    6364
    6465                accesses = new F0Parser(schema, F0ParserTest.class.getResourceAsStream("/parsers/f0_example.txt")).parse();
     
    9192
    9293                assertThat(model.getParts().get(1).getPosition().x).isEqualTo(2.0, delta(0.0));
    93                 assertThat(model.getParts().get(2).getPosition().sub(new Point3d(2.27236, -0.0792596, -0.958924)).length()).isLessThan(0.0001);
     94                assertThat(model.getParts().get(2).getPosition().sub(new Point3d(2.27236, -0.0792596, -0.958924)).length()).describedAs("position error").isLessThan(0.0001);
    9495                assertThat(model.getParts().get(2).getOrientation().y.sub(new Point3d(0.870277, -0.404792, 0.280644)).length()).isLessThan(0.0001);
    9596
  • java/main/src/test/java/com/framsticks/running/ExternalProcessTest.java

    r101 r105  
    99import org.testng.annotations.Test;
    1010
    11 import com.framsticks.core.ValueChange;
    1211import com.framsticks.params.EventListener;
     12import com.framsticks.structure.messages.ValueChange;
    1313import com.framsticks.test.TestConfiguration;
    1414import com.framsticks.util.dispatching.Monitor;
  • java/main/src/test/java/com/framsticks/test/TestConfiguration.java

    r100 r105  
    1010import org.testng.annotations.*;
    1111
     12import com.framsticks.util.ExceptionHandler;
    1213import com.framsticks.util.FramsticksException;
    1314import com.framsticks.util.dispatching.Dispatcher;
    1415import com.framsticks.util.dispatching.Dispatching;
    1516import com.framsticks.util.dispatching.Dispatching.Waiter;
    16 import com.framsticks.util.dispatching.ExceptionHandler;
    17 import com.framsticks.util.dispatching.ExceptionResultHandler;
     17import com.framsticks.util.dispatching.ExceptionDispatcherHandler;
    1818
    1919// import static org.fest.assertions.Assertions.*;
     
    4646        }
    4747
    48         public ExceptionHandler createExceptionHandler() {
    49                 return new ExceptionHandler() {
     48        public ExceptionDispatcherHandler createExceptionHandler() {
     49                return new ExceptionDispatcherHandler() {
    5050                        @Override
    5151                        public boolean handle(Dispatcher<?> dispatcher, Throwable throwable) {
     
    9898        }
    9999
    100         public final ExceptionResultHandler failOnException = new ExceptionResultHandler() {
     100        public final ExceptionHandler failOnException = new ExceptionHandler() {
    101101                @Override
    102102                public void handle(FramsticksException e) {
  • java/main/src/test/resources/configs/LocalTreeBrowserTest.xml

    r99 r105  
    22<Browser>
    33        <import class="com.framsticks.model.ModelBuilder" />
    4         <import class="com.framsticks.core.LocalTree" />
     4        <import class="com.framsticks.structure.LocalTree" />
    55        <!-- <import class="com.framsticks.model.ModelPackage" /> -->
    66        <LocalTree name="model">
  • java/main/src/test/resources/configs/ProcedureBrowserTest.xml

    r99 r105  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<Browser>
    3         <import class="com.framsticks.core.LocalTree" />
     3        <import class="com.framsticks.structure.LocalTree" />
    44        <import class="com.framsticks.test.TestClass" />
    55        <LocalTree name="test">
  • java/main/src/test/resources/configs/ServerTest.xml

    r102 r105  
    33        <import class="com.framsticks.hosting.Server" />
    44        <import class="com.framsticks.remote.RemoteTree" />
    5         <import class="com.framsticks.core.LocalTree" />
     5        <import class="com.framsticks.structure.LocalTree" />
    66        <import class="com.framsticks.test.TestClass" />
    77        <import class="com.framsticks.running.LoggingOutputListener" />
Note: See TracChangeset for help on using the changeset viewer.