-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MVC 구현하기 - 1단계] 히이로(문제웅) 미션 제출합니다. (#390)
* test: reflection 학습 테스트 진행 완료 * docs: README 기능 요구사항 명세 작성 * feat: AnnotationHandlerMapping 클래스 initialize 기능 구현 * feat: AnnotationHandlerMapping 클래스 getHandler 기능 구현 * feat: HandlerExecution 클래스 handle 기능 구현 * test: user 테스트 추가 * test: servlet 학습 테스트 완료
- Loading branch information
1 parent
e7c21ab
commit 0e98fe1
Showing
16 changed files
with
176 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# @MVC 구현하기 | ||
|
||
# 기능 요구사항 명세 | ||
- [] 어노테이션 기반의 MVC 프레임워크를 구현한다. | ||
- [] mvc 모듈과 app 모듈의 영역이 잘 구분되어야 한다. | ||
- [] 새로운 컨트롤러가 생겨도 MVC 프레임워크 영역까지 영향이 미치면 안된다. | ||
- [x] AnnotationHandlerMapping 구현 사항 | ||
- [x] initialize 기능 구현 | ||
- [x] basePackage 하위에 존재하는 @Controller 어노테이션 선언 클래스 탐색 | ||
- [x] Controller 클래스 내 선언된 @requestMapping 어노테이션 선언 메서드 탐색 | ||
- [x] 각 Method 객체를 조합으로 가지는 HandlerExecution 객체를 생성해서 저장 | ||
- [x] getHandler 기능 구현 | ||
- [x] HttpServletRequest 객체를 인자로 받아서 HandlerKey 객체 생성 | ||
- [x] 생성된 HandlerKey 객체를 key로 가지는 value 값에 해당하는 handler를 반환 | ||
- [x] HandlerExecution 구현 사항 | ||
- [x] handler 객체에서 request, response 객체를 인자로 받아 적합한 비즈니스 로직을 수행하는 기능을 구현한다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.techcourse.domain; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
@SuppressWarnings("NonAsciiCharacters") | ||
class UserTest { | ||
|
||
@Test | ||
void 입력한_비밀번호가_사용자_정보와_일치하는지_확인할_수_있다() { | ||
//given | ||
User user = new User(1, "gugu", "password", "[email protected]"); | ||
|
||
//when | ||
boolean result = user.checkPassword("password"); | ||
|
||
//then | ||
assertThat(result).isTrue(); | ||
} | ||
|
||
@Test | ||
void 입력한_비밀번호가_사용자_정보와_불일치하는지_확인할_수_있다() { | ||
//given | ||
User user = new User(1, "gugu", "password", "[email protected]"); | ||
|
||
//when | ||
boolean result = user.checkPassword("wrong password"); | ||
|
||
//then | ||
assertThat(result).isFalse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/servlet/com/example/KoreanServlet.java → ...on/servlet/com/example/KoreanServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...vlet/com/example/LocalCounterServlet.java → ...vlet/com/example/LocalCounterServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rvlet/com/example/ServletApplication.java → ...rvlet/com/example/ServletApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package servlet.com.example; | ||
package reflection.servlet.com.example; | ||
|
||
public class ServletApplication { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...let/com/example/SharedCounterServlet.java → ...let/com/example/SharedCounterServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/servlet/com/example/TomcatStarter.java → ...on/servlet/com/example/TomcatStarter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.