Skip to content

Commit fb0617e

Browse files
committed
Make AppTest.java match other patterns and update AppTest.java to match other patterns iluwatar#324
1 parent 84fd234 commit fb0617e

File tree

2 files changed

+30
-18
lines changed
  • delegation/src
    • main/java/com/iluwatar/delegation/simple/printers
    • test/java/com/iluwatar/delegation/simple

2 files changed

+30
-18
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.iluwatar.delegation.simple.printers;
2+
3+
import com.iluwatar.delegation.simple.Printer;
4+
import com.iluwatar.delegation.simple.PrinterController;
5+
6+
public class App {
7+
8+
public static final String MESSAGE_TO_PRINT = "hello world";
9+
10+
public static void main(String[] args) {
11+
Printer hpPrinter = new HPPrinter();
12+
Printer canonPrinter = new CanonPrinter();
13+
Printer epsonPrinter = new EpsonPrinter();
14+
15+
PrinterController hpPrinterController = new PrinterController(hpPrinter);
16+
PrinterController canonPrinterController = new PrinterController(canonPrinter);
17+
PrinterController epsonPrinterController = new PrinterController(epsonPrinter);
18+
19+
hpPrinterController.print(MESSAGE_TO_PRINT);
20+
canonPrinterController.print(MESSAGE_TO_PRINT);
21+
epsonPrinterController.print(MESSAGE_TO_PRINT);
22+
}
23+
24+
}
Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
package com.iluwatar.delegation.simple;
22

3-
import com.iluwatar.delegation.simple.printers.CanonPrinter;
4-
import com.iluwatar.delegation.simple.printers.EpsonPrinter;
5-
import com.iluwatar.delegation.simple.printers.HPPrinter;
3+
import com.iluwatar.delegation.simple.printers.App;
64
import org.junit.Test;
75

86
public class AppTest {
97

10-
public static final String MESSAGE_TO_PRINT = "hello world";
8+
@Test
9+
public void test() {
10+
String[] args = {};
11+
App.main(args);
12+
}
1113

12-
@Test
13-
public void main() {
14-
Printer hpPrinter = new HPPrinter();
15-
Printer canonPrinter = new CanonPrinter();
16-
Printer epsonPrinter = new EpsonPrinter();
17-
18-
PrinterController hpPrinterController = new PrinterController(hpPrinter);
19-
PrinterController canonPrinterController = new PrinterController(canonPrinter);
20-
PrinterController epsonPrinterController = new PrinterController(epsonPrinter);
21-
22-
hpPrinterController.print(MESSAGE_TO_PRINT);
23-
canonPrinterController.print(MESSAGE_TO_PRINT);
24-
epsonPrinterController.print(MESSAGE_TO_PRINT);
25-
}
2614
}

0 commit comments

Comments
 (0)