diff --git a/first-part/hw-03/project-root/app/src/main/java/org/example/App.java b/first-part/hw-03/project-root/app/src/main/java/org/example/App.java deleted file mode 100644 index 18b15d7..0000000 --- a/first-part/hw-03/project-root/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.example.adapter.*; -import org.example.builder.*; -import org.example.chain.*; -import org.example.decorator.*; -import org.example.proxy.*; -import org.example.strategy.*; - -public class App { - public static void main(String[] args) { - run(); - } - - private static void run() { - checkAdapterPattern(); - - checkBuilderPattern(); - - checkChainPattern(); - - checkDecoratorPattern(); - - checkProxyPattern(); - - checkStrategyPattern(); - } - - private static void checkAdapterPattern() { - Adaptee adaptee = new Adaptee(); - Target target = new Adapter(adaptee); - - target.methodWithoutArguments(); - } - - private static void checkBuilderPattern() { - Product product = - new ProductBuilder().setFirst("first").setSecond("second").setThird(3).build(); - - System.out.println(product); - } - - private static void checkChainPattern() { - Handler handler = new ConcreteHandlerA(); - handler.setNext(new ConcreteHandlerB()); - - handler.handle(42); - handler.handle("Hello"); - } - - private static void checkDecoratorPattern() { - Component component = new ConcreteComponent(); - Component decorator = new ConcreteDecorator(component); - - decorator.operation(); - } - - private static void checkProxyPattern() { - Service service = new ConcreteService(); - Service proxy = new ServiceProxy(service); - - proxy.execute(); - } - - private static void checkStrategyPattern() { - Context context = new Context(new ConcreteStrategyA()); - - boolean crayfishWhistled = true; // Если рак на горе свистнул - - if (crayfishWhistled) { - context.setStrategy(new ConcreteStrategyB()); - } - - context.executeStrategy(); - } -} diff --git a/second-part/hw-01/solution/app/src/main/java/org/example/App.java b/second-part/hw-01/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-01/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-01/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-01/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-01/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-02/user-service/src/main/java/com/example/App.java b/second-part/hw-02/user-service/src/main/java/com/example/App.java deleted file mode 100644 index daa6d08..0000000 --- a/second-part/hw-02/user-service/src/main/java/com/example/App.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.example; - -/** - * Hello world! - */ -public class App { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} diff --git a/second-part/hw-02/user-service/src/test/java/com/example/AppTest.java b/second-part/hw-02/user-service/src/test/java/com/example/AppTest.java deleted file mode 100644 index e4db7b5..0000000 --- a/second-part/hw-02/user-service/src/test/java/com/example/AppTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; - -/** - * Unit test for simple App. - */ -public class AppTest { - - /** - * Rigorous Test :-) - */ - @Test - public void shouldAnswerWithTrue() { - assertTrue(true); - } -} diff --git a/second-part/hw-03/solution/app/src/main/java/org/example/App.java b/second-part/hw-03/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-03/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-03/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-03/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-03/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-04/solution/app/src/main/java/org/example/App.java b/second-part/hw-04/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-04/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-04/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-04/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-04/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-05/solution/app/src/main/java/org/example/App.java b/second-part/hw-05/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-05/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-05/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-05/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-05/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-06/solution/app/src/main/java/org/example/App.java b/second-part/hw-06/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-06/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-06/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-06/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-06/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-07/solution/app/src/main/java/org/example/App.java b/second-part/hw-07/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-07/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-07/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-07/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-07/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/second-part/hw-08/solution/app/src/main/java/org/example/App.java b/second-part/hw-08/solution/app/src/main/java/org/example/App.java deleted file mode 100644 index e7e1af9..0000000 --- a/second-part/hw-08/solution/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/second-part/hw-08/solution/app/src/test/java/org/example/AppTest.java b/second-part/hw-08/solution/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index f5ce33d..0000000 --- a/second-part/hw-08/solution/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -}