@Test public void shouldReportSpeed() throws Exception { traceThread.run(); assertThat(mockEngine.locations.get(0).getSpeed()).isEqualTo(10f); assertThat(mockEngine.locations.get(1).getSpeed()).isEqualTo(20f); assertThat(mockEngine.locations.get(2).getSpeed()).isEqualTo(30f); }
@Override public void run() { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final XPath xPath = XPathFactory.newInstance().newXPath(); final String expression = " final String speedExpression = " NodeList nodeList = null; NodeList speedList = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(traceFile); nodeList = (NodeList) xPath.compile(expression).evaluate(document, XPathConstants.NODESET); speedList = (NodeList) xPath.compile(speedExpression).evaluate(document, XPathConstants.NODESET); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XPathExpressionException e) { e.printStackTrace(); } parse(nodeList, speedList); }
TraceThread extends Thread { @Override public void run() { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final XPath xPath = XPathFactory.newInstance().newXPath(); final String expression = " final String speedExpression = " NodeList nodeList = null; NodeList speedList = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(traceFile); nodeList = (NodeList) xPath.compile(expression).evaluate(document, XPathConstants.NODESET); speedList = (NodeList) xPath.compile(speedExpression).evaluate(document, XPathConstants.NODESET); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XPathExpressionException e) { e.printStackTrace(); } parse(nodeList, speedList); } }
TraceThread extends Thread { @Override public void run() { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final XPath xPath = XPathFactory.newInstance().newXPath(); final String expression = " final String speedExpression = " NodeList nodeList = null; NodeList speedList = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(traceFile); nodeList = (NodeList) xPath.compile(expression).evaluate(document, XPathConstants.NODESET); speedList = (NodeList) xPath.compile(speedExpression).evaluate(document, XPathConstants.NODESET); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XPathExpressionException e) { e.printStackTrace(); } parse(nodeList, speedList); } TraceThread(Context context, File traceFile, MockEngine engine, SleepFactory sleepFactory); }
TraceThread extends Thread { @Override public void run() { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final XPath xPath = XPathFactory.newInstance().newXPath(); final String expression = " final String speedExpression = " NodeList nodeList = null; NodeList speedList = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(traceFile); nodeList = (NodeList) xPath.compile(expression).evaluate(document, XPathConstants.NODESET); speedList = (NodeList) xPath.compile(speedExpression).evaluate(document, XPathConstants.NODESET); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XPathExpressionException e) { e.printStackTrace(); } parse(nodeList, speedList); } TraceThread(Context context, File traceFile, MockEngine engine, SleepFactory sleepFactory); void cancel(); boolean isCanceled(); @Override void run(); }
TraceThread extends Thread { @Override public void run() { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final XPath xPath = XPathFactory.newInstance().newXPath(); final String expression = " final String speedExpression = " NodeList nodeList = null; NodeList speedList = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(traceFile); nodeList = (NodeList) xPath.compile(expression).evaluate(document, XPathConstants.NODESET); speedList = (NodeList) xPath.compile(speedExpression).evaluate(document, XPathConstants.NODESET); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XPathExpressionException e) { e.printStackTrace(); } parse(nodeList, speedList); } TraceThread(Context context, File traceFile, MockEngine engine, SleepFactory sleepFactory); void cancel(); boolean isCanceled(); @Override void run();  }