Skip to content

fix(sample): 예외 처리를 구체화하고 Selenium 테스트를 현행화하다 - #48

Merged
jei007 merged 1 commit into
eGovFramework:mainfrom
itcen-entec-2026:fix/sample-exception-handling
Sep 7, 2026
Merged

jei007 merged 1 commit into
eGovFramework:mainfrom
itcen-entec-2026:fix/sample-exception-handling

Conversation

@LeeBaekHaeng

Copy link
Copy Markdown
Contributor

수정 사유 Reason for modification

소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

검토자를 위해 수정된 소스 내용을 설명해 주세요. Please describe the modified source for reviewers.

개요

시큐어코딩 솔루션에서 포괄적인 throws Exception 선언이 진단되는 문제를 개선합니다.

진단 결과 throws BaseRuntimeException, Exception으로 예외 유형을 명시하면
진단되지 않는 것을 확인했으며, 제거할 수 있는 포괄적 예외 선언은 제거하고
필요한 위치에는 BaseRuntimeException을 명시했습니다.

아울러 현재 애플리케이션 경로와 화면 구조가 반영되지 않았던 Selenium 테스트를
현행화했습니다.

주요 변경 사항

  • 샘플 서비스와 컨트롤러의 포괄적인 예외 선언 제거 또는 구체화
  • ID 생성 중 발생하는 FdlException을 BaseRuntimeException으로 변환
  • 파일 읽기 중 발생하는 IOException을 BaseRuntimeException으로 변환
  • 테스트의 리플렉션 예외를 BaseRuntimeException으로 변환
  • 관련 단위·통합 테스트의 예외 선언 정리
  • Selenium 테스트 실행 URL을 /egovframe-web으로 변경
  • 등록 JavaScript 함수를 sampleAdd()로 변경
  • 등록 확인 대화상자 수락 처리 추가
  • 현재 게시판 화면 구조에 맞게 결과 셀렉터 수정
  • 테스트 서버가 실행 중이지 않으면 Selenium 테스트를 중단하도록 처리

변경 파일

운영 코드

  • EgovSampleService.java
  • EgovSampleServiceImpl.java
  • EgovSampleController.java

테스트 코드

  • EgovErrorViewResourceTest.java
  • EgovSampleServiceImplTestDeleteSampleTest.java
  • EgovSampleServiceImplTestInsertSampleTest.java
  • EgovSampleServiceImplTestUpdateSampleTest.java
  • SampleMapperTestInsertSampleTest.java
  • EgovSampleControllerAddSampleRedirectTest.java
  • EgovSampleControllerTestAddSampleTest.java
  • EgovSampleListJspPageIndexTest.java
  • TestEgovSampleControllerTestSelenium.java

검증

환경:

  • Java: Temurin 17.0.17
  • Maven: 3.9.9

결과:

  • mvn clean test -DskipTests: 성공

  • 운영 코드 10개 및 테스트 코드 12개 컴파일 성공

  • git diff --check: 이상 없음

  • 전체 테스트 9개 중 8개 통과

  • EgovSampleControllerTestAddSampleTest 1개는 Jakarta EL 구현이
    테스트 런타임 클래스패스에 없어 실패하면 Eclipse에서 Maven test 프로파일을 활성화

    • 오류: HV000183: Unable to initialize jakarta.el.ExpressionFactory
    • 변경 코드의 컴파일 오류는 아님

Eclipse에서 Maven test 프로파일을 활성화하는 설정 화면입니다.
image

JUnit 테스트 JUnit tests

테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.

  • JUnit 테스트 JUnit tests
  • 수동 테스트 Manual testing

테스트 브라우저 Test Browser

테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
  • Internet Explorer
  • 기타 Others

테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video

테스트 전과 후의 스크린샷 또는 캡처 영상을 이곳에 첨부해 주세요. Please attach screenshots or video captures of your before and after tests here.

테스트 후

image image

시큐어코딩 진단 대상인 포괄적 throws Exception 선언을 제거하거나
BaseRuntimeException을 함께 명시한다.

FdlException, IOException 및 리플렉션 예외를 BaseRuntimeException으로
변환하고 관련 서비스와 테스트의 예외 선언을 정리한다.

Selenium 테스트의 실행 URL, 등록 함수, 확인 대화상자 처리 및
결과 셀렉터를 현재 화면 구조에 맞게 수정한다.

@jei007 jei007 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.

@jei007
jei007 merged commit fadbd96 into eGovFramework:main Sep 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants