} catch (CmdLineActionException ignore) {
}
}
public void testDataFlow() throws CmdLineActionException {
ActionMessagePrinter printer = new ActionMessagePrinter();
MockGetProductByNameCliAction cliAction = new MockGetProductByNameCliAction();
cliAction.setProductName(PRODUCT_NAME);
cliAction.execute(printer);
assertEquals(20, printer.getPrintedMessages().size());
assertEquals("Product:", printer.getPrintedMessages().get(0));
assertEquals("\n", printer.getPrintedMessages().get(1));
assertEquals(" - ID: " + PRODUCT_ID, printer.getPrintedMessages().get(2));
assertEquals("\n", printer.getPrintedMessages().get(3));
assertEquals(" - Name: " + PRODUCT_NAME, printer.getPrintedMessages()
.get(4));
assertEquals("\n", printer.getPrintedMessages().get(5));
assertEquals(" - ProductType: " + PRODUCT_TYPE_NAME, printer
.getPrintedMessages().get(6));
assertEquals("\n", printer.getPrintedMessages().get(7));
assertEquals(" - Structure: " + PRODUCT_STRUCTURE, printer
.getPrintedMessages().get(8));
assertEquals("\n", printer.getPrintedMessages().get(9));
assertEquals(" - Status: " + PRODUCT_STATUS, printer.getPrintedMessages()
.get(10));
assertEquals("\n", printer.getPrintedMessages().get(11));
assertEquals(" - RootRef: " + ROOT_REF,
printer.getPrintedMessages().get(12));
assertEquals("\n", printer.getPrintedMessages().get(13));
assertEquals(" - References: ", printer.getPrintedMessages().get(14));
assertEquals("\n", printer.getPrintedMessages().get(15));
assertEquals(" - " + DS_REF_1 + " (" + FILE_SIZE_REF_1 + ")", printer
.getPrintedMessages().get(16));
assertEquals("\n", printer.getPrintedMessages().get(17));
assertEquals(" - " + DS_REF_2 + " (" + FILE_SIZE_REF_2 + ")", printer
.getPrintedMessages().get(18));
assertEquals("\n", printer.getPrintedMessages().get(19));
}