Changeset 102 for java/main/src/test


Ignore:
Timestamp:
07/16/13 23:31:35 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

for Joinables running

CHANGELOG:
Add WorkPackageLogic? and classes representing prime experiment state.

Add classes for PrimeExperiment? state.

Extract single netload routine in Simulator.

Working netload with dummy content in PrimeExperiment?.

More development with NetLoadSaveLogic? and PrimeExperiment?.

Improvement around prime.

Improve BufferedDispatcher?.isActive logic.

Add prime-all.xml configuration.

Manual connecting to existing simulators from GUI.

Guard in SimulatorConnector? against expdef mismatch.

Guard against empty target dispatcher in BufferedDispatcher?.

Make BufferedDispatcher? a Dispatcher (and Joinable).

Minor improvements.

Done StackedJoinable?, improve Experiment.

Develop StackedJoinable?.

Add StackedJoinable? utility joinables controller.

Add dependency on apache-commons-lang.

Add ready ListChange? on Simulators.

Improve hints in ListChange?.

Several improvements.

Found bug with dispatching in Experiment.

Minor improvements.

Fix bug with early finishing Server.

Many changes in Dispatching.

Fix bug with connection.

Do not obfuscate log with socket related exceptions.

Add SocketClosedException?.

Add SimulatorConnector?.

Work out conception of experiment composing of logics building blocks.

Rename SinkInterface? to Sink.

Move saving of Accesses into AccessOperations?.

Some improvements to Experiment.

Improve joinables.

Fix issue with joinables closing.

Add direct and managed consoles to popup menu.

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

