fix: Reader·Writer 설정 안내 예외가 실제로 읽지 않는 Job 파라미터 키를 알려주는 문제 수정 - #364
Open
wantaekchoi wants to merge 1 commit into
Open
fix: Reader·Writer 설정 안내 예외가 실제로 읽지 않는 Job 파라미터 키를 알려주는 문제 수정#364wantaekchoi wants to merge 1 commit into
wantaekchoi wants to merge 1 commit into
Conversation
DefaultItemWriter 는 설정이 빠졌을 때 안내 예외에 적는 키를 문자열로 따로 적어 두어, 실제로 읽는 키와 어긋나 있었다. 안내대로 <스텝>.writer.resourceName, <스텝>.writer.fieldNames, <스텝>.writer.fieldRanges, <스텝>.writerResourceType 을 설정해도 Writer 는 각각 .writer.resource.name, .writer.field.names, .writer.field.ranges, .writer.resource.type 을 읽으므로 같은 예외가 되풀이된다. DefaultItemReader 의 jdbcDb 분기도 .reader.sql 을 읽으면서 .writer.sql 을 안내하고 있었다. DefaultItemReader 의 다른 안내문처럼 키 상수를 그대로 이어 붙이도록 고쳤다. 같은 안내문 두 곳이 Reader 와 Writer 를 서로 바꿔 적고 있던 것도 함께 맞췄다. DefaultItemWriter 의 fixedLengthFile 분기는 "스텝의 Reader 설정에서" 로, DefaultItemReader 의 jdbcDb 분기는 "스텝의 Writer 설정에서" 로 적혀 있었다.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
DefaultItemWriter·DefaultItemReader의 설정 안내 예외가 그 클래스가 실제로 읽지 않는 Job 파라미터 키를 알려 줘서, 안내대로 설정해도 같은 예외가 되풀이됩니다.<스텝>뒤).writer.resourceName.writer.resource.name.writer.fieldNames.writer.field.names.writer.fieldRanges.writer.field.ranges.writerResourceType.writer.resource.type.writer.sql(Reader jdbcDb 분기).reader.sql오른쪽은 상수 선언 그대로입니다(
DefaultItemWriter.java:57-60,DefaultItemReader.java:65).DefaultItemReader안내문 네 곳 중 세 곳은 이 상수를 이어 붙이고(161-165), jdbcDb 분기만 키를 따로 적어 어긋났습니다.AS-IS / TO-BE
안내문이 키 상수를 이어 붙이게 바꿨습니다.
writerJdbcDbGuidance분기의.writer.sql·.writer.params는 수정 전에도 맞았지만 리터럴이 다시 어긋나지 않게 같이 통일했습니다.DefaultItemWriter.java156·164·181 도 같은 형태로 바꿨습니다.안내문 두 곳이 Reader 와 Writer 를 서로 바꿔 적고 있어 함께 맞췄습니다(Writer fixedLengthFile "스텝의 Reader 설정에서", Reader jdbcDb "스텝의 Writer 설정에서"). 나머지 네 곳(Reader 161·170, Writer 156·181)은 원래 맞아서 손대지 않았습니다.
영향 범위
바뀐 것은 예외 메시지 문자열뿐이고 읽는 키와 분기 조건은 그대로입니다. 수정 후 남은
".reader·".writer리터럴은 상수 선언(Reader 58-66, Writer 56-63)과 XML 조립용 bean id 뿐입니다.두 클래스를 부르는 곳은 이번에 더한 테스트뿐이고,
README.md28·29 줄 목록에만 이름이 있습니다. 옛 문자열을 검사하는 테스트도 없습니다.나눠서 받고 싶으시면
DefaultItemReader쪽 변경과readerJdbcDbGuidance테스트를 빼면 됩니다. 같은 결함이라 한 커밋으로 묶었습니다.JUnit 테스트 JUnit tests
안내문에서 키를 뽑아 되먹이는
DefaultItemGuidanceKeyTest(6건)를 추가했습니다. 수정 전(origin/main)에는 여섯 건 중 네 건이 실패합니다.나머지 두 건(
writerJdbcDbGuidance·readerDelimitedFileGuidance)은 원래 키가 맞아 수정 전에도 통과합니다. 수정 후 모듈 전체입니다.테스트 브라우저 Test Browser
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
화면이 없는 실행환경 모듈이라 첨부하지 않았습니다.