Ignore:
Timestamp:
07/02/13 16:20:07 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

CHANGELOG:
Make ProcedureParam? hold only ValueParams?.

Use id instead of names when naming gui components internally.

Basic procedure calling in GUI.

The actual procedure call is currently only backed
by the ObjectInstance?.

Add UnimplementedException?.

Improve naming of various gui elements.

Allow easy navigating in FEST Swing testing.

Add optional explicit order attribute to FramsClassAnnotation?.

That's because java reflection does return declared members
in any specific order. That ordering is needed only for
classes that have no representation in framsticks and need
a deterministic ordering of params.

Add ControlOwner? interface.

Add test for procedure calling in Browser.

First version of ParamAnnotation? for procedures.

Development of ProcedureParam?.

Add draft version of ProcedureParam? implementation in ReflectionAccess?.

Allow viewing FramsClasses? in gui Browser.

Extract ResourceBuilder? from ModelBuilder?.

Remove internalId from Param.

It was currently completely not utilised. Whether it is still needed
after introduction of ParamAnnotation? is arguable.

Add remaining param attributes to ParamAnnotation?.

Change AutoBuilder? semantics.

AutoBuilder? returns list of objects that are to be appended
with methods @AutoAppendAnnotation?.

This allows to omit explicit addition of ModelPackage? to instance
if the instance uses ModelBuilder? (registration of ModelPackage? comes
from schema).

Fix params ordering problem in auto created FramsClasses?.

Improve ObjectInstance?.

Several fixes to ModelBuilder?.

Improve test for ObjectInstance? in Browser.

Make initialization of robot static.

With robot recreated for second browser test, the test hanged
deep in AWT.

Add base convenience base test for Browser tests.

More tests to ObjectInstance?.

Rename Dispatcher.invokeLater() to dispatch().

Add assertDispatch.

It allows assertions in other threads, than TestNGInvoker.
Assertions are gathered after each method invocation and rethrown.

Use timeOut annotation attribute for tests involving some waiting.

Remove firstTask method (merge with joinableStart).

Clean up leftovers.

Remove unused FavouritesXMLFactory (the reading part is already
completely done with generic XmlLoader?, and writing part will be done
based on the same approach if needed).
Move UserFavourite? to the com.framsticks.gui.configuration package.

Remove GenotypeBrowser? as to specific.

This functionality will be available in ObjectInstance?.

Add interface ParamsPackage?.

Package containing registration of Java classes meant to use with
ReflectionAccess? may be in Instance using configuration.

Minor changes.

Make Group immutable.

Add AutoBuilder? interface extending Builder - only those would
be used to automatically build from XML.

Fix groups in FramsClass?.

Minor naming cleanup in Registry.

Add ModelComponent? interface.

All class creating the Model are implementing that interface.

Extract Model.build into ModelBuilder?.

ModelBuilder? will be compatible with other builders
and allow using it from configuration.

Fix NeuroConnection?.

Add synchronous get operation for dispatchers.

Rename JoinableMonitor? to Monitor.

Add ObjectInstance?.

This class is mainly for demonstration
and testing purposes.

