Changeset 79 for java/main/src/test
- Timestamp:
- 01/09/13 13:00:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/test/java/com/framsticks/parsers/F0ParserTest.java
r78 r79 39 39 { 40 40 assertEquals(12, accesses.size()); 41 assertTrue(accesses.get(0).getSelected() instanceof F0Genotype);41 assertTrue(accesses.get(0).getSelected() instanceof Model); 42 42 assertEquals("1,2,3,\"dsadsa,,,,", accesses.get(5).get("i", String.class)); 43 43 assertEquals("|:p=0.25,r=1", accesses.get(7).get("d", String.class)); … … 52 52 } 53 53 54 F0Genotype f0Genotype = Genotype.build(objects);54 Model model = Model.build(objects); 55 55 { 56 assertEquals(3, f0Genotype.getParts().size());57 assertEquals(6, f0Genotype.getNeuroDefs().size());58 assertEquals(2, f0Genotype.getJoints().size());56 assertEquals(3, model.getParts().size()); 57 assertEquals(6, model.getNeuroDefs().size()); 58 assertEquals(2, model.getJoints().size()); 59 59 60 assertEquals(new Integer(0), f0Genotype.getJoints().get(0).part1); 61 assertEquals(new Integer(1), f0Genotype.getJoints().get(0).part2); 62 assertEquals(new Integer(1), f0Genotype.getNeuroDefs().get(0).part); 63 assertEquals(new Integer(-1), f0Genotype.getNeuroDefs().get(0).joint); 64 assertEquals("|:p=0.25,r=1", f0Genotype.getNeuroDefs().get(1).details); 65 assertEquals("N", f0Genotype.getNeuroDefs().get(3).details); 66 assertEquals(new Integer(-1), f0Genotype.getNeuroDefs().get(4).part); 60 assertEquals(new Integer(0), model.getJoints().get(0).part1); 61 assertEquals(new Integer(1), model.getJoints().get(0).part2); 62 assertEquals(new Integer(1), model.getNeuroDefs().get(0).part); 63 assertEquals(new Integer(-1), model.getNeuroDefs().get(0).joint); 64 assertEquals("|:p=0.25,r=1", model.getNeuroDefs().get(1).details); 65 assertEquals("N", model.getNeuroDefs().get(3).details); 66 assertEquals(new Integer(-1), model.getNeuroDefs().get(4).part); 67 68 assertEquals(2.0, model.getParts().get(1).getPosition().x, 0.0); 69 assertTrue(model.getParts().get(2).getPosition().sub(new Point3d(2.27236, -0.0792596, -0.958924)).length() < 0.0001); 70 assertTrue(model.getParts().get(2).getOrientation().y.sub(new Point3d(0.870277, -0.404792, 0.280644)).length() < 0.0001); 67 71 } 68 72 69 F0Model f0model = F0Model.build(f0Genotype);70 {71 assertEquals(2.0, f0model.getMechParts().get(1).getPosition().x, 0.0);72 assertTrue(f0model.getMechParts().get(2).getPosition().sub(new Point3d(2.27236, -0.0792596, -0.958924)).length() < 0.0001);73 assertTrue(f0model.getMechParts().get(2).getOrientation().y.sub(new Point3d(0.870277, -0.404792, 0.280644)).length() < 0.0001);74 }75 73 76 74 }
Note: See TracChangeset
for help on using the changeset viewer.