diff --git a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java index 82fd8acff..b6fca8b23 100644 --- a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java +++ b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java @@ -28,6 +28,9 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; +/** + * Test for abstract factory + */ public class AbstractFactoryTest { private App app = new App(); diff --git a/aggregator-microservices/aggregator-service/src/main/java/com/iluwatar/aggregator/microservices/App.java b/aggregator-microservices/aggregator-service/src/main/java/com/iluwatar/aggregator/microservices/App.java index 2c14774d5..c43112c2e 100644 --- a/aggregator-microservices/aggregator-service/src/main/java/com/iluwatar/aggregator/microservices/App.java +++ b/aggregator-microservices/aggregator-service/src/main/java/com/iluwatar/aggregator/microservices/App.java @@ -25,6 +25,9 @@ package com.iluwatar.aggregator.microservices; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +/** + * Spring Boot EntryPoint Class + */ @SpringBootApplication public class App { diff --git a/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java b/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java index f44aa2044..2955f6781 100644 --- a/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java +++ b/aggregator-microservices/aggregator-service/src/test/java/com/iluwatar/aggregator/microservices/AggregatorTest.java @@ -22,15 +22,18 @@ */ package com.iluwatar.aggregator.microservices; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - +/** + * Test Aggregation of domain objects + */ public class AggregatorTest { @InjectMocks @@ -64,4 +67,4 @@ public class AggregatorTest { assertEquals(inventories, testProduct.getProductInventories()); } -} \ No newline at end of file +} diff --git a/aggregator-microservices/information-microservice/src/main/java/com/iluwatar/information/microservice/InformationController.java b/aggregator-microservices/information-microservice/src/main/java/com/iluwatar/information/microservice/InformationController.java index ff020585c..63b6fb9d5 100644 --- a/aggregator-microservices/information-microservice/src/main/java/com/iluwatar/information/microservice/InformationController.java +++ b/aggregator-microservices/information-microservice/src/main/java/com/iluwatar/information/microservice/InformationController.java @@ -26,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +/** + * Controller providing endpoints to retrieve information about products + */ @RestController public class InformationController { diff --git a/aggregator-microservices/information-microservice/src/test/java/com/iluwatar/information/microservice/InformationControllerTest.java b/aggregator-microservices/information-microservice/src/test/java/com/iluwatar/information/microservice/InformationControllerTest.java index 12d59aee6..127dd3956 100644 --- a/aggregator-microservices/information-microservice/src/test/java/com/iluwatar/information/microservice/InformationControllerTest.java +++ b/aggregator-microservices/information-microservice/src/test/java/com/iluwatar/information/microservice/InformationControllerTest.java @@ -25,6 +25,9 @@ package com.iluwatar.information.microservice; import org.junit.Assert; import org.junit.Test; +/** + * Test for Information Rest Controller + */ public class InformationControllerTest { @Test @@ -36,4 +39,4 @@ public class InformationControllerTest { Assert.assertEquals("The Product Title.", title); } -} \ No newline at end of file +} diff --git a/aggregator-microservices/inventory-microservice/src/main/java/com/iluwatar/inventory/microservice/InventoryController.java b/aggregator-microservices/inventory-microservice/src/main/java/com/iluwatar/inventory/microservice/InventoryController.java index 987ab0b3d..e6b2eca80 100644 --- a/aggregator-microservices/inventory-microservice/src/main/java/com/iluwatar/inventory/microservice/InventoryController.java +++ b/aggregator-microservices/inventory-microservice/src/main/java/com/iluwatar/inventory/microservice/InventoryController.java @@ -26,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +/** + * Controller providing endpoints to retrieve product inventories + */ @RestController public class InventoryController { diff --git a/aggregator-microservices/inventory-microservice/src/test/java/com/iluwatar/inventory/microservice/InventoryControllerTest.java b/aggregator-microservices/inventory-microservice/src/test/java/com/iluwatar/inventory/microservice/InventoryControllerTest.java index b461461d3..b04370fba 100644 --- a/aggregator-microservices/inventory-microservice/src/test/java/com/iluwatar/inventory/microservice/InventoryControllerTest.java +++ b/aggregator-microservices/inventory-microservice/src/test/java/com/iluwatar/inventory/microservice/InventoryControllerTest.java @@ -25,8 +25,10 @@ package com.iluwatar.inventory.microservice; import org.junit.Assert; import org.junit.Test; +/** + * Test Inventory Rest Controller + */ public class InventoryControllerTest { - @Test public void testGetProductInventories() throws Exception { InventoryController inventoryController = new InventoryController(); @@ -35,4 +37,4 @@ public class InventoryControllerTest { Assert.assertEquals(5, numberOfInventories); } -} \ No newline at end of file +} diff --git a/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java b/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java index fe8e76db4..6a79e5d00 100644 --- a/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java +++ b/api-gateway/api-gateway-service/src/test/java/com/iluwatar/api/gateway/ApiGatewayTest.java @@ -22,15 +22,18 @@ */ package com.iluwatar.api.gateway; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - +/** + * Test API Gateway Pattern + */ public class ApiGatewayTest { @InjectMocks diff --git a/api-gateway/image-microservice/src/test/java/com/iluwatar/image/microservice/ImageControllerTest.java b/api-gateway/image-microservice/src/test/java/com/iluwatar/image/microservice/ImageControllerTest.java index 3f4154b58..1b934014a 100644 --- a/api-gateway/image-microservice/src/test/java/com/iluwatar/image/microservice/ImageControllerTest.java +++ b/api-gateway/image-microservice/src/test/java/com/iluwatar/image/microservice/ImageControllerTest.java @@ -25,6 +25,9 @@ package com.iluwatar.image.microservice; import org.junit.Assert; import org.junit.Test; +/** + * Test for Image Rest Controller + */ public class ImageControllerTest { @Test public void testGetImagePath() { diff --git a/api-gateway/price-microservice/src/test/java/com/iluwatar/price/microservice/PriceControllerTest.java b/api-gateway/price-microservice/src/test/java/com/iluwatar/price/microservice/PriceControllerTest.java index 634a60b04..b1fe66d42 100644 --- a/api-gateway/price-microservice/src/test/java/com/iluwatar/price/microservice/PriceControllerTest.java +++ b/api-gateway/price-microservice/src/test/java/com/iluwatar/price/microservice/PriceControllerTest.java @@ -25,6 +25,10 @@ package com.iluwatar.price.microservice; import org.junit.Assert; import org.junit.Test; + +/** + * Test for Price Rest Controller + */ public class PriceControllerTest { @Test public void testgetPrice() { diff --git a/async-method-invocation/src/main/java/com/iluwatar/async/method/invocation/AsyncResult.java b/async-method-invocation/src/main/java/com/iluwatar/async/method/invocation/AsyncResult.java index 3fa99cc27..f7fd9ab61 100644 --- a/async-method-invocation/src/main/java/com/iluwatar/async/method/invocation/AsyncResult.java +++ b/async-method-invocation/src/main/java/com/iluwatar/async/method/invocation/AsyncResult.java @@ -25,8 +25,8 @@ package com.iluwatar.async.method.invocation; import java.util.concurrent.ExecutionException; /** - * * AsyncResult interface + * @param parameter returned when getValue is invoked */ public interface AsyncResult { diff --git a/checkstyle.xml b/checkstyle.xml index 46b1aa354..37db7e711 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -32,10 +32,10 @@ Source = https://github.com/checkstyle/checkstyle/tree/master/src/main/resources Checkstyle configurartion that checks the Google coding conventions from: - + - Google Java Style https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html - + Checkstyle is very configurable. Be sure to read the documentation at http://checkstyle.sf.net (or in your downloaded distribution). @@ -44,12 +44,12 @@ To completely disable a check, just comment it out or delete it from the file. Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov. - + --> - + @@ -77,7 +77,6 @@ - @@ -120,7 +119,7 @@ - + @@ -185,6 +184,10 @@ + + + + find(int studentId); diff --git a/data-mapper/src/main/java/com/iluwatar/datamapper/StudentDataMapperImpl.java b/data-mapper/src/main/java/com/iluwatar/datamapper/StudentDataMapperImpl.java index 7ecd9e7f8..685a439ac 100644 --- a/data-mapper/src/main/java/com/iluwatar/datamapper/StudentDataMapperImpl.java +++ b/data-mapper/src/main/java/com/iluwatar/datamapper/StudentDataMapperImpl.java @@ -22,6 +22,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; +/** + * Implementation of Actions on Students Data + */ public final class StudentDataMapperImpl implements StudentDataMapper { /* Note: Normally this would be in the form of an actual database */ diff --git a/data-mapper/src/test/java/com/iluwatar/datamapper/StudentTest.java b/data-mapper/src/test/java/com/iluwatar/datamapper/StudentTest.java index a3c0e46c1..ec35b21de 100644 --- a/data-mapper/src/test/java/com/iluwatar/datamapper/StudentTest.java +++ b/data-mapper/src/test/java/com/iluwatar/datamapper/StudentTest.java @@ -18,17 +18,21 @@ */ package com.iluwatar.datamapper; -import org.junit.Test; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +/** + * Tests {@link Student}. + */ public final class StudentTest { @Test /** * This API tests the equality behaviour of Student object * Object Equality should work as per logic defined in equals method - * + * * @throws Exception if any execution error during test */ public void testEquality() throws Exception { diff --git a/delegation/src/main/java/com/iluwatar/delegation/simple/PrinterController.java b/delegation/src/main/java/com/iluwatar/delegation/simple/PrinterController.java index 86b841a28..c54f611ee 100644 --- a/delegation/src/main/java/com/iluwatar/delegation/simple/PrinterController.java +++ b/delegation/src/main/java/com/iluwatar/delegation/simple/PrinterController.java @@ -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; diff --git a/delegation/src/test/java/com/iluwatar/delegation/simple/AppTest.java b/delegation/src/test/java/com/iluwatar/delegation/simple/AppTest.java index a8fae59e3..434d94baa 100644 --- a/delegation/src/test/java/com/iluwatar/delegation/simple/AppTest.java +++ b/delegation/src/test/java/com/iluwatar/delegation/simple/AppTest.java @@ -23,7 +23,9 @@ package com.iluwatar.delegation.simple; import org.junit.Test; - +/** + * Application Test Entry + */ public class AppTest { @Test diff --git a/delegation/src/test/java/com/iluwatar/delegation/simple/DelegateTest.java b/delegation/src/test/java/com/iluwatar/delegation/simple/DelegateTest.java index b27539def..fd99a30dd 100644 --- a/delegation/src/test/java/com/iluwatar/delegation/simple/DelegateTest.java +++ b/delegation/src/test/java/com/iluwatar/delegation/simple/DelegateTest.java @@ -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 { private List log = new LinkedList<>(); diff --git a/dependency-injection/src/test/java/com/iluwatar/dependency/injection/utils/InMemoryAppender.java b/dependency-injection/src/test/java/com/iluwatar/dependency/injection/utils/InMemoryAppender.java index 76d1cc1dd..b79bf3d40 100644 --- a/dependency-injection/src/test/java/com/iluwatar/dependency/injection/utils/InMemoryAppender.java +++ b/dependency-injection/src/test/java/com/iluwatar/dependency/injection/utils/InMemoryAppender.java @@ -30,6 +30,10 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; + +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/double-dispatch/src/test/java/com/iluwatar/doubledispatch/CollisionTest.java b/double-dispatch/src/test/java/com/iluwatar/doubledispatch/CollisionTest.java index 5e9a001e7..3dc32905a 100644 --- a/double-dispatch/src/test/java/com/iluwatar/doubledispatch/CollisionTest.java +++ b/double-dispatch/src/test/java/com/iluwatar/doubledispatch/CollisionTest.java @@ -22,13 +22,14 @@ */ package com.iluwatar.doubledispatch; -import java.util.Objects; - import static org.junit.Assert.assertEquals; +import java.util.Objects; + /** * Date: 12/10/15 - 8:37 PM - * + * Test for Collision + * @param Type of GameObject * @author Jeroen Meulemeester */ public abstract class CollisionTest { diff --git a/event-aggregator/src/test/java/com/iluwatar/event/aggregator/EventEmitterTest.java b/event-aggregator/src/test/java/com/iluwatar/event/aggregator/EventEmitterTest.java index ba7ecbc2d..a67272789 100644 --- a/event-aggregator/src/test/java/com/iluwatar/event/aggregator/EventEmitterTest.java +++ b/event-aggregator/src/test/java/com/iluwatar/event/aggregator/EventEmitterTest.java @@ -22,22 +22,22 @@ */ package com.iluwatar.event.aggregator; -import org.junit.Test; - -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; - import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.verifyZeroInteractions; + +import java.util.Objects; +import java.util.function.Function; +import java.util.function.Supplier; +import org.junit.Test; /** * Date: 12/12/15 - 10:58 PM - * + * Tests for Event Emitter + * @param Type of Event Emitter * @author Jeroen Meulemeester */ public abstract class EventEmitterTest { @@ -115,7 +115,7 @@ public abstract class EventEmitterTest { // The observers should not have received any additional events after the week verifyNoMoreInteractions(observers); } - + /** * Go over every day of the month, and check if the event is emitted on the given day. Use an * event emitter without a default observer diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java index 85edaa815..e7a5e75b6 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/EventDoesNotExistException.java @@ -16,6 +16,9 @@ */ package com.iluwatar.event.asynchronous; +/** + * Custom Exception Class for Non Existent Event + */ public class EventDoesNotExistException extends Exception { private static final long serialVersionUID = -3398463738273811509L; diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java index 296a312a3..bfb5d4f04 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/IEvent.java @@ -16,6 +16,10 @@ */ package com.iluwatar.event.asynchronous; +/** + * Events that fulfill the start stop and list out current status behaviour + * follow this interface + */ public interface IEvent { void start(); diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java index 3c930d935..7ca5cfc9a 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/InvalidOperationException.java @@ -16,6 +16,9 @@ */ package com.iluwatar.event.asynchronous; +/** + * Type of Exception raised when the Operation being invoked is Invalid + */ public class InvalidOperationException extends Exception { private static final long serialVersionUID = -6191545255213410803L; diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java index 7c9091a15..b11f1a335 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/LongRunningEventException.java @@ -16,6 +16,9 @@ */ package com.iluwatar.event.asynchronous; +/** + * Type of Exception raised when the Operation being invoked is Long Running + */ public class LongRunningEventException extends Exception { private static final long serialVersionUID = -483423544320148809L; diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java index 2b8f2221c..17b46fd88 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/MaxNumOfEventsAllowedException.java @@ -16,6 +16,9 @@ */ package com.iluwatar.event.asynchronous; +/** + * Type of Exception raised when the max number of allowed events is exceeded + */ public class MaxNumOfEventsAllowedException extends Exception { private static final long serialVersionUID = -8430876973516292695L; diff --git a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/ThreadCompleteListener.java b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/ThreadCompleteListener.java index be4ecf93b..7a37f7614 100644 --- a/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/ThreadCompleteListener.java +++ b/event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/ThreadCompleteListener.java @@ -16,6 +16,9 @@ */ package com.iluwatar.event.asynchronous; +/** + * Interface with listener behaviour related to Thread Completion. + */ public interface ThreadCompleteListener { void completedEventHandler(final int eventId); } diff --git a/event-driven-architecture/src/main/java/com/iluwatar/eda/framework/Handler.java b/event-driven-architecture/src/main/java/com/iluwatar/eda/framework/Handler.java index e2b58cd49..3208e1edf 100644 --- a/event-driven-architecture/src/main/java/com/iluwatar/eda/framework/Handler.java +++ b/event-driven-architecture/src/main/java/com/iluwatar/eda/framework/Handler.java @@ -25,6 +25,7 @@ package com.iluwatar.eda.framework; /** * This interface can be implemented to handle different types of messages. * Every handler is responsible for a single of type message + * @param Handler can handle events of type E */ public interface Handler { @@ -35,4 +36,4 @@ public interface Handler { * @param event the {@link Event} object to be handled. */ void onEvent(E event); -} \ No newline at end of file +} diff --git a/factory-kit/src/main/java/com/iluwatar/factorykit/Axe.java b/factory-kit/src/main/java/com/iluwatar/factorykit/Axe.java index 96ce73a35..429728cbc 100644 --- a/factory-kit/src/main/java/com/iluwatar/factorykit/Axe.java +++ b/factory-kit/src/main/java/com/iluwatar/factorykit/Axe.java @@ -22,6 +22,9 @@ */ package com.iluwatar.factorykit; +/** + * Class representing Axe + */ public class Axe implements Weapon { @Override public String toString() { diff --git a/factory-kit/src/main/java/com/iluwatar/factorykit/Bow.java b/factory-kit/src/main/java/com/iluwatar/factorykit/Bow.java index b9b2708c9..c655c3be8 100644 --- a/factory-kit/src/main/java/com/iluwatar/factorykit/Bow.java +++ b/factory-kit/src/main/java/com/iluwatar/factorykit/Bow.java @@ -22,6 +22,9 @@ */ package com.iluwatar.factorykit; +/** + * Class representing Bows + */ public class Bow implements Weapon { @Override public String toString() { diff --git a/factory-kit/src/main/java/com/iluwatar/factorykit/Spear.java b/factory-kit/src/main/java/com/iluwatar/factorykit/Spear.java index 080007093..15ff8b246 100644 --- a/factory-kit/src/main/java/com/iluwatar/factorykit/Spear.java +++ b/factory-kit/src/main/java/com/iluwatar/factorykit/Spear.java @@ -21,7 +21,9 @@ * THE SOFTWARE. */ package com.iluwatar.factorykit; - +/** + * Class representing Spear + */ public class Spear implements Weapon { @Override public String toString() { diff --git a/factory-kit/src/main/java/com/iluwatar/factorykit/Sword.java b/factory-kit/src/main/java/com/iluwatar/factorykit/Sword.java index 504ddb397..42ab53799 100644 --- a/factory-kit/src/main/java/com/iluwatar/factorykit/Sword.java +++ b/factory-kit/src/main/java/com/iluwatar/factorykit/Sword.java @@ -21,7 +21,9 @@ * THE SOFTWARE. */ package com.iluwatar.factorykit; - +/** + * Class representing Swords + */ public class Sword implements Weapon { @Override public String toString() { diff --git a/factory-kit/src/test/java/com/iluwatar/factorykit/app/AppTest.java b/factory-kit/src/test/java/com/iluwatar/factorykit/app/AppTest.java index add378296..4d8691ef0 100644 --- a/factory-kit/src/test/java/com/iluwatar/factorykit/app/AppTest.java +++ b/factory-kit/src/test/java/com/iluwatar/factorykit/app/AppTest.java @@ -25,6 +25,9 @@ package com.iluwatar.factorykit.app; import com.iluwatar.factorykit.App; import org.junit.Test; +/** + * Application Test Entrypoint + */ public class AppTest { @Test diff --git a/factory-kit/src/test/java/com/iluwatar/factorykit/factorykit/FactoryKitTest.java b/factory-kit/src/test/java/com/iluwatar/factorykit/factorykit/FactoryKitTest.java index da39caa8f..3f732546d 100644 --- a/factory-kit/src/test/java/com/iluwatar/factorykit/factorykit/FactoryKitTest.java +++ b/factory-kit/src/test/java/com/iluwatar/factorykit/factorykit/FactoryKitTest.java @@ -1,4 +1,4 @@ -/** + /** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * @@ -22,12 +22,19 @@ */ package com.iluwatar.factorykit.factorykit; -import com.iluwatar.factorykit.*; -import org.junit.Before; -import org.junit.Test; - import static org.junit.Assert.assertTrue; +import com.iluwatar.factorykit.Axe; +import com.iluwatar.factorykit.Spear; +import com.iluwatar.factorykit.Sword; +import com.iluwatar.factorykit.Weapon; +import com.iluwatar.factorykit.WeaponFactory; +import com.iluwatar.factorykit.WeaponType; +import org.junit.Before; +import org.junit.Test; +/** + * Test Factory Kit Pattern + */ public class FactoryKitTest { private WeaponFactory factory; diff --git a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/propertiesversion/PropertiesFeatureToggleVersionTest.java b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/propertiesversion/PropertiesFeatureToggleVersionTest.java index def53b97c..846b46bcf 100644 --- a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/propertiesversion/PropertiesFeatureToggleVersionTest.java +++ b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/propertiesversion/PropertiesFeatureToggleVersionTest.java @@ -23,16 +23,18 @@ package com.iluwatar.featuretoggle.pattern.propertiesversion; -import com.iluwatar.featuretoggle.pattern.Service; -import com.iluwatar.featuretoggle.user.User; -import org.junit.Test; - -import java.util.Properties; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import com.iluwatar.featuretoggle.pattern.Service; +import com.iluwatar.featuretoggle.user.User; +import java.util.Properties; +import org.junit.Test; + +/** + * Test Properties Toggle + */ public class PropertiesFeatureToggleVersionTest { @Test(expected = IllegalArgumentException.class) @@ -66,4 +68,4 @@ public class PropertiesFeatureToggleVersionTest { final String welcomeMessage = service.getWelcomeMessage(new User("Jamie No Code")); assertEquals("Welcome to the application.", welcomeMessage); } -} \ No newline at end of file +} diff --git a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersionTest.java b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersionTest.java index 6c33b260c..3966032d5 100644 --- a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersionTest.java +++ b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersionTest.java @@ -22,15 +22,18 @@ */ package com.iluwatar.featuretoggle.pattern.tieredversion; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import com.iluwatar.featuretoggle.pattern.Service; import com.iluwatar.featuretoggle.user.User; import com.iluwatar.featuretoggle.user.UserGroup; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - +/** + * Test Tiered Feature Toggle + */ public class TieredFeatureToggleVersionTest { final User paidUser = new User("Jamie Coder"); @@ -61,4 +64,4 @@ public class TieredFeatureToggleVersionTest { public void testIsEnhancedAlwaysTrueAsTiered() throws Exception { assertTrue(service.isEnhanced()); } -} \ No newline at end of file +} diff --git a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/user/UserGroupTest.java b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/user/UserGroupTest.java index c6ff30855..b2c6e5859 100644 --- a/feature-toggle/src/test/java/com/iluwatar/featuretoggle/user/UserGroupTest.java +++ b/feature-toggle/src/test/java/com/iluwatar/featuretoggle/user/UserGroupTest.java @@ -22,11 +22,14 @@ */ package com.iluwatar.featuretoggle.user; -import org.junit.Test; - import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertTrue; +import org.junit.Test; + +/** + * Test User Group specific feature + */ public class UserGroupTest { @Test @@ -56,4 +59,4 @@ public class UserGroupTest { UserGroup.addUserToPaidGroup(user); UserGroup.addUserToFreeGroup(user); } -} \ No newline at end of file +} diff --git a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java index 54d367c20..389904bff 100644 --- a/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java +++ b/fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/lazy/DecoratingIterator.java @@ -27,6 +27,7 @@ import java.util.Iterator; /** * This class is used to realize LazyFluentIterables. It decorates a given iterator. Does not * support consecutive hasNext() calls. + * @param Iterable Collection of Elements of Type E */ public abstract class DecoratingIterator implements Iterator { @@ -43,7 +44,7 @@ public abstract class DecoratingIterator implements Iterator { /** * Precomputes and saves the next element of the Iterable. null is considered as end of data. - * + * * @return true if a next element is available */ @Override @@ -54,7 +55,7 @@ public abstract class DecoratingIterator implements Iterator { /** * Returns the next element of the Iterable. - * + * * @return the next element of the Iterable, or null if not present. */ @Override @@ -71,7 +72,7 @@ public abstract class DecoratingIterator implements Iterator { /** * Computes the next object of the Iterable. Can be implemented to realize custom behaviour for an * iteration process. null is considered as end of data. - * + * * @return the next element of the Iterable. */ public abstract E computeNext(); diff --git a/fluentinterface/src/test/java/com/iluwatar/fluentinterface/app/AppTest.java b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/app/AppTest.java index 6d6420d55..11740bf1a 100644 --- a/fluentinterface/src/test/java/com/iluwatar/fluentinterface/app/AppTest.java +++ b/fluentinterface/src/test/java/com/iluwatar/fluentinterface/app/AppTest.java @@ -23,7 +23,9 @@ package com.iluwatar.fluentinterface.app; import org.junit.Test; - +/** + * Application Test Entry + */ public class AppTest { @Test diff --git a/front-controller/src/test/java/com/iluwatar/front/controller/utils/InMemoryAppender.java b/front-controller/src/test/java/com/iluwatar/front/controller/utils/InMemoryAppender.java index 62a234d0d..2e6f26c0c 100644 --- a/front-controller/src/test/java/com/iluwatar/front/controller/utils/InMemoryAppender.java +++ b/front-controller/src/test/java/com/iluwatar/front/controller/utils/InMemoryAppender.java @@ -30,6 +30,9 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/guarded-suspension/src/main/java/com/iluwatar/guarded/suspension/GuardedQueue.java b/guarded-suspension/src/main/java/com/iluwatar/guarded/suspension/GuardedQueue.java index 89b330bfb..bf6142dd9 100644 --- a/guarded-suspension/src/main/java/com/iluwatar/guarded/suspension/GuardedQueue.java +++ b/guarded-suspension/src/main/java/com/iluwatar/guarded/suspension/GuardedQueue.java @@ -28,7 +28,12 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.Queue; - +/** + * Guarded Queue is an implementation for Guarded Suspension Pattern + * Guarded suspension pattern is used to handle a situation when you want to execute a method + * on an object which is not in a proper state. + * @see http://java-design-patterns.com/patterns/guarded-suspension/ + */ public class GuardedQueue { private static final Logger LOGGER = LoggerFactory.getLogger(GuardedQueue.class); private final Queue sourceList; diff --git a/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java b/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java index 41eaccd49..5a741d399 100644 --- a/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java +++ b/guarded-suspension/src/test/java/com/iluwatar/guarded/suspension/GuardedQueueTest.java @@ -29,6 +29,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +/** + * Test for Guarded Queue + */ public class GuardedQueueTest { private volatile Integer value; @@ -55,4 +58,4 @@ public class GuardedQueueTest { } -} \ No newline at end of file +} diff --git a/hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java b/hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java index babbd6d03..a5b455354 100644 --- a/hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java +++ b/hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java @@ -23,12 +23,15 @@ package com.iluwatar.hexagonal.domain; /** - * + * * Represents lottery ticket check result. * */ public class LotteryTicketCheckResult { + /** + * Enumeration of Type of Outcomes of a Lottery + */ public enum CheckResult { WIN_PRIZE, NO_PRIZE, TICKET_NOT_SUBMITTED } private final CheckResult checkResult; @@ -41,7 +44,7 @@ public class LotteryTicketCheckResult { checkResult = result; prizeAmount = 0; } - + /** * Constructor. */ @@ -56,7 +59,7 @@ public class LotteryTicketCheckResult { public CheckResult getResult() { return checkResult; } - + /** * @return prize amount */ diff --git a/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTicketTest.java b/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTicketTest.java index 8aaa83681..a83f9033c 100644 --- a/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTicketTest.java +++ b/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTicketTest.java @@ -30,6 +30,9 @@ import java.util.HashSet; import org.junit.Test; +/** + * Test Lottery Tickets for equality + */ public class LotteryTicketTest { @Test diff --git a/interpreter/src/test/java/com/iluwatar/interpreter/ExpressionTest.java b/interpreter/src/test/java/com/iluwatar/interpreter/ExpressionTest.java index 95a65e82c..2d444373c 100644 --- a/interpreter/src/test/java/com/iluwatar/interpreter/ExpressionTest.java +++ b/interpreter/src/test/java/com/iluwatar/interpreter/ExpressionTest.java @@ -22,18 +22,19 @@ */ package com.iluwatar.interpreter; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.List; import java.util.function.BiFunction; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import org.junit.Test; /** * Date: 12/14/15 - 11:48 AM * + * Test Case for Expressions + * @param Type of Expression * @author Jeroen Meulemeester */ public abstract class ExpressionTest { diff --git a/model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantViewTest.java b/model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantViewTest.java index ba72fea1a..ec0aabd15 100644 --- a/model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantViewTest.java +++ b/model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantViewTest.java @@ -22,20 +22,19 @@ */ package com.iluwatar.model.view.controller; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; + import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; +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; -import static org.mockito.Mockito.mock; - /** * Date: 12/20/15 - 2:04 PM * @@ -70,6 +69,9 @@ public class GiantViewTest { assertEquals(1, appender.getLogSize()); } + /** + * Logging Appender Implementation + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/monad/src/main/java/com/iluwatar/monad/Sex.java b/monad/src/main/java/com/iluwatar/monad/Sex.java index 3cbe22971..6c6d6eff6 100644 --- a/monad/src/main/java/com/iluwatar/monad/Sex.java +++ b/monad/src/main/java/com/iluwatar/monad/Sex.java @@ -22,6 +22,9 @@ */ package com.iluwatar.monad; +/** + * Enumeration of Types of Sex + */ public enum Sex { MALE, FEMALE } diff --git a/monad/src/main/java/com/iluwatar/monad/User.java b/monad/src/main/java/com/iluwatar/monad/User.java index 53cf759cf..406407fea 100644 --- a/monad/src/main/java/com/iluwatar/monad/User.java +++ b/monad/src/main/java/com/iluwatar/monad/User.java @@ -22,6 +22,9 @@ */ package com.iluwatar.monad; +/** + * User Definition + */ public class User { private String name; diff --git a/monad/src/test/java/com/iluwatar/monad/AppTest.java b/monad/src/test/java/com/iluwatar/monad/AppTest.java index f661ee1c6..69464ff87 100644 --- a/monad/src/test/java/com/iluwatar/monad/AppTest.java +++ b/monad/src/test/java/com/iluwatar/monad/AppTest.java @@ -24,6 +24,9 @@ package com.iluwatar.monad; import org.junit.Test; +/** + * Application Test + */ public class AppTest { @Test diff --git a/monad/src/test/java/com/iluwatar/monad/MonadTest.java b/monad/src/test/java/com/iluwatar/monad/MonadTest.java index 2676e6e80..a34243978 100644 --- a/monad/src/test/java/com/iluwatar/monad/MonadTest.java +++ b/monad/src/test/java/com/iluwatar/monad/MonadTest.java @@ -30,6 +30,9 @@ import org.junit.rules.ExpectedException; import java.util.Objects; +/** + * Test for Monad Pattern + */ public class MonadTest { @Rule diff --git a/monostate/src/test/java/com/iluwatar/monostate/AppTest.java b/monostate/src/test/java/com/iluwatar/monostate/AppTest.java index 301beea3e..3e88b3bf2 100644 --- a/monostate/src/test/java/com/iluwatar/monostate/AppTest.java +++ b/monostate/src/test/java/com/iluwatar/monostate/AppTest.java @@ -24,6 +24,9 @@ package com.iluwatar.monostate; import org.junit.Test; +/** + * Application Test Entry + */ public class AppTest { @Test diff --git a/mute-idiom/src/test/java/com/iluwatar/mute/MuteTest.java b/mute-idiom/src/test/java/com/iluwatar/mute/MuteTest.java index 698395cc2..7e1d2e1af 100644 --- a/mute-idiom/src/test/java/com/iluwatar/mute/MuteTest.java +++ b/mute-idiom/src/test/java/com/iluwatar/mute/MuteTest.java @@ -35,47 +35,50 @@ import org.junit.rules.ExpectedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Test for the mute-idiom pattern + */ public class MuteTest { private static final Logger LOGGER = LoggerFactory.getLogger(MuteTest.class); private static final String MESSAGE = "should not occur"; - + @Rule public ExpectedException exception = ExpectedException.none(); - + @Test public void muteShouldRunTheCheckedRunnableAndNotThrowAnyExceptionIfCheckedRunnableDoesNotThrowAnyException() { Mute.mute(() -> methodNotThrowingAnyException()); } - + @Test public void muteShouldRethrowUnexpectedExceptionAsAssertionError() throws Exception { exception.expect(AssertionError.class); exception.expectMessage(MESSAGE); - + Mute.mute(() -> methodThrowingException()); } - + @Test public void loggedMuteShouldRunTheCheckedRunnableAndNotThrowAnyExceptionIfCheckedRunnableDoesNotThrowAnyException() { Mute.loggedMute(() -> methodNotThrowingAnyException()); } - + @Test public void loggedMuteShouldLogExceptionTraceBeforeSwallowingIt() throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); System.setErr(new PrintStream(stream)); - + Mute.loggedMute(() -> methodThrowingException()); - + assertTrue(new String(stream.toByteArray()).contains(MESSAGE)); } - - + + private void methodNotThrowingAnyException() { LOGGER.info("Executed successfully"); } - + private void methodThrowingException() throws Exception { throw new Exception(MESSAGE); } diff --git a/mutex/src/test/java/com/iluwatar/mutex/AppTest.java b/mutex/src/test/java/com/iluwatar/mutex/AppTest.java index dfc0de124..f224a56f5 100644 --- a/mutex/src/test/java/com/iluwatar/mutex/AppTest.java +++ b/mutex/src/test/java/com/iluwatar/mutex/AppTest.java @@ -25,10 +25,13 @@ package com.iluwatar.mutex; import org.junit.Test; import java.io.IOException; +/** + * Application Test Entrypoint + */ public class AppTest{ @Test public void test() throws IOException { String[] args = {}; App.main(args); } -} \ No newline at end of file +} diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java index 162cd3bb4..30469ba8e 100644 --- a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java +++ b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -21,6 +21,10 @@ import org.apache.isis.applib.annotation.HomePage; import org.apache.isis.applib.annotation.NatureOfService; import org.apache.isis.applib.annotation.SemanticsOf; +/** + * HomePage Domain Service + * @see HomePageViewModel linked view to HomePage + */ @DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY) public class HomePageService { diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java index f367a39fd..dfb499f0f 100644 --- a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java +++ b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -21,6 +21,11 @@ import org.apache.isis.applib.annotation.ViewModel; import domainapp.dom.modules.simple.SimpleObject; import domainapp.dom.modules.simple.SimpleObjects; +/** + * Model linked to the HomePage + * The underlying layout is specified by json + * @see HomePageService - Service Linked to the HomePage + */ @ViewModel public class HomePageViewModel { diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java index bbbd54b00..c7972ab84 100644 --- a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java +++ b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -33,6 +33,9 @@ import org.apache.isis.applib.services.eventbus.ActionDomainEvent; import org.apache.isis.applib.services.i18n.TranslatableString; import org.apache.isis.applib.util.ObjectContracts; +/** + * Definition of a Simple Object + */ @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "simple", table = "SimpleObject") @javax.jdo.annotations.DatastoreIdentity( @@ -53,7 +56,7 @@ public class SimpleObject implements Comparable { // region > name (property) private String name; - + // region > identificatiom public TranslatableString title() { return TranslatableString.tr("Object: {name}", "name", getName()); @@ -74,6 +77,9 @@ public class SimpleObject implements Comparable { // region > updateName (action) + /** + * Event used to update the Name in the Domain + */ public static class UpdateNameDomainEvent extends ActionDomainEvent { public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) { diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java index 5ebad0159..249fbb1f0 100644 --- a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java +++ b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -30,6 +30,9 @@ import org.apache.isis.applib.query.QueryDefault; import org.apache.isis.applib.services.eventbus.ActionDomainEvent; import org.apache.isis.applib.services.i18n.TranslatableString; +/** + * Domain Service for Simple Objects + */ @DomainService(repositoryFor = SimpleObject.class) @DomainServiceLayout(menuOrder = "10") public class SimpleObjects { @@ -69,6 +72,9 @@ public class SimpleObjects { // endregion + /** + * Create Domain Event on SimpleObjects + */ // region > create (action) public static class CreateDomainEvent extends ActionDomainEvent { public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, diff --git a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java index fc62239c2..d80d0786a 100644 --- a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java +++ b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java @@ -14,11 +14,14 @@ */ package domainapp.dom.modules.simple; +import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Before; import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; - +/** + * Test for SimpleObject + */ public class SimpleObjectTest { SimpleObject simpleObject; @@ -28,6 +31,9 @@ public class SimpleObjectTest { simpleObject = new SimpleObject(); } + /** + * Test for Names for SimpleObjects + */ public static class Name extends SimpleObjectTest { @Test diff --git a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java index 47cad61b8..91fe3d715 100644 --- a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java +++ b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java @@ -14,10 +14,13 @@ */ package domainapp.dom.modules.simple; -import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.Lists; - +import java.util.List; +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2; +import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode; import org.jmock.Expectations; import org.jmock.Sequence; import org.jmock.auto.Mock; @@ -25,12 +28,9 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.apache.isis.applib.DomainObjectContainer; -import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2; -import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode; - -import static org.assertj.core.api.Assertions.assertThat; - +/** + * Test for SimpleObjects + */ public class SimpleObjectsTest { @Rule @@ -47,6 +47,9 @@ public class SimpleObjectsTest { simpleObjects.container = mockContainer; } + /** + * Test Creation of Simple Objects + */ public static class Create extends SimpleObjectsTest { @Test @@ -77,6 +80,9 @@ public class SimpleObjectsTest { } + /** + * Test Listing of Simple Objects + */ public static class ListAll extends SimpleObjectsTest { @Test diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java index f0617fea2..58b656a98 100644 --- a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -20,6 +20,9 @@ import org.apache.isis.applib.fixturescripts.FixtureScript; import domainapp.dom.modules.simple.SimpleObject; import domainapp.dom.modules.simple.SimpleObjects; +/** + * Fixture to create a simple object + */ public class SimpleObjectCreate extends FixtureScript { // endregion @@ -45,7 +48,7 @@ public class SimpleObjectCreate extends FixtureScript { this.name = name; return this; } - + /** * The created simple object (output). */ @@ -65,5 +68,5 @@ public class SimpleObjectCreate extends FixtureScript { // also make available to UI ec.addResult(this, simpleObject); } - + } diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java index 7000bf4c0..c0319d953 100644 --- a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -18,6 +18,9 @@ package domainapp.fixture.modules.simple; import org.apache.isis.applib.fixturescripts.FixtureScript; import org.apache.isis.applib.services.jdosupport.IsisJdoSupport; +/** + * TearDown/Cleanup for SimpleObjects + */ public class SimpleObjectsTearDown extends FixtureScript { @javax.inject.Inject @@ -27,5 +30,5 @@ public class SimpleObjectsTearDown extends FixtureScript { protected void execute(ExecutionContext executionContext) { isisJdoSupport.executeUpdate("delete from \"simple\".\"SimpleObject\""); } - + } diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java b/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java index 62ad0405a..be891158a 100644 --- a/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -27,6 +27,10 @@ import domainapp.dom.modules.simple.SimpleObject; import domainapp.fixture.modules.simple.SimpleObjectCreate; import domainapp.fixture.modules.simple.SimpleObjectsTearDown; + +/** + * Create a bunch of simple Objects + */ public class RecreateSimpleObjects extends FixtureScript { public final List names = Collections.unmodifiableList(Arrays.asList("Foo", "Bar", "Baz", @@ -43,7 +47,7 @@ public class RecreateSimpleObjects extends FixtureScript { public RecreateSimpleObjects() { withDiscoverability(Discoverability.DISCOVERABLE); } - + /** * The number of objects to create, up to 10; optional, defaults to 3. */ @@ -55,7 +59,7 @@ public class RecreateSimpleObjects extends FixtureScript { this.number = number; return this; } - + /** * The simpleobjects created by this fixture (output). */ diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java index b7c76d0ed..3ac5a1d75 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java @@ -4,9 +4,9 @@ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -19,6 +19,9 @@ import org.apache.isis.core.integtestsupport.IsisSystemForTest; import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller; import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests; +/** + * Initializer for the Simple App + */ public final class SimpleAppSystemInitializer { private SimpleAppSystemInitializer() { diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java index 190e1f5bb..e41399fdd 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java @@ -21,6 +21,9 @@ import cucumber.api.java.After; import cucumber.api.java.Before; import domainapp.integtests.bootstrap.SimpleAppSystemInitializer; +/** + * BootStrapping IntegrationTesting Before and After Steps + */ public class BootstrappingGlue extends CukeGlueAbstract { @Before(value = {"@integration"}, order = 100) diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java index 2fcb7cca7..7a75a0381 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java @@ -19,6 +19,9 @@ import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; import cucumber.api.java.Before; import domainapp.fixture.scenarios.RecreateSimpleObjects; +/** + * Test Execution to append a fixture of SimpleObjects + */ public class CatalogOfFixturesGlue extends CukeGlueAbstract { @Before(value = {"@integration", "@SimpleObjectsFixture"}, order = 20000) diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java index 2ea375b4a..b7af9f052 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java @@ -14,18 +14,20 @@ */ package domainapp.integtests.specglue.modules.simple; -import java.util.List; -import java.util.UUID; - -import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import cucumber.api.java.en.Given; import cucumber.api.java.en.When; import domainapp.dom.modules.simple.SimpleObject; import domainapp.dom.modules.simple.SimpleObjects; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import java.util.List; +import java.util.UUID; +import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; +/** + * Test Simple Object Operations + */ public class SimpleObjectGlue extends CukeGlueAbstract { @Given("^there are.* (\\d+) simple objects$") diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java index 7a7ad91b2..66deaeb84 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java @@ -25,6 +25,9 @@ import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForInteg import domainapp.integtests.bootstrap.SimpleAppSystemInitializer; +/** + * SimpleApp Integration Tests will implement this Abstract Class. + */ public abstract class SimpleAppIntegTest extends IntegrationTestAbstract { @BeforeClass @@ -35,5 +38,4 @@ public abstract class SimpleAppIntegTest extends IntegrationTestAbstract { // instantiating will install onto ThreadLocal new ScenarioExecutionForIntegration(); } - } diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java index 872aff7a3..f2cbb1723 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java @@ -18,21 +18,22 @@ */ package domainapp.integtests.tests.modules.simple; -import javax.inject.Inject; - -import org.junit.Before; -import org.junit.Test; - -import org.apache.isis.applib.DomainObjectContainer; -import org.apache.isis.applib.fixturescripts.FixtureScripts; -import org.apache.isis.applib.services.wrapper.DisabledException; -import org.apache.isis.applib.services.wrapper.InvalidException; +import static org.assertj.core.api.Assertions.assertThat; import domainapp.dom.modules.simple.SimpleObject; import domainapp.fixture.scenarios.RecreateSimpleObjects; import domainapp.integtests.tests.SimpleAppIntegTest; -import static org.assertj.core.api.Assertions.assertThat; +import javax.inject.Inject; +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.applib.fixturescripts.FixtureScripts; +import org.apache.isis.applib.services.wrapper.DisabledException; +import org.apache.isis.applib.services.wrapper.InvalidException; +import org.junit.Before; +import org.junit.Test; +/** + * Test Fixtures with Simple Objects + */ public class SimpleObjectIntegTest extends SimpleAppIntegTest { @Inject @@ -54,6 +55,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest { simpleObjectWrapped = wrap(simpleObjectPojo); } + /** + * Test Object Name accessibility + */ public static class Name extends SimpleObjectIntegTest { @Test @@ -75,6 +79,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest { } } + /** + * Test Validation of SimpleObject Names + */ public static class UpdateName extends SimpleObjectIntegTest { @Test @@ -99,6 +106,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest { } } + /** + * Test ContainerTitle generation based on SimpleObject Name + */ public static class Title extends SimpleObjectIntegTest { @Inject @@ -117,4 +127,4 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest { assertThat(title).isEqualTo("Object: " + name); } } -} \ No newline at end of file +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java index 332213542..d57454dc1 100644 --- a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java @@ -18,28 +18,27 @@ */ package domainapp.integtests.tests.modules.simple; -import java.sql.SQLIntegrityConstraintViolationException; -import java.util.List; - -import javax.inject.Inject; +import static org.assertj.core.api.Assertions.assertThat; import com.google.common.base.Throwables; - -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; -import org.junit.Test; - -import org.apache.isis.applib.fixturescripts.FixtureScript; -import org.apache.isis.applib.fixturescripts.FixtureScripts; - import domainapp.dom.modules.simple.SimpleObject; import domainapp.dom.modules.simple.SimpleObjects; import domainapp.fixture.modules.simple.SimpleObjectsTearDown; import domainapp.fixture.scenarios.RecreateSimpleObjects; import domainapp.integtests.tests.SimpleAppIntegTest; -import static org.assertj.core.api.Assertions.assertThat; +import java.sql.SQLIntegrityConstraintViolationException; +import java.util.List; +import javax.inject.Inject; +import org.apache.isis.applib.fixturescripts.FixtureScript; +import org.apache.isis.applib.fixturescripts.FixtureScripts; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; +import org.junit.Test; +/** + * Fixture Pattern Integration Test + */ public class SimpleObjectsIntegTest extends SimpleAppIntegTest { @Inject @@ -47,6 +46,9 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest { @Inject SimpleObjects simpleObjects; + /** + * Test Listing of All Simple Objects + */ public static class ListAll extends SimpleObjectsIntegTest { @Test @@ -83,6 +85,10 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest { } } + + /** + * Test Creation of Simple Objects + */ public static class Create extends SimpleObjectsIntegTest { @Test @@ -140,4 +146,4 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest { } } -} \ No newline at end of file +} diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/King.java b/object-mother/src/main/java/com/iluwatar/objectmother/King.java index 544b0bacb..b1b5f3610 100644 --- a/object-mother/src/main/java/com/iluwatar/objectmother/King.java +++ b/object-mother/src/main/java/com/iluwatar/objectmother/King.java @@ -22,6 +22,9 @@ */ package com.iluwatar.objectmother; +/** + * Defines all attributes and behaviour related to the King + */ public class King implements Royalty { boolean isDrunk = false; boolean isHappy = false; @@ -45,11 +48,11 @@ public class King implements Royalty { public void makeUnhappy() { isHappy = false; } - + public boolean isHappy() { return isHappy; } - + /** * Method to flirt to a queen. * @param queen Queen which should be flirted. @@ -61,6 +64,6 @@ public class King implements Royalty { } else { this.makeHappy(); } - + } } diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java b/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java index 3e18fbf3a..e7e488602 100644 --- a/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java +++ b/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java @@ -22,6 +22,9 @@ */ package com.iluwatar.objectmother; +/** + * Defines all attributes and behaviour related to the Queen + */ public class Queen implements Royalty { private boolean isDrunk = false; private boolean isHappy = false; @@ -46,7 +49,7 @@ public class Queen implements Royalty { public void makeUnhappy() { isHappy = false; } - + public boolean isFlirty() { return isFlirty; } @@ -54,7 +57,7 @@ public class Queen implements Royalty { public void setFlirtiness(boolean flirtiness) { this.isFlirty = flirtiness; } - + /** * Method which is called when the king is flirting to a queen. * @param king King who initialized the flirt. diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java b/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java index 2bebc0939..42271a21d 100644 --- a/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java +++ b/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java @@ -22,12 +22,15 @@ */ package com.iluwatar.objectmother; +/** + * Interface contracting Royalty Behaviour + */ public interface Royalty { void makeDrunk(); - + void makeSober(); - + void makeHappy(); - + void makeUnhappy(); } diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java b/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java index 624a29132..118253d56 100644 --- a/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java +++ b/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java @@ -22,8 +22,11 @@ */ package com.iluwatar.objectmother; +/** + * Object Mother Pattern generating Royalty Types + */ public final class RoyaltyObjectMother { - + /** * Method to create a sober and unhappy king. The standard paramters are set. * @return An instance of {@link com.iluwatar.objectmother.King} with the standard properties. @@ -31,7 +34,7 @@ public final class RoyaltyObjectMother { public static King createSoberUnhappyKing() { return new King(); } - + /** * Method of the object mother to create a drunk king. * @return A drunk {@link com.iluwatar.objectmother.King}. @@ -41,7 +44,7 @@ public final class RoyaltyObjectMother { king.makeDrunk(); return king; } - + /** * Method to create a happy king. * @return A happy {@link com.iluwatar.objectmother.King}. @@ -51,7 +54,7 @@ public final class RoyaltyObjectMother { king.makeHappy(); return king; } - + /** * Method to create a happy and drunk king. * @return A drunk and happy {@link com.iluwatar.objectmother.King}. @@ -62,7 +65,7 @@ public final class RoyaltyObjectMother { king.makeDrunk(); return king; } - + /** * Method to create a flirty queen. * @return A flirty {@link com.iluwatar.objectmother.Queen}. @@ -72,7 +75,7 @@ public final class RoyaltyObjectMother { queen.setFlirtiness(true); return queen; } - + /** * Method to create a not flirty queen. * @return A not flirty {@link com.iluwatar.objectmother.Queen}. diff --git a/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java b/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java index ebe536d24..cc5af45aa 100644 --- a/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java +++ b/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java @@ -33,8 +33,11 @@ import com.iluwatar.objectmother.Queen; import com.iluwatar.objectmother.Royalty; import com.iluwatar.objectmother.RoyaltyObjectMother; +/** + * Test Generation of Royalty Types using the object-mother + */ public class RoyaltyObjectMotherTest { - + @Test public void unsuccessfulKingFlirt() { King soberUnhappyKing = RoyaltyObjectMother.createSoberUnhappyKing(); @@ -42,7 +45,7 @@ public class RoyaltyObjectMotherTest { soberUnhappyKing.flirt(flirtyQueen); assertFalse(soberUnhappyKing.isHappy()); } - + @Test public void queenIsBlockingFlirtCauseDrunkKing() { King drunkUnhappyKing = RoyaltyObjectMother.createDrunkKing(); @@ -50,7 +53,7 @@ public class RoyaltyObjectMotherTest { drunkUnhappyKing.flirt(notFlirtyQueen); assertFalse(drunkUnhappyKing.isHappy()); } - + @Test public void queenIsBlockingFlirt() { King soberHappyKing = RoyaltyObjectMother.createHappyKing(); @@ -58,7 +61,7 @@ public class RoyaltyObjectMotherTest { soberHappyKing.flirt(notFlirtyQueen); assertFalse(soberHappyKing.isHappy()); } - + @Test public void successfullKingFlirt() { King soberHappyKing = RoyaltyObjectMother.createHappyKing(); @@ -66,7 +69,7 @@ public class RoyaltyObjectMotherTest { soberHappyKing.flirt(flirtyQueen); assertTrue(soberHappyKing.isHappy()); } - + @Test public void testQueenType() { Royalty flirtyQueen = RoyaltyObjectMother.createFlirtyQueen(); @@ -74,7 +77,7 @@ public class RoyaltyObjectMotherTest { assertEquals(flirtyQueen.getClass(), Queen.class); assertEquals(notFlirtyQueen.getClass(), Queen.class); } - + @Test public void testKingType() { Royalty drunkKing = RoyaltyObjectMother.createDrunkKing(); diff --git a/object-pool/src/main/java/com/iluwatar/object/pool/ObjectPool.java b/object-pool/src/main/java/com/iluwatar/object/pool/ObjectPool.java index 510d9dc88..f502b86e2 100644 --- a/object-pool/src/main/java/com/iluwatar/object/pool/ObjectPool.java +++ b/object-pool/src/main/java/com/iluwatar/object/pool/ObjectPool.java @@ -26,8 +26,8 @@ import java.util.HashSet; import java.util.Set; /** - * * Generic object pool + * @param Type T of Object in the Pool */ public abstract class ObjectPool { diff --git a/observer/src/main/java/com/iluwatar/observer/generic/Observer.java b/observer/src/main/java/com/iluwatar/observer/generic/Observer.java index b427aae2c..f8c30853b 100644 --- a/observer/src/main/java/com/iluwatar/observer/generic/Observer.java +++ b/observer/src/main/java/com/iluwatar/observer/generic/Observer.java @@ -23,8 +23,10 @@ package com.iluwatar.observer.generic; /** - * * Observer + * @param Observable + * @param Observer + * @param Action */ public interface Observer, O extends Observer, A> { diff --git a/observer/src/test/java/com/iluwatar/observer/WeatherObserverTest.java b/observer/src/test/java/com/iluwatar/observer/WeatherObserverTest.java index 7120a31e0..70a7922c5 100644 --- a/observer/src/test/java/com/iluwatar/observer/WeatherObserverTest.java +++ b/observer/src/test/java/com/iluwatar/observer/WeatherObserverTest.java @@ -22,18 +22,18 @@ */ package com.iluwatar.observer; +import static org.junit.Assert.assertEquals; + import com.iluwatar.observer.utils.InMemoryAppender; +import java.util.function.Supplier; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.function.Supplier; - -import static org.junit.Assert.assertEquals; - /** * Date: 12/27/15 - 11:44 AM - * + * Weather Observer Tests + * @param Type of WeatherObserver * @author Jeroen Meulemeester */ public abstract class WeatherObserverTest { diff --git a/observer/src/test/java/com/iluwatar/observer/generic/ObserverTest.java b/observer/src/test/java/com/iluwatar/observer/generic/ObserverTest.java index eef89da62..930f7533f 100644 --- a/observer/src/test/java/com/iluwatar/observer/generic/ObserverTest.java +++ b/observer/src/test/java/com/iluwatar/observer/generic/ObserverTest.java @@ -22,19 +22,19 @@ */ package com.iluwatar.observer.generic; +import static org.junit.Assert.assertEquals; + import com.iluwatar.observer.WeatherType; import com.iluwatar.observer.utils.InMemoryAppender; +import java.util.function.Supplier; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.function.Supplier; - -import static org.junit.Assert.assertEquals; - /** * Date: 12/27/15 - 11:44 AM - * + * Test for Observers + * @param Type of Observer * @author Jeroen Meulemeester */ public abstract class ObserverTest { diff --git a/observer/src/test/java/com/iluwatar/observer/utils/InMemoryAppender.java b/observer/src/test/java/com/iluwatar/observer/utils/InMemoryAppender.java index b0503a4a1..07d5726d0 100644 --- a/observer/src/test/java/com/iluwatar/observer/utils/InMemoryAppender.java +++ b/observer/src/test/java/com/iluwatar/observer/utils/InMemoryAppender.java @@ -30,6 +30,9 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/page-object/src/test/java/com/iluwatar/pageobject/AlbumListPageTest.java b/page-object/src/test/java/com/iluwatar/pageobject/AlbumListPageTest.java index f41a79760..79101f3d3 100644 --- a/page-object/src/test/java/com/iluwatar/pageobject/AlbumListPageTest.java +++ b/page-object/src/test/java/com/iluwatar/pageobject/AlbumListPageTest.java @@ -23,15 +23,17 @@ package com.iluwatar.pageobject; +import static org.junit.Assert.assertTrue; + import com.gargoylesoftware.htmlunit.WebClient; import com.iluwatar.pageobject.pages.AlbumListPage; import com.iluwatar.pageobject.pages.AlbumPage; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertTrue; - - +/** + * Test Album Selection and Album Listing + */ public class AlbumListPageTest { private AlbumListPage albumListPage = new AlbumListPage(new WebClient()); diff --git a/page-object/src/test/java/com/iluwatar/pageobject/AlbumPageTest.java b/page-object/src/test/java/com/iluwatar/pageobject/AlbumPageTest.java index 248a0ddf8..cb07a8293 100644 --- a/page-object/src/test/java/com/iluwatar/pageobject/AlbumPageTest.java +++ b/page-object/src/test/java/com/iluwatar/pageobject/AlbumPageTest.java @@ -22,14 +22,17 @@ */ package com.iluwatar.pageobject; +import static org.junit.Assert.assertTrue; + import com.gargoylesoftware.htmlunit.WebClient; import com.iluwatar.pageobject.pages.AlbumListPage; import com.iluwatar.pageobject.pages.AlbumPage; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertTrue; - +/** + * Test Album Page Operations + */ public class AlbumPageTest { private AlbumPage albumPage = new AlbumPage(new WebClient()); diff --git a/page-object/src/test/java/com/iluwatar/pageobject/LoginPageTest.java b/page-object/src/test/java/com/iluwatar/pageobject/LoginPageTest.java index a0483ae40..ad10a1927 100644 --- a/page-object/src/test/java/com/iluwatar/pageobject/LoginPageTest.java +++ b/page-object/src/test/java/com/iluwatar/pageobject/LoginPageTest.java @@ -22,14 +22,17 @@ */ package com.iluwatar.pageobject; +import static org.junit.Assert.assertTrue; + import com.gargoylesoftware.htmlunit.WebClient; import com.iluwatar.pageobject.pages.AlbumListPage; import com.iluwatar.pageobject.pages.LoginPage; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertTrue; - +/** + * Test Login Page Object + */ public class LoginPageTest { private LoginPage loginPage = new LoginPage(new WebClient()); diff --git a/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java b/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java index cb89f5f5f..cd2d2da6a 100644 --- a/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java +++ b/poison-pill/src/main/java/com/iluwatar/poison/pill/Message.java @@ -63,6 +63,9 @@ public interface Message { }; + /** + * Enumeration of Type of Headers + */ public enum Headers { DATE, SENDER } diff --git a/private-class-data/src/test/java/com/iluwatar/privateclassdata/utils/InMemoryAppender.java b/private-class-data/src/test/java/com/iluwatar/privateclassdata/utils/InMemoryAppender.java index 37a5458b5..bea71ab15 100644 --- a/private-class-data/src/test/java/com/iluwatar/privateclassdata/utils/InMemoryAppender.java +++ b/private-class-data/src/test/java/com/iluwatar/privateclassdata/utils/InMemoryAppender.java @@ -30,6 +30,9 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/promise/src/main/java/com/iluwatar/promise/Utility.java b/promise/src/main/java/com/iluwatar/promise/Utility.java index 525cda338..41e07be45 100644 --- a/promise/src/main/java/com/iluwatar/promise/Utility.java +++ b/promise/src/main/java/com/iluwatar/promise/Utility.java @@ -39,6 +39,9 @@ import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; +/** + * Utility to perform various operations + */ public class Utility { private static final Logger LOGGER = LoggerFactory.getLogger(Utility.class); diff --git a/property/src/main/java/com/iluwatar/property/Character.java b/property/src/main/java/com/iluwatar/property/Character.java index db5de2b64..37552fdc8 100644 --- a/property/src/main/java/com/iluwatar/property/Character.java +++ b/property/src/main/java/com/iluwatar/property/Character.java @@ -30,6 +30,9 @@ import java.util.Map; */ public class Character implements Prototype { + /** + * Enumeration of Character types + */ public enum Type { WARRIOR, MAGE, ROGUE } diff --git a/prototype/src/test/java/com/iluwatar/prototype/PrototypeTest.java b/prototype/src/test/java/com/iluwatar/prototype/PrototypeTest.java index c17d08772..add5617b1 100644 --- a/prototype/src/test/java/com/iluwatar/prototype/PrototypeTest.java +++ b/prototype/src/test/java/com/iluwatar/prototype/PrototypeTest.java @@ -22,21 +22,20 @@ */ package com.iluwatar.prototype; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import java.util.Arrays; -import java.util.Collection; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; +import java.util.Arrays; +import java.util.Collection; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + /** * Date: 12/28/15 - 8:45 PM - * + * @param

Prototype * @author Jeroen Meulemeester */ @RunWith(Parameterized.class) diff --git a/proxy/src/test/java/com/iluwatar/proxy/utils/InMemoryAppender.java b/proxy/src/test/java/com/iluwatar/proxy/utils/InMemoryAppender.java index b0c48167d..d78fdc93f 100644 --- a/proxy/src/test/java/com/iluwatar/proxy/utils/InMemoryAppender.java +++ b/proxy/src/test/java/com/iluwatar/proxy/utils/InMemoryAppender.java @@ -30,6 +30,10 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; + +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/reader-writer-lock/src/test/java/com/iluwatar/reader/writer/lock/utils/InMemoryAppender.java b/reader-writer-lock/src/test/java/com/iluwatar/reader/writer/lock/utils/InMemoryAppender.java index c22040418..30624a650 100644 --- a/reader-writer-lock/src/test/java/com/iluwatar/reader/writer/lock/utils/InMemoryAppender.java +++ b/reader-writer-lock/src/test/java/com/iluwatar/reader/writer/lock/utils/InMemoryAppender.java @@ -30,6 +30,9 @@ import org.slf4j.LoggerFactory; import java.util.LinkedList; import java.util.List; +/** + * InMemory Log Appender Util. + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/repository/src/main/java/com/iluwatar/repository/PersonSpecifications.java b/repository/src/main/java/com/iluwatar/repository/PersonSpecifications.java index 0bab0950a..3da46e2ee 100644 --- a/repository/src/main/java/com/iluwatar/repository/PersonSpecifications.java +++ b/repository/src/main/java/com/iluwatar/repository/PersonSpecifications.java @@ -34,6 +34,9 @@ import org.springframework.data.jpa.domain.Specification; */ public class PersonSpecifications { + /** + * Specifications stating the Between (From - To) Age Specification + */ public static class AgeBetweenSpec implements Specification { private int from; diff --git a/resource-acquisition-is-initialization/src/test/java/com/iluwatar/resource/acquisition/is/initialization/ClosableTest.java b/resource-acquisition-is-initialization/src/test/java/com/iluwatar/resource/acquisition/is/initialization/ClosableTest.java index 38649cd96..6786416fa 100644 --- a/resource-acquisition-is-initialization/src/test/java/com/iluwatar/resource/acquisition/is/initialization/ClosableTest.java +++ b/resource-acquisition-is-initialization/src/test/java/com/iluwatar/resource/acquisition/is/initialization/ClosableTest.java @@ -22,19 +22,18 @@ */ package com.iluwatar.resource.acquisition.is.initialization; +import static org.junit.Assert.assertTrue; + import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; +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.assertTrue; - /** * Date: 12/28/15 - 9:31 PM * @@ -64,6 +63,9 @@ public class ClosableTest { assertTrue(appender.logContains("Sliding door closes.")); } + /** + * Logging Appender Implementation + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java index fc01b8329..88255997f 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java @@ -23,36 +23,39 @@ package com.iluwatar.semaphore; /** - * Fruit is a resource stored in a FruitBowl. + * Fruit is a resource stored in a FruitBowl. */ public class Fruit { + /** + * Enumeration of Fruit Types + */ public static enum FruitType { ORANGE, APPLE, LEMON } - + private FruitType type; - + public Fruit(FruitType type) { this.type = type; } - + public FruitType getType() { return type; } - + /** * toString method - */ + */ public String toString() { switch (type) { case ORANGE: return "Orange"; - case APPLE: + case APPLE: return "Apple"; - case LEMON: + case LEMON: return "Lemon"; - default: + default: return ""; } } diff --git a/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java b/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java index 25dba2a6d..26d274262 100644 --- a/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java +++ b/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java @@ -25,10 +25,13 @@ package com.iluwatar.semaphore; import org.junit.Test; import java.io.IOException; +/** + * Application Test Entrypoint + */ public class AppTest{ @Test public void test() throws IOException { String[] args = {}; App.main(args); } -} \ No newline at end of file +} diff --git a/service-layer/src/test/java/com/iluwatar/servicelayer/common/BaseDaoTest.java b/service-layer/src/test/java/com/iluwatar/servicelayer/common/BaseDaoTest.java index 79c7a0f86..694fc746d 100644 --- a/service-layer/src/test/java/com/iluwatar/servicelayer/common/BaseDaoTest.java +++ b/service-layer/src/test/java/com/iluwatar/servicelayer/common/BaseDaoTest.java @@ -22,23 +22,23 @@ */ package com.iluwatar.servicelayer.common; -import com.iluwatar.servicelayer.hibernate.HibernateUtil; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import com.iluwatar.servicelayer.hibernate.HibernateUtil; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + /** * Date: 12/28/15 - 10:53 PM - * + * Test for Base Data Access Objects + * @param Type of Base Entity + * @param Type of Dao Base Implementation * @author Jeroen Meulemeester */ public abstract class BaseDaoTest> { @@ -142,4 +142,4 @@ public abstract class BaseDaoTest assertEquals(expectedName, entity.toString()); } -} \ No newline at end of file +} diff --git a/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java b/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java index e8040ee99..f468ad0b8 100644 --- a/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java +++ b/singleton/src/test/java/com/iluwatar/singleton/SingletonTest.java @@ -22,7 +22,8 @@ */ package com.iluwatar.singleton; -import org.junit.Test; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import java.util.ArrayList; import java.util.List; @@ -31,9 +32,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.function.Supplier; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; +import org.junit.Test; /** * This class provides several test case that test singleton construction. @@ -43,7 +42,7 @@ import static org.junit.Assert.assertSame; * the same when called in the DIFFERENT thread. * * Date: 12/29/15 - 19:25 PM - * + * @param Supplier method generating singletons * @author Jeroen Meulemeester * @author Richard Jones */ diff --git a/template-method/src/test/java/com/iluwatar/templatemethod/StealingMethodTest.java b/template-method/src/test/java/com/iluwatar/templatemethod/StealingMethodTest.java index 70cb23bfe..98ac62613 100644 --- a/template-method/src/test/java/com/iluwatar/templatemethod/StealingMethodTest.java +++ b/template-method/src/test/java/com/iluwatar/templatemethod/StealingMethodTest.java @@ -22,23 +22,22 @@ */ package com.iluwatar.templatemethod; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; +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; -import static org.junit.Assert.assertTrue; - /** * Date: 12/30/15 - 18:12 PM - * + * @param Type of StealingMethod * @author Jeroen Meulemeester */ public abstract class StealingMethodTest { diff --git a/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java b/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java index 8f061575e..b3f253056 100644 --- a/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java +++ b/thread-pool/src/test/java/com/iluwatar/threadpool/TaskTest.java @@ -22,7 +22,8 @@ */ package com.iluwatar.threadpool; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.List; @@ -34,13 +35,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.function.Function; import java.util.stream.Collectors; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import org.junit.Test; /** * Date: 12/30/15 - 18:22 PM - * + * Test for Tasks using a Thread Pool + * @param Type of Task * @author Jeroen Meulemeester */ public abstract class TaskTest { @@ -140,4 +140,4 @@ public abstract class TaskTest { } } -} \ No newline at end of file +} diff --git a/twin/src/test/java/com/iluwatar/twin/BallItemTest.java b/twin/src/test/java/com/iluwatar/twin/BallItemTest.java index 8dfe9515c..5dad02481 100644 --- a/twin/src/test/java/com/iluwatar/twin/BallItemTest.java +++ b/twin/src/test/java/com/iluwatar/twin/BallItemTest.java @@ -22,22 +22,23 @@ */ package com.iluwatar.twin; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyNoMoreInteractions; + import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; +import java.util.LinkedList; +import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.InOrder; import org.slf4j.LoggerFactory; -import java.util.LinkedList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.*; - /** * Date: 12/30/15 - 18:44 PM * @@ -103,6 +104,9 @@ public class BallItemTest { assertEquals(1, appender.getLogSize()); } + /** + * Logging Appender Implementation + */ public class InMemoryAppender extends AppenderBase { private List log = new LinkedList<>(); diff --git a/visitor/src/test/java/com/iluwatar/visitor/UnitTest.java b/visitor/src/test/java/com/iluwatar/visitor/UnitTest.java index 98f0f66dc..ab8470512 100644 --- a/visitor/src/test/java/com/iluwatar/visitor/UnitTest.java +++ b/visitor/src/test/java/com/iluwatar/visitor/UnitTest.java @@ -22,19 +22,19 @@ */ package com.iluwatar.visitor; -import org.junit.Test; - -import java.util.Arrays; -import java.util.function.Function; - import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; +import java.util.Arrays; +import java.util.function.Function; +import org.junit.Test; + /** * Date: 12/30/15 - 18:59 PM - * + * Test related to Units + * @param Type of Unit * @author Jeroen Meulemeester */ public abstract class UnitTest { @@ -79,4 +79,4 @@ public abstract class UnitTest { */ abstract void verifyVisit(final U unit, final UnitVisitor mockedVisitor); -} \ No newline at end of file +} diff --git a/visitor/src/test/java/com/iluwatar/visitor/VisitorTest.java b/visitor/src/test/java/com/iluwatar/visitor/VisitorTest.java index dbcae196f..ba6705b23 100644 --- a/visitor/src/test/java/com/iluwatar/visitor/VisitorTest.java +++ b/visitor/src/test/java/com/iluwatar/visitor/VisitorTest.java @@ -22,23 +22,23 @@ */ package com.iluwatar.visitor; +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 java.util.LinkedList; +import java.util.List; +import java.util.Optional; 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 java.util.Optional; - -import static org.junit.Assert.assertEquals; - /** * Date: 12/30/15 - 18:59 PM - * + * Test case for Visitor Pattern + * @param Type of UnitVisitor * @author Jeroen Meulemeester */ public abstract class VisitorTest {