use of com.iluwatar.delegation.simple.printers.CanonPrinter in project java-design-patterns by iluwatar.
the class App method main.
/**
* Program entry point
*
* @param args command line args
*/
public static void main(String[] args) {
PrinterController hpPrinterController = new PrinterController(new HpPrinter());
PrinterController canonPrinterController = new PrinterController(new CanonPrinter());
PrinterController epsonPrinterController = new PrinterController(new EpsonPrinter());
hpPrinterController.print(MESSAGE_TO_PRINT);
canonPrinterController.print(MESSAGE_TO_PRINT);
epsonPrinterController.print(MESSAGE_TO_PRINT);
}
use of com.iluwatar.delegation.simple.printers.CanonPrinter in project java-design-patterns by iluwatar.
the class DelegateTest method testCanonPrinter.
@Test
public void testCanonPrinter() throws Exception {
PrinterController printerController = new PrinterController(new CanonPrinter());
printerController.print(MESSAGE);
assertEquals("Canon Printer : Test Message Printed", appender.getLastMessage());
}
Aggregations