Changeset 87 for java/main/src/test


Ignore:
Timestamp:
06/28/13 11:56:03 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • FramsClass? and contained Param are now immutable classes (like String),

which allows to refer to them concurrently without synchronization
(which for example in turn simplifies GUI management)

  • also make Path immutable (which was earlier only assumed)
  • add global cache for FramsClasses? created solely and automatically

on base of Java classes.

representations basing on given FramsClass?

  • above changes greatly improved GUI responsivness during browsing
  • furtherly improve Param class hierarchy
  • allow to inject actions on state changes into MultiParamLoader?
  • add more tests

CHANGELOG:

Add StatusListener? to MultiParamLoader?.

Minor refactorization in MultiParamLoader?.

First step with auto append.

Add SchemaTest?.

Improve Registry.

Clean up in Registry.

Work out Registry.

Use annotations for Param.

Fix ListChange?.

Improve fluent interface of the FramsClassBuilder?.

Done caching of ReflectionAccess?.Backend

Fix hashCode of Pair.

A step on a way to cache ReflectionAccess?.Backend

Make SimpleAbstractAccess?.framsClass a final field.

Add static cache for FramsClasses? based on java.

Only classes created strictly and automatically
based on java classes are using this cache.

Make all Params immutable.

Many improvement to make Param immutable.

Make PrimitiveParam? generic type.

Several changes to make Param immutable.

Make FramsClass? immutable.

Another improvement to Path immutability.

Several improvements to Path.

Improve PathTest?.

Configurarable MutabilityDetector?.

Location:
java/main/src/test
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/test/java/com/framsticks/gui/BrowserTest.java

    r84 r87  
    1414import org.testng.annotations.*;
    1515
    16 import com.framsticks.communication.ClientConnection;
    1716import com.framsticks.remote.RemoteInstance;
    1817import com.framsticks.test.TestConfiguration;
     
    4241                RemoteInstance localhost = new RemoteInstance();
    4342                localhost.setName("localhost");
    44                 localhost.setConnection(new ClientConnection("localhost:9009"));
     43                localhost.setAddress("localhost:9009");
    4544
    4645                browser.addEndpointForInstance(localhost);
  • java/main/src/test/java/com/framsticks/model/CreatureTest.java

    r86 r87  
    44
    55import com.framsticks.params.FramsClass;
    6 import com.framsticks.params.FramsClassBuilder;
    76import com.framsticks.params.ReflectionAccess;
    87import com.framsticks.params.types.ArrayListParam;
     
    2322        @Test
    2423        public void testFramsClass() {
    25                 framsClass = FramsClassBuilder.buildForClass(Creature.class);
     24                framsClass = FramsClass.build().forClass(Creature.class);
    2625
    2726                assertThat(framsClass).describedAs("framsClass").isNotNull();
     
    3534        }
    3635
    37         @Test
     36        @Test(dependsOnMethods = "testFramsClass")
    3837        public void testReflectionAccess() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
    3938                access = new ReflectionAccess(Creature.class, framsClass);
  • java/main/src/test/java/com/framsticks/params/ParamBuilderTest.java

    r86 r87  
    1818        @Test
    1919        public void createBuilderFramsClass() {
    20                 builderFramsClass = FramsClassBuilder.buildForClass(ParamBuilder.class);
     20                builderFramsClass = FramsClass.build().forClass(ParamBuilder.class);
    2121
    2222                assertThat(builderFramsClass.getParamCount()).isEqualTo(6);
  • java/main/src/test/java/com/framsticks/parsers/F0ParserTest.java

    r84 r87  
    22
    33import org.testng.annotations.*;
     4
    45import com.framsticks.model.*;
    56import com.framsticks.model.Package;
    67import com.framsticks.params.*;
    78import com.framsticks.params.types.FloatParam;
     9import com.framsticks.params.types.StringParam;
    810import com.framsticks.test.TestConfiguration;
    911import com.framsticks.util.math.Point3d;
     
    3436        public void primitiveParam() {
    3537                FramsClass joint = schema.getRegistry().getInfoFromCache("j");
    36                 PrimitiveParam dx = joint.getParamEntry("dx", PrimitiveParam.class);
     38                PrimitiveParam<?> dx = joint.getParamEntry("dx", PrimitiveParam.class);
    3739                assertThat(dx).isInstanceOf(FloatParam.class);
    3840                assertThat(schema.getNeuroClasses().size()).isEqualTo(21);
    3941                assertThat(dx.getName()).isEqualTo("delta.x");
    4042                assertThat(dx.getMin(Double.class)).isEqualTo(-2.0, delta(0.0));
     43
     44                assertThat(schema.getRegistry().getInfoFromCache("n").getParamEntry("d", StringParam.class).getDef(String.class)).isEqualTo("N");
    4145        }
    4246
Note: See TracChangeset for help on using the changeset viewer.