Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. @Test
  2. public void testImportVehicles() throws Exception {
  3. System.out.println("importVehicles");
  4. String path = "test.xml";
  5. LinkedList<VelocityLimit> velocityList = new LinkedList<>();
  6. VelocityLimit v1 = new VelocityLimit("Highway", 31);
  7. VelocityLimit v2 = new VelocityLimit("Road", 22);
  8. velocityList.add(v1);
  9. velocityList.add(v2);
  10. LinkedList<Gear> gearList = new LinkedList<>();
  11. Gear g1 = new Gear(01,4.5F );
  12. Gear g2 = new Gear(02,3.5F );
  13. gearList.add(g1);
  14. gearList.add(g2);
  15. LinkedList<Regime> regimeList = new LinkedList<>();
  16. Regime r1 = new Regime(115, 125, 900, 1499, 500);
  17. regimeList.add(r1);
  18. LinkedList<Throttle> throttleList = new LinkedList<>();
  19. Throttle t1 = new Throttle(25, regimeList);
  20. throttleList.add(t1);
  21. Energy energy = new Energy(900, 5500, 4F, 0.0F, gearList, throttleList);
  22.  
  23. Vehicle test = new Vehicle("Pick_up","test","car", 2, "diesel",Motorization.COMBUSTION, 2400, 1200, 0.39F, 2.4F, 0.015F, 0.8F, velocityList, energy);
  24. LinkedList<Vehicle> expResult = new LinkedList<>();
  25. expResult.add(test);
  26. LinkedList<Vehicle> result = ImportVehicleXML.importVehicles(path);
  27.  
  28. assertEquals(expResult, result);
  29.  
  30.  
  31.  
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement