Desktop tool for browsing account info from EVE-Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ApiParserTest.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package uk.co.md87.evetool.api.parser;
  6. import org.jdom.input.SAXBuilder;
  7. import org.junit.Test;
  8. import static org.junit.Assert.*;
  9. /**
  10. *
  11. * @author chris
  12. */
  13. public class ApiParserTest {
  14. /**
  15. * Test of parseResult method, of class ApiParser.
  16. */
  17. @Test
  18. public void testParseResult() throws Exception {
  19. final ApiParser parser = new ApiParser();
  20. final ApiResult result = parser.parseResult(new SAXBuilder().build(getClass()
  21. .getResourceAsStream("/uk/co/md87/evetool/api/data/sample-charsheet.xml")));
  22. assertEquals(3, result.getChildren().size());
  23. assertEquals("currentTime", ((NamedApiElement) result.getChildren().get(0)).getName());
  24. assertEquals("result", ((NamedApiElement) result.getChildren().get(1)).getName());
  25. assertEquals("cachedUntil", ((NamedApiElement) result.getChildren().get(2)).getName());
  26. assertTrue(result.getChildren().get(0).getChildren().isEmpty());
  27. assertEquals(11, result.getChildren().get(1).getChildren().size());
  28. assertTrue(result.getChildren().get(2).getChildren().isEmpty());
  29. }
  30. }