Removed AvoidStarImport Rule

Added JavaDocType Rule
This commit is contained in:
Mudit Porwal
2017-03-22 01:16:01 +08:00
parent 175e9f58c1
commit 09585c3874
105 changed files with 577 additions and 284 deletions

View File

@ -22,6 +22,12 @@
*/
package com.iluwatar.delegation.simple;
/**
* Delegator Class to delegate the implementation of the Printer.
* This ensures two things:
* - when the actual implementation of the Printer class changes the delegation will still be operational
* - the actual benefit is observed when there are more than one implementors and they share a delegation control
*/
public class PrinterController implements Printer {
private final Printer printer;

View File

@ -23,7 +23,9 @@
package com.iluwatar.delegation.simple;
import org.junit.Test;
/**
* Application Test Entry
*/
public class AppTest {
@Test

View File

@ -22,22 +22,24 @@
*/
package com.iluwatar.delegation.simple;
import static org.junit.Assert.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.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import java.util.LinkedList;
import java.util.List;
import static org.junit.Assert.assertEquals;
/**
* Test for Delegation Pattern
*/
public class DelegateTest {
private InMemoryAppender appender;
@ -78,6 +80,9 @@ public class DelegateTest {
assertEquals("Epson Printer : Test Message Printed", appender.getLastMessage());
}
/**
* Logging Appender
*/
private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private List<ILoggingEvent> log = new LinkedList<>();