diff --git a/VamPa/pom.xml b/VamPa/pom.xml index b0d5e8e..fe6d6ec 100644 --- a/VamPa/pom.xml +++ b/VamPa/pom.xml @@ -58,7 +58,7 @@ ${org.slf4j-version} runtime - + + + + + + log4j + log4j + 1.2.17 + + + + + + + org.springframework + spring-test + ${org.springframework-version} + test + + + + + + org.projectlombok + lombok + 1.18.12 + provided @@ -113,7 +140,7 @@ junit junit - 4.7 + 4.12 test diff --git a/VamPa/src/main/java/com/vam/sample/Chef.java b/VamPa/src/main/java/com/vam/sample/Chef.java new file mode 100644 index 0000000..e7ca37e --- /dev/null +++ b/VamPa/src/main/java/com/vam/sample/Chef.java @@ -0,0 +1,11 @@ +package com.vam.sample; + +import org.springframework.stereotype.Component; + +import lombok.Data; + +@Component +@Data +public class Chef { + +} diff --git a/VamPa/src/main/java/com/vam/sample/Restaurant.java b/VamPa/src/main/java/com/vam/sample/Restaurant.java new file mode 100644 index 0000000..49a972c --- /dev/null +++ b/VamPa/src/main/java/com/vam/sample/Restaurant.java @@ -0,0 +1,16 @@ +package com.vam.sample; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import lombok.Data; +import lombok.Setter; + +@Component +@Data +public class Restaurant { + + @Setter(onMethod_=@Autowired) + private Chef chef; + +} diff --git a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml index e071144..8c2b519 100644 --- a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml @@ -1,8 +1,11 @@ + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> + + - diff --git a/VamPa/src/test/java/com/vam/sample/SampleTests.java b/VamPa/src/test/java/com/vam/sample/SampleTests.java new file mode 100644 index 0000000..f05b011 --- /dev/null +++ b/VamPa/src/test/java/com/vam/sample/SampleTests.java @@ -0,0 +1,32 @@ +package com.vam.sample; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import lombok.extern.log4j.Log4j; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") +@Log4j +public class SampleTests { + + @Autowired + private Restaurant restaurant; + + @Test + public void textExit() { + + assertNotNull(restaurant); + + log.info(restaurant);; + log.info("-------------------------------"); + log.info(restaurant.getChef()); + + } + +} diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index 650a469..eea623b 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,7 +1,7 @@ #Generated by Maven Integration for Eclipse -#Fri Aug 07 23:14:14 KST 2020 +#Fri Aug 07 23:47:48 KST 2020 version=1.0.0-BUILD-SNAPSHOT groupId=com.vam m2e.projectName=VamPa -m2e.projectLocation=D\:\\Blog_Project\\VamPa +m2e.projectLocation=C\:\\Users\\sjinj\\git\\blog_project\\VamPa artifactId=controller diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml index b0d5e8e..fe6d6ec 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml @@ -58,7 +58,7 @@ ${org.slf4j-version} runtime - + + + + + + log4j + log4j + 1.2.17 + + + + + + + org.springframework + spring-test + ${org.springframework-version} + test + + + + + + org.projectlombok + lombok + 1.18.12 + provided @@ -113,7 +140,7 @@ junit junit - 4.7 + 4.12 test diff --git a/VamPa_MySQL/pom.xml b/VamPa_MySQL/pom.xml index 26845fe..20657d6 100644 --- a/VamPa_MySQL/pom.xml +++ b/VamPa_MySQL/pom.xml @@ -58,7 +58,7 @@ ${org.slf4j-version} runtime - + + + + + + log4j + log4j + 1.2.17 + + + + + + + org.springframework + spring-test + ${org.springframework-version} + test + + + + + + org.projectlombok + lombok + 1.18.12 + provided @@ -113,7 +140,7 @@ junit junit - 4.7 + 4.12 test diff --git a/VamPa_MySQL/src/main/java/com/vam/sample/Chef.java b/VamPa_MySQL/src/main/java/com/vam/sample/Chef.java new file mode 100644 index 0000000..e7ca37e --- /dev/null +++ b/VamPa_MySQL/src/main/java/com/vam/sample/Chef.java @@ -0,0 +1,11 @@ +package com.vam.sample; + +import org.springframework.stereotype.Component; + +import lombok.Data; + +@Component +@Data +public class Chef { + +} diff --git a/VamPa_MySQL/src/main/java/com/vam/sample/Restaurant.java b/VamPa_MySQL/src/main/java/com/vam/sample/Restaurant.java new file mode 100644 index 0000000..c4fa0d6 --- /dev/null +++ b/VamPa_MySQL/src/main/java/com/vam/sample/Restaurant.java @@ -0,0 +1,16 @@ +package com.vam.sample; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import lombok.Data; +import lombok.Setter; + +@Component +@Data +public class Restaurant { + + @Setter(onMethod_=@Autowired) + private Chef chef; + +} diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml b/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml index e071144..f04d217 100644 --- a/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml @@ -1,8 +1,10 @@ + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> - + diff --git a/VamPa_MySQL/src/test/java/com/vam/sample/SampleTests.java b/VamPa_MySQL/src/test/java/com/vam/sample/SampleTests.java new file mode 100644 index 0000000..fba3f23 --- /dev/null +++ b/VamPa_MySQL/src/test/java/com/vam/sample/SampleTests.java @@ -0,0 +1,33 @@ +package com.vam.sample; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import lombok.extern.log4j.Log4j; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") +@Log4j +public class SampleTests { + + @Autowired + private Restaurant restaurant; + + @Test + public void textExit() { + + assertNotNull(restaurant); + + log.info(restaurant); + log.info("-----------------------------------"); + log.info(restaurant.getChef()); + + } + + +} diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index d728907..7ede2d5 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,7 +1,7 @@ #Generated by Maven Integration for Eclipse -#Fri Aug 07 23:14:53 KST 2020 +#Fri Aug 07 23:49:01 KST 2020 version=1.0.0-BUILD-SNAPSHOT groupId=com.vam m2e.projectName=VamPa_MySQL -m2e.projectLocation=D\:\\Blog_Project\\VamPa_MySQL +m2e.projectLocation=C\:\\Users\\sjinj\\git\\blog_project\\VamPa_MySQL artifactId=controller diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml index 26845fe..20657d6 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml @@ -58,7 +58,7 @@ ${org.slf4j-version} runtime - + + + + + + log4j + log4j + 1.2.17 + + + + + + + org.springframework + spring-test + ${org.springframework-version} + test + + + + + + org.projectlombok + lombok + 1.18.12 + provided @@ -113,7 +140,7 @@ junit junit - 4.7 + 4.12 test