Changeset 88 for java/main/src/test/java
- Timestamp:
- 06/30/13 12:48:20 (11 years ago)
- Location:
- java/main/src/test/java/com/framsticks
- Files:
-
- 6 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/test/java/com/framsticks/gui/BrowserTest.java
r87 r88 3 3 import javax.swing.JFrame; 4 4 5 import org.apache.commons.configuration.PropertiesConfiguration;6 5 import org.apache.log4j.Logger; 7 6 import org.fest.swing.edt.FailOnThreadViolationRepaintManager; … … 16 15 import com.framsticks.remote.RemoteInstance; 17 16 import com.framsticks.test.TestConfiguration; 17 import com.framsticks.util.dispatching.Dispatching; 18 import com.framsticks.util.dispatching.JoinableMonitor; 19 // import com.framsticks.util.dispatching.Dispatching; 18 20 19 21 import static org.fest.assertions.Assertions.*; … … 25 27 private static final Logger log = Logger.getLogger(BrowserTest.class); 26 28 29 JoinableMonitor monitor; 27 30 Browser browser; 28 31 Robot robot; … … 37 40 38 41 browser = new Browser(); 39 browser.configure(new PropertiesConfiguration());42 monitor = new JoinableMonitor(browser); 40 43 41 44 RemoteInstance localhost = new RemoteInstance(); … … 43 46 localhost.setAddress("localhost:9009"); 44 47 45 browser.add EndpointForInstance(localhost);48 browser.addInstance(localhost); 46 49 47 browser.start();50 monitor.use(); 48 51 // robot.waitForIdle(); 49 52 frame = new FrameFixture(robot, … … 51 54 @Override 52 55 protected JFrame executeInEDT() throws Throwable { 53 return browser.getMainFrame() ;56 return browser.getMainFrame().getSwing(); 54 57 } 55 58 })); … … 86 89 clickAndExpandPath(tree, "localhost/simulator/genepools/groups"); 87 90 clickAndExpandPath(tree, "localhost/simulator/genepools/groups/Genotypes"); 91 92 93 94 95 96 88 97 // tree.clickPath("localhost/simulator/genepools/groups/Genotypes/genotypes"); 89 98 // robot.waitForIdle(); … … 97 106 } 98 107 99 public void sleep(int seconds) {100 try {101 Thread.sleep(seconds * 1000, 0);102 } catch (InterruptedException e) {103 e.printStackTrace();104 }105 }106 108 107 109 @AfterClass 108 110 public void tearDown() { 109 // frame.close(); 110 frame.cleanUp(); 111 log.info("before close"); 112 113 monitor.drop(); 114 115 Dispatching.joinAbsolutely(browser); 116 // frame.cleanUp(); 117 // log.info("before close"); 118 // browser.interrupt(); 119 120 // try { 121 // // frame.close(); 122 // } catch (Throwable t) { 123 // log.error("caught ", t); 124 // } 125 // log.info("after close"); 126 // // frame.close(); 127 // // frame.cleanUp(); 128 129 130 131 // Dispatching.join(browser); 111 132 } 112 133 -
java/main/src/test/java/com/framsticks/params/ParamBuilderTest.java
r87 r88 20 20 builderFramsClass = FramsClass.build().forClass(ParamBuilder.class); 21 21 22 assertThat(builderFramsClass.getParamCount()).isEqualTo( 6);22 assertThat(builderFramsClass.getParamCount()).isEqualTo(10); 23 23 assertThat(builderFramsClass.getName()).isEqualTo("prop"); 24 24 assertThat(builderFramsClass.getId()).isEqualTo("prop"); -
java/main/src/test/java/com/framsticks/parsers/F0ParserTest.java
r87 r88 5 5 import com.framsticks.model.*; 6 6 import com.framsticks.model.Package; 7 import com.framsticks.model.f0.Schema; 7 8 import com.framsticks.params.*; 8 9 import com.framsticks.params.types.FloatParam; … … 29 30 @BeforeClass 30 31 public void setUp() throws Exception { 31 schema = new Schema(Schema.getDefaultDefinitionAsStream());32 schema = Schema.load(Schema.getDefaultDefinitionAsStream()); 32 33 Package.register(schema.getRegistry()); 33 34 } … … 35 36 @Test 36 37 public void primitiveParam() { 37 FramsClass joint = schema.get Registry().getInfoFromCache("j");38 FramsClass joint = schema.getFramsClass("j"); 38 39 PrimitiveParam<?> dx = joint.getParamEntry("dx", PrimitiveParam.class); 39 40 assertThat(dx).isInstanceOf(FloatParam.class); … … 47 48 @Test 48 49 public void readF0() throws IOException, ParseException { 50 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)); 52 49 53 accesses = new F0Parser(schema, F0ParserTest.class.getResourceAsStream("/parsers/f0_example.txt")).parse(); 50 54 … … 75 79 assertThat(model.getJoints().get(0).part1).isEqualTo(0); 76 80 assertThat(model.getJoints().get(0).part2).isEqualTo(1); 81 assertThat(model.getNeuroDefs().size()).isEqualTo(6); 77 82 assertThat(model.getNeuroDefs().get(0).part).isEqualTo(1); 78 83 assertThat(model.getNeuroDefs().get(0).joint).isEqualTo(-1); … … 89 94 public void print() throws Exception { 90 95 ListSink sink = new ListSink(); 96 97 91 98 new F0Writer(schema, model, sink).write(); 92 99 -
java/main/src/test/java/com/framsticks/test/TestConfiguration.java
r84 r88 11 11 12 12 @BeforeClass 13 public staticvoid setUpConfiguration() {13 public void setUpConfiguration() { 14 14 PropertyConfigurator.configure(TestConfiguration.class.getResource("/log4j.properties")); 15 log.info(" logging configured");15 log.info("testing " + this.getClass()); 16 16 } 17 17
Note: See TracChangeset
for help on using the changeset viewer.