Changeset 102 for java/main/src/test
- Timestamp:
- 07/16/13 23:31:35 (11 years ago)
- 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 7 7 8 8 import com.framsticks.core.ListChange.Action; 9 import com.framsticks.params.AccessOperations;9 import static com.framsticks.params.AccessOperations.*; 10 10 import com.framsticks.params.FramsClass; 11 11 import com.framsticks.params.ListSink; … … 40 40 public void testFramsClass() { 41 41 framsClass = FramsClass.build().forClass(ListChange.class); 42 assertThat(framsClass.getParamCount()).isEqualTo( 3);42 assertThat(framsClass.getParamCount()).isEqualTo(4); 43 43 } 44 44 … … 60 60 61 61 @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")); 64 64 65 65 assertThat(listChange.action).isEqualTo(Action.Modify); … … 68 68 69 69 ListSink sink = new ListSink(); 70 access.select(listChange).save(sink);70 save(access.select(listChange), sink); 71 71 assertThat(sink.getOut()).isEqualTo(Arrays.asList("ListChange:", "type:2", "pos:0", "id:test", "")); 72 72 } -
java/main/src/test/java/com/framsticks/gui/console/DirectConsoleTest.java
r97 r102 20 20 protected Joinable createSubject() { 21 21 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")); 26 23 joinables = new JoinableCollection<>(); 27 24 joinables.setObservableName("connection and console"); 28 25 joinables.add(console); 29 joinables.add(con nection);26 joinables.add(console.getConnection()); 30 27 31 28 return joinables; -
java/main/src/test/java/com/framsticks/test/MonitorBasedTest.java
r96 r102 30 30 } 31 31 32 @AfterClass(timeOut = 3000 )32 @AfterClass(timeOut = 30000) 33 33 public void tearDown() { 34 34 monitor.drop().join(); -
java/main/src/test/java/com/framsticks/test/PrimeExperimentTest.java
r101 r102 6 6 7 7 import com.framsticks.core.XmlBasedTest; 8 import com.framsticks.util.dispatching.Dispatching; 9 import com.framsticks.util.dispatching.StackedJoinable; 10 11 import org.apache.logging.log4j.Logger; 12 import org.apache.logging.log4j.LogManager; 8 13 9 14 @Test 10 15 public class PrimeExperimentTest extends XmlBasedTest { 11 16 17 private static final Logger log = LogManager.getLogger(PrimeExperimentTest.class); 18 12 19 protected PrimeExperiment experiment; 20 13 21 14 22 @Test 15 23 public void start() { 24 log.debug("starting"); 16 25 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); 19 36 } 37 20 38 } -
java/main/src/test/resources/configs/PrimeExperimentTest.xml
r101 r102 3 3 <import class="com.framsticks.test.PrimeExperiment" /> 4 4 <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> 7 24 </Framsticks> -
java/main/src/test/resources/configs/ServerTest.xml
r101 r102 6 6 <import class="com.framsticks.test.TestClass" /> 7 7 <import class="com.framsticks.running.LoggingOutputListener" /> 8 <Server port="900 7">8 <Server port="9006"> 9 9 <LocalTree name="test"> 10 10 <TestClass name="a test name" /> 11 11 </LocalTree> 12 12 </Server> 13 <RemoteTree name="remote" address="localhost:900 7" />13 <RemoteTree name="remote" address="localhost:9006" /> 14 14 </Framsticks> -
java/main/src/test/resources/log4j2.xml
r100 r102 7 7 </appenders> 8 8 <loggers> 9 <logger name="com.framsticks" level="warn" /> 9 <logger name="com.framsticks" level="info" /> 10 <logger name="com.framsticks.running.ExternalProcess" level="debug" /> 10 11 <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" /> --> 11 18 <root level="info"> 12 19 <appender-ref ref="Console"/>
Note: See TracChangeset
for help on using the changeset viewer.