-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MVC 구현하기 - 1단계] 이리내(성채연) 미션 제출합니다. #376
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cec2edf
feat: reflection 학습테스트
hectick 2144375
docs: 요구사항 작성
hectick ce7f32b
feat: 어노테이션을 이용해 핸들러를 찾는 기능 구현
hectick 7b6d091
feat: build.yml 수정
hectick 47e1144
refactor: 메서드 분리
hectick 37211ed
refactor: 불필요한 부분 삭제
hectick 9d65145
refactor: import 정리
hectick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,4 @@ | ||
# @MVC 구현하기 | ||
|
||
- [x] 1단계 - @MVC 프레임워크 구현하기 | ||
- [x] 어노테이션 기반의 MVC 프레임워크를 구현 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package reflection; | ||
|
||
import java.lang.reflect.Method; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class Junit4TestRunner { | ||
|
@@ -9,5 +10,15 @@ void run() throws Exception { | |
Class<Junit4Test> clazz = Junit4Test.class; | ||
|
||
// TODO Junit4Test에서 @MyTest 애노테이션이 있는 메소드 실행 | ||
final Junit4Test junit4Test = clazz.getConstructor().newInstance(); | ||
final Method[] methods = clazz.getDeclaredMethods(); // 상속한 메서드 제외 | ||
|
||
for (Method method : methods) { | ||
final MyTest myTest = method.getAnnotation(MyTest.class); | ||
if(myTest != null) { | ||
method.invoke(junit4Test); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (method.isAnnotationPresent(MyTest.class)) {
method.invoke(junit4Test);
} 이렇게도 사용할 수 있습니다 |
||
|
||
} | ||
} | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메서드 분리 깔끔하게 잘 해주셨네요👍