Ignore:
Timestamp:
09/23/13 18:54:07 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add SimultorProviders? hierarchy
  • start Framsticks server over SSH
  • FJF compatible with Framsticks 4.0rc3
  • reading and writing of standard.expt
  • a proof-of-concept implementation of StandardExperiment?

CHANGELOG:
Optionally return FreeAccess? from registry.

Add SimulatorRange?.

StandardExperiment? with genotypes circulation.

Automate registration around StandardState?.

More improvements to StandardExperiment?.

Skeleton version of StandardExperiment?.

Test saving of StandardState?.

Standard experiment state is being loaded.

More development towards StandardState? reading.

Work on reading standard experiment state.

Add classes for standard experiment.

Update example standard.expt

Add FreeAccess? and FreeObject?.

Made compatible with version 4.0rc3

Change deserialization policy.

Improve SSH support.

Working running simulator over SSH.

Fix joining bug in Experiment.

Working version of SimulatorRunner?.

Add more SimulatorProviders?.

Working PrimeExperimentTest? with 4.0rc3

Add references to deserialization.

Add OpaqueObject? and it's serialization.

Add deserialization of dictionaries.

Partial implementation of deserialization.

Add more tests for deserialization.

Prepare tests for deserialization.

Add proper result to prime experiment test.

Minor fixes to simulators providers.

Draft version of SimulatorProvider?.

Add SimulatorProvider? interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/test/java/com/framsticks/params/ParamsUtilTest.java

    r105 r107  
    77import java.util.TreeMap;
    88
     9import org.testng.annotations.DataProvider;
    910import org.testng.annotations.Test;
    1011
     
    1718import com.framsticks.test.TestConfiguration;
    1819import com.framsticks.test.TestSerializedClass;
     20import com.framsticks.util.lang.Containers;
     21import com.framsticks.util.lang.Pair;
    1922
    2023
     
    2225
    2326        @Test
    24         public void testSerialization() {
     27        public void testVariousSerializations() {
    2528                FramsClass framsClass;
    2629                ReflectionAccess access;
     
    6063
    6164
    62                 assertThat(ParamsUtil.serialize("@Serialized:")).isEqualTo("@Serialized:\"@Serialized:\"");
    63                 assertThat(ParamsUtil.serialize(Arrays.asList(12, null, "abc"))).isEqualTo("@Serialized:[12,null,\"abc\"]");
    64                 assertThat(ParamsUtil.serialize(Arrays.asList(Arrays.asList(Arrays.asList())))).isEqualTo("@Serialized:[[[]]]");
    6565
    6666                Map<String, Object> f12 = new TreeMap<String, Object>();
     
    8686        }
    8787
     88
     89        @Test(dependsOnMethods = "testVariousSerializations", dataProvider = "serializationData")
     90        public void testSerialization(Object object, String string) {
     91                assertThat(ParamsUtil.serialize(object)).isEqualTo(string);
     92        }
     93
     94        @Test(dependsOnMethods = "testSerialization", dataProvider = "serializationData")
     95        public void testDeserialization(Object object, String string) {
     96                assertThat(ParamsUtil.deserialize(string, Object.class)).isEqualTo(object);
     97        }
     98
     99        @DataProvider
     100        public Object[][] serializationData() {
     101                Object array = Arrays.asList(1, 2);
     102
     103                return new Object[][] {
     104                        { 2, "2" },
     105                        { 0.5, "0.5" },
     106                        { "xx", "xx" },
     107                        { "@Serialized:", "@Serialized:\"@Serialized:\"" },
     108                        { Arrays.asList(12, null, "abc"), "@Serialized:[12,null,\"abc\"]" },
     109                        { Arrays.asList(Arrays.asList(Arrays.asList())), "@Serialized:[[[]]]" },
     110                        { Arrays.asList(1, Containers.buildMap(Pair.make("a", 2), Pair.make("b", "xx"), Pair.make("c", null)), "y"), "@Serialized:[1,{\"a\":2,\"b\":\"xx\",\"c\":null},\"y\"]" },
     111                        { new OpaqueObject("Population", 0xaabbccddL), "@Serialized:Population<0xaabbccdd>" },
     112                        { Arrays.asList("x", new OpaqueObject("Population", 0xaabbccddL)), "@Serialized:[\"x\",Population<0xaabbccdd>]" },
     113                        { Containers.buildMap(Pair.make("a", array), Pair.make("b", array)), "@Serialized:{\"a\":[1,2],\"b\":^1}"}
     114                };
     115        }
     116
    88117}
Note: See TracChangeset for help on using the changeset viewer.