diff --git a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java new file mode 100644 index 000000000..5eb083deb --- /dev/null +++ b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java @@ -0,0 +1,100 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.abstractfactory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +public class AbstractFactoryTest { + + private App app = new App(); + private KingdomFactory elfFactory; + private KingdomFactory orcFactory; + + @Before + public void setUp() { + elfFactory = app.getElfKingdomFactory(); + orcFactory = app.getOrcKingdomFactory(); + } + + @Test + public void king() { + final King elfKing = app.getKing(elfFactory); + assertTrue(elfKing instanceof ElfKing); + assertEquals(ElfKing.DESCRIPTION, elfKing.getDescription()); + final King orcKing = app.getKing(orcFactory); + assertTrue(orcKing instanceof OrcKing); + assertEquals(OrcKing.DESCRIPTION, orcKing.getDescription()); + } + + @Test + public void castle() { + final Castle elfCastle = app.getCastle(elfFactory); + assertTrue(elfCastle instanceof ElfCastle); + assertEquals(ElfCastle.DESCRIPTION, elfCastle.getDescription()); + final Castle orcCastle = app.getCastle(orcFactory); + assertTrue(orcCastle instanceof OrcCastle); + assertEquals(OrcCastle.DESCRIPTION, orcCastle.getDescription()); + } + + @Test + public void army() { + final Army elfArmy = app.getArmy(elfFactory); + assertTrue(elfArmy instanceof ElfArmy); + assertEquals(ElfArmy.DESCRIPTION, elfArmy.getDescription()); + final Army orcArmy = app.getArmy(orcFactory); + assertTrue(orcArmy instanceof OrcArmy); + assertEquals(OrcArmy.DESCRIPTION, orcArmy.getDescription()); + } + + @Test + public void createElfKingdom() { + app.createKingdom(elfFactory); + final King king = app.getKing(); + final Castle castle = app.getCastle(); + final Army army = app.getArmy(); + assertTrue(king instanceof ElfKing); + assertEquals(ElfKing.DESCRIPTION, king.getDescription()); + assertTrue(castle instanceof ElfCastle); + assertEquals(ElfCastle.DESCRIPTION, castle.getDescription()); + assertTrue(army instanceof ElfArmy); + assertEquals(ElfArmy.DESCRIPTION, army.getDescription()); + } + + @Test + public void createOrcKingdom() { + app.createKingdom(orcFactory); + final King king = app.getKing(); + final Castle castle = app.getCastle(); + final Army army = app.getArmy(); + assertTrue(king instanceof OrcKing); + assertEquals(OrcKing.DESCRIPTION, king.getDescription()); + assertTrue(castle instanceof OrcCastle); + assertEquals(OrcCastle.DESCRIPTION, castle.getDescription()); + assertTrue(army instanceof OrcArmy); + assertEquals(OrcArmy.DESCRIPTION, army.getDescription()); + } +} diff --git a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java index 0270f4cef..a965284f7 100644 --- a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java +++ b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java @@ -22,79 +22,17 @@ */ package com.iluwatar.abstractfactory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Before; import org.junit.Test; +import java.io.IOException; + +/** + * Tests that Abstract Factory example runs without errors. + */ public class AppTest { - - private App app = new App(); - private KingdomFactory elfFactory; - private KingdomFactory orcFactory; - - @Before - public void setUp() { - elfFactory = app.getElfKingdomFactory(); - orcFactory = app.getOrcKingdomFactory(); - } - @Test - public void king() { - final King elfKing = app.getKing(elfFactory); - assertTrue(elfKing instanceof ElfKing); - assertEquals(ElfKing.DESCRIPTION, elfKing.getDescription()); - final King orcKing = app.getKing(orcFactory); - assertTrue(orcKing instanceof OrcKing); - assertEquals(OrcKing.DESCRIPTION, orcKing.getDescription()); - } - - @Test - public void castle() { - final Castle elfCastle = app.getCastle(elfFactory); - assertTrue(elfCastle instanceof ElfCastle); - assertEquals(ElfCastle.DESCRIPTION, elfCastle.getDescription()); - final Castle orcCastle = app.getCastle(orcFactory); - assertTrue(orcCastle instanceof OrcCastle); - assertEquals(OrcCastle.DESCRIPTION, orcCastle.getDescription()); - } - - @Test - public void army() { - final Army elfArmy = app.getArmy(elfFactory); - assertTrue(elfArmy instanceof ElfArmy); - assertEquals(ElfArmy.DESCRIPTION, elfArmy.getDescription()); - final Army orcArmy = app.getArmy(orcFactory); - assertTrue(orcArmy instanceof OrcArmy); - assertEquals(OrcArmy.DESCRIPTION, orcArmy.getDescription()); - } - - @Test - public void createElfKingdom() { - app.createKingdom(elfFactory); - final King king = app.getKing(); - final Castle castle = app.getCastle(); - final Army army = app.getArmy(); - assertTrue(king instanceof ElfKing); - assertEquals(ElfKing.DESCRIPTION, king.getDescription()); - assertTrue(castle instanceof ElfCastle); - assertEquals(ElfCastle.DESCRIPTION, castle.getDescription()); - assertTrue(army instanceof ElfArmy); - assertEquals(ElfArmy.DESCRIPTION, army.getDescription()); - } - - @Test - public void createOrcKingdom() { - app.createKingdom(orcFactory); - final King king = app.getKing(); - final Castle castle = app.getCastle(); - final Army army = app.getArmy(); - assertTrue(king instanceof OrcKing); - assertEquals(OrcKing.DESCRIPTION, king.getDescription()); - assertTrue(castle instanceof OrcCastle); - assertEquals(OrcCastle.DESCRIPTION, castle.getDescription()); - assertTrue(army instanceof OrcArmy); - assertEquals(OrcArmy.DESCRIPTION, army.getDescription()); + public void test() throws IOException { + String[] args = {}; + App.main(args); } } diff --git a/adapter/src/test/java/com/iluwatar/adapter/AppTest.java b/adapter/src/test/java/com/iluwatar/adapter/AppTest.java new file mode 100644 index 000000000..4f5fcd91d --- /dev/null +++ b/adapter/src/test/java/com/iluwatar/adapter/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.adapter; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Adapter example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/business-delegate/src/test/java/com/iluwatar/business/delegate/AppTest.java b/business-delegate/src/test/java/com/iluwatar/business/delegate/AppTest.java new file mode 100644 index 000000000..1767b7ac5 --- /dev/null +++ b/business-delegate/src/test/java/com/iluwatar/business/delegate/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.business.delegate; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Business Delegate example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/caching/src/test/java/com/iluwatar/caching/AppTest.java b/caching/src/test/java/com/iluwatar/caching/AppTest.java index d2b6a393c..90ed1c275 100644 --- a/caching/src/test/java/com/iluwatar/caching/AppTest.java +++ b/caching/src/test/java/com/iluwatar/caching/AppTest.java @@ -22,42 +22,17 @@ */ package com.iluwatar.caching; -import org.junit.Before; import org.junit.Test; +import java.io.IOException; + /** - * - * Application test - * + * Tests that Caching example runs without errors. */ public class AppTest { - App app; - - /** - * Setup of application test includes: initializing DB connection and cache size/capacity. - */ - @Before - public void setUp() { - AppManager.initDb(false); // VirtualDB (instead of MongoDB) was used in running the JUnit tests - // to avoid Maven compilation errors. Set flag to true to run the - // tests with MongoDB (provided that MongoDB is installed and socket - // connection is open). - AppManager.initCacheCapacity(3); - app = new App(); - } - @Test - public void testReadAndWriteThroughStrategy() { - app.useReadAndWriteThroughStrategy(); - } - - @Test - public void testReadThroughAndWriteAroundStrategy() { - app.useReadThroughAndWriteAroundStrategy(); - } - - @Test - public void testReadThroughAndWriteBehindStrategy() { - app.useReadThroughAndWriteBehindStrategy(); + public void test() throws IOException { + String[] args = {}; + App.main(args); } } diff --git a/caching/src/test/java/com/iluwatar/caching/CachingTest.java b/caching/src/test/java/com/iluwatar/caching/CachingTest.java new file mode 100644 index 000000000..19262a3b6 --- /dev/null +++ b/caching/src/test/java/com/iluwatar/caching/CachingTest.java @@ -0,0 +1,63 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.caching; + +import org.junit.Before; +import org.junit.Test; + +/** + * + * Application test + * + */ +public class CachingTest { + App app; + + /** + * Setup of application test includes: initializing DB connection and cache size/capacity. + */ + @Before + public void setUp() { + AppManager.initDb(false); // VirtualDB (instead of MongoDB) was used in running the JUnit tests + // to avoid Maven compilation errors. Set flag to true to run the + // tests with MongoDB (provided that MongoDB is installed and socket + // connection is open). + AppManager.initCacheCapacity(3); + app = new App(); + } + + @Test + public void testReadAndWriteThroughStrategy() { + app.useReadAndWriteThroughStrategy(); + } + + @Test + public void testReadThroughAndWriteAroundStrategy() { + app.useReadThroughAndWriteAroundStrategy(); + } + + @Test + public void testReadThroughAndWriteBehindStrategy() { + app.useReadThroughAndWriteBehindStrategy(); + } +} diff --git a/callback/src/test/java/com/iluwatar/callback/AppTest.java b/callback/src/test/java/com/iluwatar/callback/AppTest.java index f5ef1504c..b7ab3fe75 100644 --- a/callback/src/test/java/com/iluwatar/callback/AppTest.java +++ b/callback/src/test/java/com/iluwatar/callback/AppTest.java @@ -24,56 +24,15 @@ package com.iluwatar.callback; import org.junit.Test; -import static org.junit.Assert.assertEquals; +import java.io.IOException; /** - * Add a field as a counter. Every time the callback method is called increment this field. Unit - * test checks that the field is being incremented. - * - * Could be done with mock objects as well where the call method call is verified. + * Tests that Callback example runs without errors. */ public class AppTest { - - private Integer callingCount = 0; - @Test - public void test() { - Callback callback = new Callback() { - @Override - public void call() { - callingCount++; - } - }; - - Task task = new SimpleTask(); - - assertEquals("Initial calling count of 0", new Integer(0), callingCount); - - task.executeWith(callback); - - assertEquals("Callback called once", new Integer(1), callingCount); - - task.executeWith(callback); - - assertEquals("Callback called twice", new Integer(2), callingCount); - - } - - @Test - public void testWithLambdasExample() { - Callback callback = () -> callingCount++; - - Task task = new SimpleTask(); - - assertEquals("Initial calling count of 0", new Integer(0), callingCount); - - task.executeWith(callback); - - assertEquals("Callback called once", new Integer(1), callingCount); - - task.executeWith(callback); - - assertEquals("Callback called twice", new Integer(2), callingCount); - + public void test() throws IOException { + String[] args = {}; + App.main(args); } } diff --git a/callback/src/test/java/com/iluwatar/callback/CallbackTest.java b/callback/src/test/java/com/iluwatar/callback/CallbackTest.java new file mode 100644 index 000000000..b48ac36ff --- /dev/null +++ b/callback/src/test/java/com/iluwatar/callback/CallbackTest.java @@ -0,0 +1,79 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.callback; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Add a field as a counter. Every time the callback method is called increment this field. Unit + * test checks that the field is being incremented. + * + * Could be done with mock objects as well where the call method call is verified. + */ +public class CallbackTest { + + private Integer callingCount = 0; + + @Test + public void test() { + Callback callback = new Callback() { + @Override + public void call() { + callingCount++; + } + }; + + Task task = new SimpleTask(); + + assertEquals("Initial calling count of 0", new Integer(0), callingCount); + + task.executeWith(callback); + + assertEquals("Callback called once", new Integer(1), callingCount); + + task.executeWith(callback); + + assertEquals("Callback called twice", new Integer(2), callingCount); + + } + + @Test + public void testWithLambdasExample() { + Callback callback = () -> callingCount++; + + Task task = new SimpleTask(); + + assertEquals("Initial calling count of 0", new Integer(0), callingCount); + + task.executeWith(callback); + + assertEquals("Callback called once", new Integer(1), callingCount); + + task.executeWith(callback); + + assertEquals("Callback called twice", new Integer(2), callingCount); + + } +} diff --git a/command/src/test/java/com/iluwatar/command/AppTest.java b/command/src/test/java/com/iluwatar/command/AppTest.java new file mode 100644 index 000000000..560594272 --- /dev/null +++ b/command/src/test/java/com/iluwatar/command/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.command; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Command example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/dao/src/test/java/com/iluwatar/dao/AppTest.java b/dao/src/test/java/com/iluwatar/dao/AppTest.java new file mode 100644 index 000000000..b4caa54b4 --- /dev/null +++ b/dao/src/test/java/com/iluwatar/dao/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.dao; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that DAO example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/event-driven-architecture/src/test/java/com/iluwatar/eda/AppTest.java b/event-driven-architecture/src/test/java/com/iluwatar/eda/AppTest.java new file mode 100644 index 000000000..603d0a61b --- /dev/null +++ b/event-driven-architecture/src/test/java/com/iluwatar/eda/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.eda; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Event Driven Architecture example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/factory-method/src/test/java/com/iluwatar/factory/method/AppTest.java b/factory-method/src/test/java/com/iluwatar/factory/method/AppTest.java new file mode 100644 index 000000000..818ee96cd --- /dev/null +++ b/factory-method/src/test/java/com/iluwatar/factory/method/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.factory.method; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Factory Method example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +} diff --git a/reactor/src/test/java/com/iluwatar/reactor/app/AppTest.java b/reactor/src/test/java/com/iluwatar/reactor/app/ReactorTest.java similarity index 99% rename from reactor/src/test/java/com/iluwatar/reactor/app/AppTest.java rename to reactor/src/test/java/com/iluwatar/reactor/app/ReactorTest.java index 25d43d781..1ec70f87f 100644 --- a/reactor/src/test/java/com/iluwatar/reactor/app/AppTest.java +++ b/reactor/src/test/java/com/iluwatar/reactor/app/ReactorTest.java @@ -34,7 +34,7 @@ import com.iluwatar.reactor.framework.ThreadPoolDispatcher; * This class tests the Distributed Logging service by starting a Reactor and then sending it * concurrent logging requests using multiple clients. */ -public class AppTest { +public class ReactorTest { /** * Test the application using pooled thread dispatcher. diff --git a/repository/src/test/java/com/iluwatar/repository/AppTest.java b/repository/src/test/java/com/iluwatar/repository/AppTest.java new file mode 100644 index 000000000..e1fc27bef --- /dev/null +++ b/repository/src/test/java/com/iluwatar/repository/AppTest.java @@ -0,0 +1,38 @@ +/** + * The MIT License + * Copyright (c) 2014 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.repository; + +import org.junit.Test; + +import java.io.IOException; + +/** + * Tests that Repository example runs without errors. + */ +public class AppTest { + @Test + public void test() throws IOException { + String[] args = {}; + App.main(args); + } +}