Legend:

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

    r101 r102  
    77
    88import com.framsticks.core.ListChange.Action;
    9 import com.framsticks.params.AccessOperations;
     9import static com.framsticks.params.AccessOperations.*;
    1010import com.framsticks.params.FramsClass;
    1111import com.framsticks.params.ListSink;
     
    4040        public void testFramsClass() {
    4141                framsClass = FramsClass.build().forClass(ListChange.class);
    42                 assertThat(framsClass.getParamCount()).isEqualTo(3);
     42                assertThat(framsClass.getParamCount()).isEqualTo(4);
    4343        }
    4444
     
    6060
    6161        @Test(dependsOnMethods = "createReflectionAccess")
    62         public void load() throws Exception {
    63                 AccessOperations.load(access.select(listChange), ListSource.createFrom("type:2", "pos:0", "id:test"));
     62        public void loading() throws Exception {
     63                load(access.select(listChange), ListSource.createFrom("type:2", "pos:0", "id:test"));
    6464
    6565                assertThat(listChange.action).isEqualTo(Action.Modify);
     
    6868
    6969                ListSink sink = new ListSink();
    70                 access.select(listChange).save(sink);
     70                save(access.select(listChange), sink);
    7171                assertThat(sink.getOut()).isEqualTo(Arrays.asList("ListChange:", "type:2", "pos:0", "id:test", ""));
    7272        }
  • java/main/src/test/java/com/framsticks/gui/console/DirectConsoleTest.java

    r97 r102  
    2020        protected Joinable createSubject() {
    2121
    22                 connection = new ClientSideRawConnection();
    23                 connection.setAddress(new Address("localhost:9009"));
    24 
    25                 console = new DirectConsole().setConnection(connection);
     22                console = new DirectConsole().setAddress(new Address("localhost:9009"));
    2623                joinables = new JoinableCollection<>();
    2724                joinables.setObservableName("connection and console");
    2825                joinables.add(console);
    29                 joinables.add(connection);
     26                joinables.add(console.getConnection());
    3027
    3128                return joinables;
  • java/main/src/test/java/com/framsticks/test/MonitorBasedTest.java

    r96 r102  
    3030        }
    3131
    32         @AfterClass(timeOut = 3000)
     32        @AfterClass(timeOut = 30000)
    3333        public void tearDown() {
    3434                monitor.drop().join();
  • java/main/src/test/java/com/framsticks/test/PrimeExperimentTest.java

    r101 r102  
    66
    77import com.framsticks.core.XmlBasedTest;
     8import com.framsticks.util.dispatching.Dispatching;
     9import com.framsticks.util.dispatching.StackedJoinable;
     10
     11import org.apache.logging.log4j.Logger;
     12import org.apache.logging.log4j.LogManager;
    813
    914@Test
    1015public class PrimeExperimentTest extends XmlBasedTest {
    1116
     17        private static final Logger log = LogManager.getLogger(PrimeExperimentTest.class);
     18
    1219        protected PrimeExperiment experiment;
     20
    1321
    1422        @Test
    1523        public void start() {
     24                log.debug("starting");
    1625                assertThat(framsticks).isNotNull();
    17                 assertThat(framsticks.get("prime")).isInstanceOf(PrimeExperiment.class);
    18                 experiment = (PrimeExperiment) framsticks.get("prime");
     26                assertThat(framsticks.size()).isEqualTo(1);
     27                assertThat(framsticks.get("stacked")).isInstanceOf(StackedJoinable.class);
     28                StackedJoinable stacked = (StackedJoinable) framsticks.get("stacked");
     29
     30                assertThat(stacked.size()).isEqualTo(2);
     31                assertThat(stacked.get(1)).isInstanceOf(PrimeExperiment.class);
     32                // assertThat(framsticks.get("prime")).isInstanceOf(PrimeExperiment.class);
     33                // experiment = (PrimeExperiment) framsticks.get("prime");
     34                //
     35                Dispatching.sleep(3);
    1936        }
     37
    2038}
  • java/main/src/test/resources/configs/PrimeExperimentTest.xml

    r101 r102  
    33        <import class="com.framsticks.test.PrimeExperiment" />
    44        <import class="com.framsticks.experiment.Simulator" />
    5         <PrimeExperiment name="prime">
    6         </PrimeExperiment>
     5        <import class="com.framsticks.util.dispatching.StackedJoinable" />
     6        <import class="com.framsticks.util.dispatching.JoinableCollection" />
     7        <import class="com.framsticks.running.LoggingOutputListener" />
     8        <import class="com.framsticks.running.FramsServer" />
     9        <import class="com.framsticks.experiment.SimulatorConnector" />
     10        <StackedJoinable interval="1">
     11                <JoinableCollection name="servers">
     12                        <FramsServer name="frams" port="9100" expdef="prime">
     13                                <LoggingOutputListener />
     14                        </FramsServer>
     15                        <FramsServer name="frams" port="9101" expdef="prime">
     16                                <LoggingOutputListener />
     17                        </FramsServer>
     18                </JoinableCollection>
     19                <PrimeExperiment>
     20                        <SimulatorConnector address="localhost:9100" />
     21                        <SimulatorConnector address="localhost:9101" />
     22                </PrimeExperiment>
     23        </StackedJoinable>
    724</Framsticks>
  • java/main/src/test/resources/configs/ServerTest.xml

    r101 r102  
    66        <import class="com.framsticks.test.TestClass" />
    77        <import class="com.framsticks.running.LoggingOutputListener" />
    8         <Server port="9007">
     8        <Server port="9006">
    99                <LocalTree name="test">
    1010                        <TestClass name="a test name" />
    1111                </LocalTree>
    1212        </Server>
    13         <RemoteTree name="remote" address="localhost:9007" />
     13        <RemoteTree name="remote" address="localhost:9006" />
    1414</Framsticks>
  • java/main/src/test/resources/log4j2.xml

    r100 r102  
    77        </appenders>
    88        <loggers>
    9                 <logger name="com.framsticks" level="warn" />
     9                <logger name="com.framsticks" level="info" />
     10                <logger name="com.framsticks.running.ExternalProcess" level="debug" />
    1011                <logger name="com.framsticks.test.TestConfiguration" level="info" />
     12                <logger name="com.framsticks.experiment" level="debug" />
     13                <logger name="com.framsticks.test.PrimeExperiment" level="debug" />
     14                <!-- <logger name="com.framsticks.util.dispatching.AbstractJoinable" level="debug" /> -->
     15                <!-- <logger name="com.framsticks.util.dispatching.AbstractJoinable.Report" level="info" /> -->
     16                <!-- <logger name="com.framsticks.util.dispatching.Monitor" level="debug" /> -->
     17                <!-- <logger name="com.framsticks.util.dispatching.StackedJoinable" level="debug" /> -->
    1118                <root level="info">
    1219                        <appender-ref ref="Console"/>
Note: See TracChangeset for help on using the changeset viewer.