Search in sources :

Example 1 with EpsonPrinter

use of com.iluwatar.delegation.simple.printers.EpsonPrinter 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);
}
Also used : EpsonPrinter(com.iluwatar.delegation.simple.printers.EpsonPrinter) CanonPrinter(com.iluwatar.delegation.simple.printers.CanonPrinter) HpPrinter(com.iluwatar.delegation.simple.printers.HpPrinter)

Example 2 with EpsonPrinter

use of com.iluwatar.delegation.simple.printers.EpsonPrinter in project java-design-patterns by iluwatar.

the class DelegateTest method testEpsonPrinter.

@Test
public void testEpsonPrinter() throws Exception {
    PrinterController printerController = new PrinterController(new EpsonPrinter());
    printerController.print(MESSAGE);
    assertEquals("Epson Printer : Test Message Printed", appender.getLastMessage());
}
Also used : EpsonPrinter(com.iluwatar.delegation.simple.printers.EpsonPrinter) Test(org.junit.jupiter.api.Test)

Aggregations

EpsonPrinter (com.iluwatar.delegation.simple.printers.EpsonPrinter)2 CanonPrinter (com.iluwatar.delegation.simple.printers.CanonPrinter)1 HpPrinter (com.iluwatar.delegation.simple.printers.HpPrinter)1 Test (org.junit.jupiter.api.Test)1