Make AppTest.java match other patterns and update AppTest.java to match other patterns #324
This commit is contained in:
parent
84fd2348ea
commit
fb0617e9c5
@ -0,0 +1,24 @@
|
|||||||
|
package com.iluwatar.delegation.simple.printers;
|
||||||
|
|
||||||
|
import com.iluwatar.delegation.simple.Printer;
|
||||||
|
import com.iluwatar.delegation.simple.PrinterController;
|
||||||
|
|
||||||
|
public class App {
|
||||||
|
|
||||||
|
public static final String MESSAGE_TO_PRINT = "hello world";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Printer hpPrinter = new HPPrinter();
|
||||||
|
Printer canonPrinter = new CanonPrinter();
|
||||||
|
Printer epsonPrinter = new EpsonPrinter();
|
||||||
|
|
||||||
|
PrinterController hpPrinterController = new PrinterController(hpPrinter);
|
||||||
|
PrinterController canonPrinterController = new PrinterController(canonPrinter);
|
||||||
|
PrinterController epsonPrinterController = new PrinterController(epsonPrinter);
|
||||||
|
|
||||||
|
hpPrinterController.print(MESSAGE_TO_PRINT);
|
||||||
|
canonPrinterController.print(MESSAGE_TO_PRINT);
|
||||||
|
epsonPrinterController.print(MESSAGE_TO_PRINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,26 +1,14 @@
|
|||||||
package com.iluwatar.delegation.simple;
|
package com.iluwatar.delegation.simple;
|
||||||
|
|
||||||
import com.iluwatar.delegation.simple.printers.CanonPrinter;
|
import com.iluwatar.delegation.simple.printers.App;
|
||||||
import com.iluwatar.delegation.simple.printers.EpsonPrinter;
|
|
||||||
import com.iluwatar.delegation.simple.printers.HPPrinter;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class AppTest {
|
public class AppTest {
|
||||||
|
|
||||||
public static final String MESSAGE_TO_PRINT = "hello world";
|
@Test
|
||||||
|
public void test() {
|
||||||
|
String[] args = {};
|
||||||
|
App.main(args);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void main() {
|
|
||||||
Printer hpPrinter = new HPPrinter();
|
|
||||||
Printer canonPrinter = new CanonPrinter();
|
|
||||||
Printer epsonPrinter = new EpsonPrinter();
|
|
||||||
|
|
||||||
PrinterController hpPrinterController = new PrinterController(hpPrinter);
|
|
||||||
PrinterController canonPrinterController = new PrinterController(canonPrinter);
|
|
||||||
PrinterController epsonPrinterController = new PrinterController(epsonPrinter);
|
|
||||||
|
|
||||||
hpPrinterController.print(MESSAGE_TO_PRINT);
|
|
||||||
canonPrinterController.print(MESSAGE_TO_PRINT);
|
|
||||||
epsonPrinterController.print(MESSAGE_TO_PRINT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user