BAEL-1289 - Merge (#3136)
* Initial Commit * Added Domain Classes * Update HighEndComputer.java * Update StandardComputer.java * Update TemplateMethodPatternTest.java * Update parent pom.xml * Update pom.xml in template-method submodule * Update readme.md * Update README.md * Initial Commit * Update HighEndComputer.java * Delete article folder * Initial Commit * Initial Commit * Initial Commit * Added Article Folder * Delete Article Folder * Added Article Folder
This commit is contained in:
parent
04dc60bd12
commit
aa46858c0f
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.templatemethod</groupId>
|
||||
<artifactId>template-method</artifactId>
|
||||
<groupId>com.baeldung.pattern.templatemethod</groupId>
|
||||
<artifactId>pattern.templatemethod</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
<parent>
|
|
@ -1,11 +1,11 @@
|
|||
package com.baeldung.templatemethodpattern.application;
|
||||
package com.baeldung.pattern.templatemethod.application;
|
||||
|
||||
import com.baeldung.templatemethodpattern.model.Computer;
|
||||
import com.baeldung.templatemethodpattern.model.StandardComputer;
|
||||
import com.baeldung.templatemethodpattern.model.HighEndComputer;
|
||||
import com.baeldung.templatemethodpattern.model.ComputerBuilder;
|
||||
import com.baeldung.templatemethodpattern.model.HighEndComputerBuilder;
|
||||
import com.baeldung.templatemethodpattern.model.StandardComputerBuilder;
|
||||
import com.baeldung.pattern.templatemethod.model.Computer;
|
||||
import com.baeldung.pattern.templatemethod.model.StandardComputer;
|
||||
import com.baeldung.pattern.templatemethod.model.HighEndComputer;
|
||||
import com.baeldung.pattern.templatemethod.model.ComputerBuilder;
|
||||
import com.baeldung.pattern.templatemethod.model.HighEndComputerBuilder;
|
||||
import com.baeldung.pattern.templatemethod.model.StandardComputerBuilder;
|
||||
|
||||
public class Application {
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Computer {
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
import com.baeldung.pattern.templatemethod.model.Computer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
|
@ -1,10 +1,11 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
import com.baeldung.pattern.templatemethod.model.Computer;
|
||||
import java.util.Map;
|
||||
|
||||
public class HighEndComputer extends Computer {
|
||||
|
||||
public HighEndComputer(Map<String, String> computerParts) {
|
||||
super(computerParts);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
public class HighEndComputerBuilder extends ComputerBuilder {
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
import com.baeldung.pattern.templatemethod.model.Computer;
|
||||
import java.util.Map;
|
||||
|
||||
public class StandardComputer extends Computer {
|
||||
|
||||
public StandardComputer(Map<String, String> computerParts) {
|
||||
super(computerParts);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.templatemethodpattern.model;
|
||||
package com.baeldung.pattern.templatemethod.model;
|
||||
|
||||
public class StandardComputerBuilder extends ComputerBuilder {
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.baeldung.templatemethodpatterntest;
|
||||
package com.baeldung.pattern.templatemethod.test;
|
||||
|
||||
import com.baeldung.templatemethodpattern.model.Computer;
|
||||
import com.baeldung.templatemethodpattern.model.HighEndComputerBuilder;
|
||||
import com.baeldung.templatemethodpattern.model.StandardComputerBuilder;
|
||||
import com.baeldung.templatemethodpattern.model.HighEndComputer;
|
||||
import com.baeldung.templatemethodpattern.model.StandardComputer;
|
||||
import com.baeldung.pattern.templatemethod.model.Computer;
|
||||
import com.baeldung.pattern.templatemethod.model.HighEndComputerBuilder;
|
||||
import com.baeldung.pattern.templatemethod.model.StandardComputerBuilder;
|
||||
import org.junit.Assert;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -82,7 +80,7 @@ public class TemplateMethodPatternTest {
|
|||
assertEquals(2, highEndComputerBuilder.getComputerParts().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void givenAllHighEndParts_whenComputerisBuilt_thenComputerInstance() {
|
||||
assertThat(standardComputerBuilder.buildComputer(), instanceOf(Computer.class));
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
<modules>
|
||||
<module>front-controller</module>
|
||||
<module>intercepting-filter</module>
|
||||
<module>template-method</module>
|
||||
<module>behavioral-patterns</module>
|
||||
</modules>
|
||||
|
||||
<parent>
|
||||
|
|
Loading…
Reference in New Issue