Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11 * Moves cqrs pattern to Java 11 * Moves dao pattern to Java 11 * Moves data-bus pattern to Java 11 * Moves data-locality pattern to Java 11 * Moves data-mapper pattern to Java 11 * Moves data-transfer-object pattern to Java 11 * Moves decorator pattern to Java 11 * Moves delegation pattern to Java 11 * Moves dependency-injection to Java 11 * Moves dirty-flag to Java 11 * Moves double-buffer to Java 11 * Moves double-checked-locking to Java 11 * Moves double-dispatch to Java 11 * Corrects with changes thats breaking test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
5681684157
commit
ea57934db6
@ -51,9 +51,9 @@ public class App {
|
||||
* @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());
|
||||
var hpPrinterController = new PrinterController(new HpPrinter());
|
||||
var canonPrinterController = new PrinterController(new CanonPrinter());
|
||||
var epsonPrinterController = new PrinterController(new EpsonPrinter());
|
||||
|
||||
hpPrinterController.print(MESSAGE_TO_PRINT);
|
||||
canonPrinterController.print(MESSAGE_TO_PRINT);
|
||||
|
@ -32,8 +32,7 @@ public class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,22 +23,21 @@
|
||||
|
||||
package com.iluwatar.delegation.simple;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.AppenderBase;
|
||||
import com.iluwatar.delegation.simple.printers.CanonPrinter;
|
||||
import com.iluwatar.delegation.simple.printers.EpsonPrinter;
|
||||
import com.iluwatar.delegation.simple.printers.HpPrinter;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Test for Delegation Pattern
|
||||
*/
|
||||
@ -60,7 +59,7 @@ public class DelegateTest {
|
||||
|
||||
@Test
|
||||
public void testCanonPrinter() throws Exception {
|
||||
PrinterController printerController = new PrinterController(new CanonPrinter());
|
||||
var printerController = new PrinterController(new CanonPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
assertEquals("Canon Printer : Test Message Printed", appender.getLastMessage());
|
||||
@ -68,7 +67,7 @@ public class DelegateTest {
|
||||
|
||||
@Test
|
||||
public void testHpPrinter() throws Exception {
|
||||
PrinterController printerController = new PrinterController(new HpPrinter());
|
||||
var printerController = new PrinterController(new HpPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
assertEquals("HP Printer : Test Message Printed", appender.getLastMessage());
|
||||
@ -76,7 +75,7 @@ public class DelegateTest {
|
||||
|
||||
@Test
|
||||
public void testEpsonPrinter() throws Exception {
|
||||
PrinterController printerController = new PrinterController(new EpsonPrinter());
|
||||
var printerController = new PrinterController(new EpsonPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
assertEquals("Epson Printer : Test Message Printed", appender.getLastMessage());
|
||||
|
Reference in New Issue
Block a user