f4e806fa08
전체 스위트 실행 시 115개 중 28개가 실패하던 문제 처리.
1. 클래스별 JVM 격리 (25건)
TransformEngine/LayoutManager/MessageFactory 는 ApplicationContextProvider
기반의 JVM 전역 싱글턴이라, 한 JVM 에서 여러 테스트 클래스를 돌리면 마지막에
뜬 스프링 컨텍스트가 앞선 컨텍스트를 덮어쓴다. 그 결과 뒤 클래스가 앞 클래스의
레이아웃을 보게 되어 "cannot create message" 로 실패했다.
(각 클래스는 단독 실행 시에는 모두 통과)
→ build.gradle test 태스크에 forkEvery = 1 추가.
느려지는 부분은 maxParallelForks 로 상쇄 (7분 → 4분 28초).
2. GetTrinomialFunctionTest 기대값 정정 (2건)
JEP addStandardConstants() 에는 true/false 가 없고 Parser 가 이를 Boolean 으로
등록한다(Parser.addBooleanConstants). 테스트 setUp 도 Boolean 을 바인딩해 놓고
결과를 Number 로 단언하고 있어 자기모순이었음 → Boolean 기대로 정정.
3. LayoutRepositoryTest 시드 ID 수정 (1건)
시드 SQL 어디에도 없는 TST_TTST00000002_RES 를 조회하고 있었음
→ init_tseaitr07/08 에 존재하는 TST_TOSSTEST1_TGT 로 변경.
운영 코드 변경 없음 (build.gradle 테스트 설정 + 테스트 코드만).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AnVAVJLEqjhZnzeWbNcp5q
178 lines
5.7 KiB
Groovy
178 lines
5.7 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'eclipse-wtp'
|
|
id 'idea'
|
|
id 'com.diffplug.eclipse.apt' version '3.41.1'
|
|
}
|
|
|
|
group 'com.eactive'
|
|
version '4.5.1-SNAPSHOT'
|
|
|
|
def nexusUrl = "https://nexus.eactive.synology.me:8090"
|
|
def springVersion = "5.3.27"
|
|
def queryDslVersion = "5.0.0"
|
|
def hibernateVersion = "5.6.15.Final"
|
|
def generatedJavaDir = "$buildDir/generated/java"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(8)
|
|
}
|
|
}
|
|
|
|
compileJava {
|
|
options.encoding = 'UTF-8'
|
|
sourceSets.main.java { srcDir generatedJavaDir }
|
|
options.generatedSourceOutputDirectory = project.file(generatedJavaDir)
|
|
|
|
aptOptions {
|
|
processorArgs = [ 'querydsl.generatedAnnotationClass' : 'com.querydsl.core.annotations.Generated' ]
|
|
}
|
|
}
|
|
|
|
jar {
|
|
exclude '**/persistence.xml'
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
dependencies {
|
|
|
|
// project > properties > Java Compiler > Annoation Processing
|
|
annotationProcessor "org.projectlombok:lombok:1.18.28", "org.projectlombok:lombok-mapstruct-binding:0.2.0", "org.mapstruct:mapstruct-processor:1.5.5.Final"
|
|
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}:jpa", "jakarta.persistence:jakarta.persistence-api:2.2.3", "jakarta.annotation:jakarta.annotation-api:1.3.5"
|
|
|
|
api project(':elink-online-core')
|
|
|
|
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
api 'commons-collections:commons-collections:3.2.2'
|
|
|
|
api 'org.apache.poi:poi-excelant:3.9'
|
|
|
|
api group: 'org.apache.commons', name: 'commons-pool2', version: '2.11.1'
|
|
api 'commons-codec:commons-codec:1.15'
|
|
|
|
//api group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
|
|
compileOnly group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
|
|
|
|
|
|
compileOnly group: 'xalan', name: 'xalan', version: '2.6.0'
|
|
api 'net.sf.j8583:j8583:1.18.0'
|
|
//
|
|
// //삼성페이 penta
|
|
//api 'com.eactive:scphost:1.0'
|
|
//api 'com.eactive:xdsp_java:1.0'
|
|
//api 'com.eactive:jep-4.j18-md:1.0'
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
|
testRuntimeOnly 'com.h2database:h2:2.1.214'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.15'
|
|
testImplementation 'org.junit.platform:junit-platform-suite-api:1.8.2'
|
|
testImplementation 'org.junit.platform:junit-platform-launcher:1.8.2'
|
|
|
|
//testImplementation files("libs/json-simple-1.1.1-custom-1.2.jar")
|
|
//testImplementation files("libs/jep-4.j18-md-1.0.jar")
|
|
testImplementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
testImplementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
|
|
testImplementation 'junit:junit:4.4'
|
|
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
|
|
// TransformEngine/LayoutManager/MessageFactory 는 ApplicationContextProvider 기반의
|
|
// JVM 전역 싱글턴이다. 한 JVM 에서 여러 테스트 클래스를 돌리면 마지막에 뜬 스프링
|
|
// 컨텍스트가 앞선 컨텍스트를 덮어써서, 뒤 클래스가 앞 클래스의 레이아웃을 보게 된다
|
|
// ("cannot create message" 오류). 클래스마다 JVM 을 새로 띄워 격리한다.
|
|
forkEvery = 1
|
|
|
|
// 클래스별 JVM 분리로 느려지는 것을 CPU 코어 수만큼 병렬 실행해 상쇄한다.
|
|
// 포크마다 별도 JVM(=별도 H2 인메모리 DB)이라 서로 간섭하지 않는다.
|
|
maxParallelForks = Math.max(1, Runtime.runtime.availableProcessors().intdiv(2))
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = 'eactiveRepository'
|
|
def releasesRepoUrl = "${nexusUrl}/repository/maven-releases/"
|
|
def snapshotsRepoUrl = "${nexusUrl}/repository/maven-snapshots/"
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
credentials(PasswordCredentials)
|
|
}
|
|
}
|
|
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
pom {
|
|
description = "eLink Transformer module"
|
|
licenses {
|
|
license {
|
|
name = "Commercial License"
|
|
url = "http://eactive.co.kr"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
archiveClassifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
}
|
|
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
// 동적 버전 탐색을 10분 캐시
|
|
cacheDynamicVersionsFor 10, 'minutes'
|
|
// 변하는 모듈(Changing Module)을 캐시하지 않음
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
}
|
|
|
|
task settingEclipseEncoding {
|
|
if (project.file('.settings').exists()) {
|
|
File f = file('.settings/org.eclipse.core.resources.prefs')
|
|
f.write('eclipse.preferences.version=1\n')
|
|
f.append('encoding/<project>=utf-8')
|
|
}
|
|
}
|
|
|
|
task initDirs() {
|
|
file(generatedJavaDir).mkdirs()
|
|
}
|
|
|
|
eclipse {
|
|
synchronizationTasks settingEclipseEncoding, initDirs
|
|
jdt {
|
|
apt {
|
|
// generated 된 패스 경로를 .setting/org.eclipse.jdt.apt.core.prefs 의 org.eclipse.jdt.apt.genSrcDir에 적용한다.
|
|
// project > properties > Java Compiler > Annoation Processing 화면에서 확인 가능하다.
|
|
genSrcDir = file(generatedJavaDir)
|
|
}
|
|
}
|
|
project {
|
|
natures = ['org.eclipse.buildship.core.gradleprojectnature',
|
|
'org.eclipse.jdt.core.javanature',
|
|
'org.eclipse.wst.common.project.facet.core.nature',
|
|
'org.eclipse.wst.common.modulecore.ModuleCoreNature',
|
|
'org.eclipse.jem.workbench.JavaEMFNature']
|
|
buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
|
|
buildCommand 'org.eclipse.wst.validation.validationbuilder'
|
|
buildCommand 'org.eclipse.wst.common.project.facet.core.builder'
|
|
buildCommand 'org.eclipse.jdt.core.javabuilder'
|
|
}
|
|
}
|