package ru.rkhaustov.orderbook;

import org.junit.Test;

import static org.junit.Assert.assertThat;
import static org.hamcrest.number.IsCloseTo.closeTo;

/**
 * Created by rvkha_000 on 11.06.2017.
 */
public class OrderBookTest {
    /**
     * Method readXML(fileName).
     * Method outputOrderBook.
     */
    @Test
    public void whenReadXmlThenLoadBidAsk() {
        final String Path = "C:\\other\\Projects\\Java\\job4j\\rkhaustov\\chapter_005\\src\\main\\java\\ru\\rkhaustov\\orderbook\\";
        final String fileName = Path + "orders.xml";
        OrderBook orderBook = new OrderBook();

        long startTime = System.currentTimeMillis();

        orderBook.readXML(fileName);

        long firstTime = System.currentTimeMillis();

        orderBook.outputOrderBook();

        long secondTime = System.currentTimeMillis();

        System.out.println(String.format("Time load xml: %s sec.", (float) (firstTime - startTime) / 1000));
        System.out.println(String.format("Time output  : %s sec.", (float) (secondTime - firstTime) / 1000));
        System.out.println(String.format("All time     : %s sec.", (float) (secondTime - startTime) / 1000));
        assertThat((double) (secondTime - startTime) / 1000, closeTo(5.0, 1.0));
    }

}
@@ -364,140 +364,8 @@
  %7B%0A 
-       final String Path = %22C:%5C%5Cother%5C%5CProjects%5C%5CJava%5C%5Cjob4j%5C%5Crkhaustov%5C%5Cchapter_005%5C%5Csrc%5C%5Cmain%5C%5Cjava%5C%5Cru%5C%5Crkhaustov%5C%5Corderbook%5C%5C%22;%0A
     
@@ -395,15 +395,8 @@
 me =
- Path +
  %22or

Order Book #1001