Improve FramsServer? runner.

  • improve ExternalProcess? runner,
  • runner can kill the server but also react properly, when the server exists on it's own,
  • set default path to search for framsticks server installation,
  • add LoggingOutputListener?.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/test/java/com/framsticks/parsers/F0ParserTest.java

    r88 r90  
    44
    55import com.framsticks.model.*;
    6 import com.framsticks.model.Package;
    76import com.framsticks.model.f0.Schema;
     7import com.framsticks.model.f0.SchemaBuilder;
    88import com.framsticks.params.*;
    99import com.framsticks.params.types.FloatParam;
     
    2525        private Schema schema;
    2626        private List<AccessInterface> accesses;
    27         private List<Object> objects;
     27        private List<ModelComponent> components;
    2828        private Model model;
    2929
    3030        @BeforeClass
    3131        public void setUp() throws Exception {
    32                 schema = Schema.load(Schema.getDefaultDefinitionAsStream());
    33                 Package.register(schema.getRegistry());
     32                schema = new SchemaBuilder().stream(Schema.getDefaultDefinitionAsStream()).finish();
    3433        }
    3534
    3635        @Test
     36        public void checkFramsClasses() {
     37                FramsClass modelClass = schema.getRegistry().getFramsClass("Model");
     38                assertThat(modelClass).isNotNull();
     39                assertThat(modelClass.getParam("se")).isInstanceOf(FloatParam.class);
     40                // assertThat(modelClass.getParam("energ0")).isInstanceOf(FloatParam.class);
     41                assertThat(modelClass.getParam("Vstyle")).isInstanceOf(StringParam.class);
     42                assertThat(modelClass.getParamCount()).isEqualTo(6);
     43                // assertThat();
     44
     45        }
     46
     47        @Test(dependsOnMethods = "checkFramsClasses")
    3748        public void primitiveParam() {
    3849                FramsClass joint = schema.getFramsClass("j");
     
    4354                assertThat(dx.getMin(Double.class)).isEqualTo(-2.0, delta(0.0));
    4455
    45                 assertThat(schema.getRegistry().getInfoFromCache("n").getParamEntry("d", StringParam.class).getDef(String.class)).isEqualTo("N");
     56                assertThat(schema.getRegistry().getFramsClass("n").getParamEntry("d", StringParam.class).getDef(String.class)).isEqualTo("N");
    4657        }
    4758
    48         @Test
     59        @Test(dependsOnMethods = "primitiveParam")
    4960        public void readF0() throws IOException, ParseException {
    5061                assertThat(schema.getFramsClass("p")).isInstanceOf(FramsClass.class);
    51                 assertThat(schema.getRegistry().getInfoFromCache("p").getParamEntry("as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
     62                assertThat(schema.getRegistry().getFramsClass("p").getParamEntry("as", FloatParam.class).getDef(Double.class)).isEqualTo(0.25, delta(0.0));
    5263
    5364                accesses = new F0Parser(schema, F0ParserTest.class.getResourceAsStream("/parsers/f0_example.txt")).parse();
    5465
    55                 assertThat(accesses.size()).isEqualTo(12);
     66                assertThat(accesses.size()).isEqualTo(19);
    5667                assertThat(accesses.get(0).getSelected()).isInstanceOf(Model.class);
    5768                assertThat(accesses.get(5).get("i", String.class)).isEqualTo("1,2,3,\"dsadsa,,,,");
     
    6273        @Test(dependsOnMethods = {"readF0"})
    6374        public void stripAccessInterface() {
    64                 objects = Util.stripAccessInterface(accesses);
     75                components = Util.stripAccessInterface(accesses, ModelComponent.class);
    6576
    66                 assertThat(objects.get(1)).isInstanceOf(Part.class);
    67                 assertThat(objects.get(4)).isInstanceOf(Joint.class);
    68                 assertThat(objects.get(6)).isInstanceOf(NeuroDef.class);
     77                assertThat(components.get(1)).isInstanceOf(Part.class);
     78                assertThat(components.get(4)).isInstanceOf(Joint.class);
     79                assertThat(components.get(6)).isInstanceOf(NeuroDefinition.class);
     80                assertThat(components.get(12)).isInstanceOf(NeuroConnection.class);
    6981        }
    7082
    7183        @Test(dependsOnMethods = {"stripAccessInterface"})
    7284        public void buildModel() {
    73                 model = Model.build(objects);
     85                model = new ModelBuilder().addComponents(components).finish();
    7486
    7587                assertThat(model.getParts().size()).isEqualTo(3);
    76                 assertThat(model.getNeuroDefs().size()).isEqualTo(6);
     88                assertThat(model.getNeuroDefinitions().size()).isEqualTo(6);
    7789                assertThat(model.getJoints().size()).isEqualTo(2);
    78 
    79                 assertThat(model.getJoints().get(0).part1).isEqualTo(0);
    80                 assertThat(model.getJoints().get(0).part2).isEqualTo(1);
    81                 assertThat(model.getNeuroDefs().size()).isEqualTo(6);
    82                 assertThat(model.getNeuroDefs().get(0).part).isEqualTo(1);
    83                 assertThat(model.getNeuroDefs().get(0).joint).isEqualTo(-1);
    84                 assertThat(model.getNeuroDefs().get(1).details).isEqualTo("|:p=0.25,r=1");
    85                 assertThat(model.getNeuroDefs().get(3).details).isEqualTo("N");
    86                 assertThat(model.getNeuroDefs().get(4).part).isEqualTo(-1);
     90                assertThat(model.getNeuroConnections().size()).isEqualTo(7);
    8791
    8892                assertThat(model.getParts().get(1).getPosition().x).isEqualTo(2.0, delta(0.0));
    8993                assertThat(model.getParts().get(2).getPosition().sub(new Point3d(2.27236, -0.0792596, -0.958924)).length()).isLessThan(0.0001);
    9094                assertThat(model.getParts().get(2).getOrientation().y.sub(new Point3d(0.870277, -0.404792, 0.280644)).length()).isLessThan(0.0001);
     95
     96                assertThat(model.getJoints().get(0).part1).isEqualTo(0);
     97                assertThat(model.getJoints().get(0).part2).isEqualTo(1);
     98
     99                assertThat(model.getNeuroDefinitions().get(0).part).isEqualTo(1);
     100                assertThat(model.getNeuroDefinitions().get(0).joint).isEqualTo(-1);
     101                assertThat(model.getNeuroDefinitions().get(1).details).isEqualTo("|:p=0.25,r=1");
     102                assertThat(model.getNeuroDefinitions().get(3).details).isEqualTo("N");
     103                assertThat(model.getNeuroDefinitions().get(4).part).isEqualTo(-1);
     104
     105                assertThat(model.getNeuroConnections().get(2).connectedNeuro).isEqualTo(0);
     106                assertThat(model.getNeuroConnections().get(5).weight).isEqualTo(5.6, delta(0.0));
     107
    91108        }
    92109
     
    94111        public void print() throws Exception {
    95112                ListSink sink = new ListSink();
    96 
    97113
    98114                new F0Writer(schema, model, sink).write();
     
    110126                        "n:j=0,d=@:p=0.25",
    111127                        "n:p=1,d=Nu",
     128                        "c:0,2",
     129                        "c:0,2,5.4",
     130                        "c:1,0",
     131                        "c:2,0,3.4",
     132                        "c:0,1,4.5",
     133                        "c:1,0,5.6",
     134                        "c:2,1",
    112135                        "m:"
    113136                );
Note: See TracChangeset for help on using the changeset viewer.