diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9ff1d54a..97f5d8021 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: testCoverReport: - description: 'test and Coverage report?' + description: 'test and coverage report?' default: true type: boolean required: false @@ -14,6 +14,15 @@ on: default: false type: boolean required: false + testLoggerLevel: + description: 'test logger level' + default: INFO + type: choice + options: + - DEBUG + - INFO + - WARN + - ERROR deployOssrh: description: 'deploy to ossrh?' default: true @@ -29,7 +38,7 @@ jobs: env: MAVEN_OPTS: -Xmx2g LOG_LEVEL: ${{ inputs.testLoggerLevel }} - WINGS_HOME: ${{ github.workspace }} + TEST_VERBOSE: ${{ inputs.testLoggerLevel == 'DEBUG' }} steps: - name: Checkout ${{github.event.release.tag_name}} @@ -92,20 +101,18 @@ jobs: ## report if not release - name: Test Coverage ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }} if: inputs.testCoverReport - run: > - mvn - -P 'test,!example' - --quiet - -Duser.timezone=Asia/Shanghai - -Dmaven.test.failure.ignore=${{ inputs.testFailureIgnore }} - -DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }} - clean test jacoco:report coveralls:report + run: | + mvn -P 'test,!example' -Dmaven.test.failure.ignore=${{ inputs.testFailureIgnore }} clean test + mvn -pl ':devs-coverage' -am jacoco:report-aggregate + mvn -pl ':devs-coverage' -DrepoToken=$COVERALLS_WINGS verify env: + TZ: Asia/Shanghai JAVA_HOME: ${{ steps.settings.outputs.JAVA_HOME }} MAIL_USER: ${{ secrets.MAIL_USER }} MAIL_PASS: ${{ secrets.MAIL_PASS }} MAIL_FROM: ${{ secrets.MAIL_FROM }} MAIL_TO: ${{ secrets.MAIL_TO }} + COVERALLS_WINGS: ${{ secrets.COVERALLS_REPO_TOKEN }} ## import gpp private key - name: Import GPG key diff --git a/example/winx-admin/src/main/resources/application.properties b/example/winx-admin/src/main/resources/application.properties index 2a7a07139..0d5d07c4c 100644 --- a/example/winx-admin/src/main/resources/application.properties +++ b/example/winx-admin/src/main/resources/application.properties @@ -1,5 +1,4 @@ server.port=8091 spring.application.name=winx-admin -debug=true #logging.level.org.springframework.session.web.http=DEBUG diff --git a/example/winx-admin/src/test/resources/wings-conf/demo-admin.properties b/example/winx-admin/src/test/resources/application.properties similarity index 94% rename from example/winx-admin/src/test/resources/wings-conf/demo-admin.properties rename to example/winx-admin/src/test/resources/application.properties index 9e9b4fd83..f513cb3c3 100644 --- a/example/winx-admin/src/test/resources/wings-conf/demo-admin.properties +++ b/example/winx-admin/src/test/resources/application.properties @@ -1,3 +1,5 @@ +debug=${TEST_VERBOSE:true} + ############## BGN: For testing only, to be removed before release ############## wings.warlock.security.mem-user[winx-admin].user-id=99 wings.warlock.security.mem-user[winx-admin].username=winx-admin@fessional.pro diff --git a/example/winx-admin/src/test/resources/wings-conf/spring-debug.properties b/example/winx-admin/src/test/resources/wings-conf/spring-debug.properties deleted file mode 100644 index c00a61353..000000000 --- a/example/winx-admin/src/test/resources/wings-conf/spring-debug.properties +++ /dev/null @@ -1 +0,0 @@ -debug=true diff --git a/example/winx-api/src/main/resources/application.properties b/example/winx-api/src/main/resources/application.properties index f22183eb2..3ad8043d7 100644 --- a/example/winx-api/src/main/resources/application.properties +++ b/example/winx-api/src/main/resources/application.properties @@ -1,6 +1,7 @@ server.port=8095 spring.application.name=winx-api -debug=true + +debug=${TEST_VERBOSE:true} servicecomb.service.application=servicecomb-demo servicecomb.service.name=winx-api diff --git a/example/winx-common/src/test/resources/application.properties b/example/winx-common/src/test/resources/application.properties index e9eedb6a8..be897d001 100644 --- a/example/winx-common/src/test/resources/application.properties +++ b/example/winx-common/src/test/resources/application.properties @@ -1,2 +1,4 @@ server.port=8092 spring.application.name=winx-common + +debug=${TEST_VERBOSE:true} diff --git a/example/winx-common/src/test/resources/wings-conf/spring-debug.properties b/example/winx-common/src/test/resources/wings-conf/spring-debug.properties deleted file mode 100644 index c00a61353..000000000 --- a/example/winx-common/src/test/resources/wings-conf/spring-debug.properties +++ /dev/null @@ -1 +0,0 @@ -debug=true diff --git a/example/winx-devops/src/main/resources/application.properties b/example/winx-devops/src/main/resources/application.properties index f57403385..3a57abd93 100644 --- a/example/winx-devops/src/main/resources/application.properties +++ b/example/winx-devops/src/main/resources/application.properties @@ -1,7 +1,7 @@ server.port=8093 spring.application.name=winx-devops -#debug=true +#debug=${TEST_VERBOSE:true} ## disable CONDITIONS EVALUATION REPORT logging.level.org.springframework.boot.autoconfigure=INFO #logging.file.name=winx-devops.log diff --git a/example/winx-devops/src/test/java/com/moilioncircle/wings/devops/project/Devops7EnumsDumperTest.java b/example/winx-devops/src/test/java/com/moilioncircle/wings/devops/project/Devops7EnumsDumperTest.java index 393a9c639..cd3d9d34f 100644 --- a/example/winx-devops/src/test/java/com/moilioncircle/wings/devops/project/Devops7EnumsDumperTest.java +++ b/example/winx-devops/src/test/java/com/moilioncircle/wings/devops/project/Devops7EnumsDumperTest.java @@ -1,6 +1,7 @@ package com.moilioncircle.wings.devops.project; import lombok.Setter; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -18,6 +19,7 @@ @SpringBootTest @Disabled("Project: Dump Enums") +@Slf4j public class Devops7EnumsDumperTest { @Setter(onMethod_ = {@Autowired}) @@ -33,7 +35,7 @@ public void dumpCodeEnum() { String grp = e.getKey().getName(); for (Enum enu : e.getValue()) { CodeEnum en = (CodeEnum) enu; - System.out.printf("%s\t%s\t%s\t%s\n", enu.name(), en.getCode(), en.getHint(), grp); + log.info("{}\t{}\t{}\t{}", enu.name(), en.getCode(), en.getHint(), grp); } } } diff --git a/example/winx-devops/src/test/resources/application.properties b/example/winx-devops/src/test/resources/application.properties new file mode 100644 index 000000000..9bc5237e4 --- /dev/null +++ b/example/winx-devops/src/test/resources/application.properties @@ -0,0 +1 @@ +debug=${TEST_VERBOSE:true} diff --git a/example/winx-front/src/test/resources/application.properties b/example/winx-front/src/test/resources/application.properties new file mode 100644 index 000000000..9bc5237e4 --- /dev/null +++ b/example/winx-front/src/test/resources/application.properties @@ -0,0 +1 @@ +debug=${TEST_VERBOSE:true} diff --git a/example/winx-front/src/test/resources/wings-conf/spring-debug.properties b/example/winx-front/src/test/resources/wings-conf/spring-debug.properties deleted file mode 100644 index c00a61353..000000000 --- a/example/winx-front/src/test/resources/wings-conf/spring-debug.properties +++ /dev/null @@ -1 +0,0 @@ -debug=true diff --git a/observe/mirana b/observe/mirana index 5c0d26ebc..72a7c4e79 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit 5c0d26ebc60be04c8854f0a97e9ceaebfa7afbcc +Subproject commit 72a7c4e79d284907534a22ee5babed12f15870e6 diff --git a/pom.xml b/pom.xml index 63de07d0c..2c89910d2 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,8 @@ 3.2.1 ${revision} + + ${highest-basedir} 21 @@ -66,6 +68,7 @@ 1.2.20 1.5.0 + 1.0 3.1.0 1.6.13 4.3.0 @@ -519,6 +522,10 @@ org.codehaus.mojo flatten-maven-plugin + + org.commonjava.maven.plugins + directory-maven-plugin + @@ -526,6 +533,11 @@ org.apache.maven.plugins maven-surefire-plugin ${maven-surefire-plugin.version} + + + ${wings.rootdir} + + org.apache.maven.plugins @@ -618,6 +630,96 @@ + + + org.projectlombok + lombok-maven-plugin + ${lombok-maven-plugin.version} + + false + ${source.srcMainJava} + ${source.srcMainDelombok} + + + + generate-sources + + delombok + + + + + + org.projectlombok + lombok + ${lombok.version} + + + + + + org.jetbrains.dokka + dokka-maven-plugin + ${dokka-maven-plugin.version} + + + ${source.srcMainDelombok} + ${source.srcMainKotlin} + + + + + prepare-package + + javadocJar + + + + + + + org.eluder.coveralls + coveralls-maven-plugin + ${coveralls-maven-plugin.version} + + + javax.xml.bind + jaxb-api + 2.3.1 + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + @@ -694,6 +796,23 @@ + + org.commonjava.maven.plugins + directory-maven-plugin + ${directory-maven-plugin.version} + + + directories + + highest-basedir + + initialize + + highest-basedir + + + + org.jetbrains.kotlin @@ -717,19 +836,6 @@ - - org.jetbrains.dokka - dokka-maven-plugin - ${dokka-maven-plugin.version} - - - prepare-package - - javadocJar - - - - io.github.git-commit-id @@ -907,30 +1013,11 @@ - - org.eluder.coveralls - coveralls-maven-plugin - ${coveralls-maven-plugin.version} - - - javax.xml.bind - jaxb-api - 2.3.1 - - - org.jacoco jacoco-maven-plugin - ${jacoco-maven-plugin.version} - **/moilioncircle/** - **/codegen/** - **/autogen/** - **/jooqgen/** - **/project/** - **/testing/** **/*Const.* **/*Const$* **/*Attribute.* @@ -945,14 +1032,10 @@ **/WhoAmI.* - - - prepare-agent - - prepare-agent - - - + + + org.eluder.coveralls + coveralls-maven-plugin @@ -964,56 +1047,16 @@ org.projectlombok lombok-maven-plugin - ${lombok-maven-plugin.version} - - false - ${source.srcMainJava} - ${source.srcMainDelombok} - - - - generate-sources - - delombok - - - - - - org.projectlombok - lombok - ${lombok.version} - - org.jetbrains.dokka dokka-maven-plugin - - - ${source.srcMainDelombok} - ${source.srcMainKotlin} - - diff --git a/radiant/devs-codegen/src/test/resources/application.properties b/radiant/devs-codegen/src/test/resources/application.properties index 7e476a31c..8d8be138d 100644 --- a/radiant/devs-codegen/src/test/resources/application.properties +++ b/radiant/devs-codegen/src/test/resources/application.properties @@ -1,6 +1,4 @@ -wings.enabled.silencer.scanner=false +spring.application.name=devs-codegen +wings.enabled.silencer.scanner=false wings.faceless.flywave.checker=false - -spring.application.name=wings-codegen -debug=true diff --git a/radiant/devs-coverage/pom.xml b/radiant/devs-coverage/pom.xml new file mode 100644 index 000000000..0f25a3280 --- /dev/null +++ b/radiant/devs-coverage/pom.xml @@ -0,0 +1,184 @@ + + + 4.0.0 + + + pro.fessional.wings + radiant + ${revision} + + + devs-coverage + jar + + Radiant::Devs::Coverage + jacoco and coveralls report + + + + pro.fessional.wings + silencer + ${wings.version} + + + pro.fessional.wings + silencer-curse + ${wings.version} + + + pro.fessional.wings + silencer-jaxb + ${wings.version} + + + pro.fessional.wings + faceless + ${wings.version} + + + pro.fessional.wings + faceless-awesome + ${wings.version} + + + pro.fessional.wings + faceless-flywave + ${wings.version} + + + pro.fessional.wings + faceless-jooq + ${wings.version} + + + pro.fessional.wings + faceless-shard + ${wings.version} + + + pro.fessional.wings + slardar + ${wings.version} + + + pro.fessional.wings + slardar-hazel-caching + ${wings.version} + + + pro.fessional.wings + slardar-hazel-session + ${wings.version} + + + pro.fessional.wings + slardar-sprint + ${wings.version} + + + pro.fessional.wings + slardar-webmvc + ${wings.version} + + + pro.fessional.wings + warlock + ${wings.version} + + + pro.fessional.wings + warlock-awesome + ${wings.version} + + + pro.fessional.wings + warlock-bond + ${wings.version} + + + pro.fessional.wings + warlock-shadow + ${wings.version} + + + pro.fessional.wings + tiny-mail + ${wings.version} + + + pro.fessional.wings + tiny-task + ${wings.version} + + + + + + org.jacoco + jacoco-maven-plugin + + + org.eluder.coveralls + coveralls-maven-plugin + + ${wings.rootdir} + + /jacoco + /jacoco-aggregate + + + ${wings.rootdir}/wings/silencer/src/main/java + ${wings.rootdir}/wings/silencer/target/generated-sources/annotations + ${wings.rootdir}/wings/silencer-curse/src/main/java + ${wings.rootdir}/wings/silencer-curse/target/generated-sources/annotations + ${wings.rootdir}/wings/silencer-jaxb/src/main/java + ${wings.rootdir}/wings/silencer-jaxb/target/generated-sources/annotations + ${wings.rootdir}/wings/faceless/src/main/java + ${wings.rootdir}/wings/faceless/target/generated-sources/annotations + ${wings.rootdir}/wings/faceless-awesome/src/main/java + ${wings.rootdir}/wings/faceless-awesome/target/generated-sources/annotations + ${wings.rootdir}/wings/faceless-flywave/src/main/java + ${wings.rootdir}/wings/faceless-flywave/target/generated-sources/annotations + ${wings.rootdir}/wings/faceless-flywave/src/main/kotlin + ${wings.rootdir}/wings/faceless-jooq/src/main/java + ${wings.rootdir}/wings/faceless-jooq/target/generated-sources/annotations + ${wings.rootdir}/wings/faceless-shard/src/main/java + ${wings.rootdir}/wings/faceless-shard/target/generated-sources/annotations + ${wings.rootdir}/wings/slardar/src/main/java + ${wings.rootdir}/wings/slardar/target/generated-sources/annotations + ${wings.rootdir}/wings/slardar-hazel-caching/src/main/java + ${wings.rootdir}/wings/slardar-hazel-caching/target/generated-sources/annotations + ${wings.rootdir}/wings/slardar-hazel-session/src/main/java + ${wings.rootdir}/wings/slardar-hazel-session/target/generated-sources/annotations + ${wings.rootdir}/wings/slardar-sprint/src/main/java + ${wings.rootdir}/wings/slardar-hazel-session/target/generated-sources/annotations + ${wings.rootdir}/wings/slardar-webmvc/src/main/java + ${wings.rootdir}/wings/slardar-webmvc/target/generated-sources/annotations + ${wings.rootdir}/wings/warlock/src/main/java + ${wings.rootdir}/wings/warlock/target/generated-sources/annotations + ${wings.rootdir}/wings/warlock-awesome/src/main/java + ${wings.rootdir}/wings/warlock-awesome/target/generated-sources/annotations + ${wings.rootdir}/wings/warlock-bond/src/main/java + ${wings.rootdir}/wings/warlock-bond/target/generated-sources/annotations + ${wings.rootdir}/wings/warlock-shadow/src/main/java + ${wings.rootdir}/wings/warlock-shadow/target/generated-sources/annotations + ${wings.rootdir}/radiant/tiny-mail/src/main/java + ${wings.rootdir}/radiant/tiny-mail/target/generated-sources/annotations + ${wings.rootdir}/radiant/tiny-task/src/main/java + ${wings.rootdir}/radiant/tiny-task/target/generated-sources/annotations + + + + + jacoco-coverage + verify + + report + + + + + + + diff --git a/radiant/pom.xml b/radiant/pom.xml index 41ef3b165..f7a024a69 100644 --- a/radiant/pom.xml +++ b/radiant/pom.xml @@ -18,6 +18,7 @@ devs-codegen + devs-coverage devs-mvndeps tiny-autogen tiny-mail diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java index 366af6b78..c9722f12c 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import io.qameta.allure.TmsLink; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.core.io.DefaultResourceLoader; @@ -19,6 +20,7 @@ * @author trydofor * @since 2023-01-08 */ +@Slf4j public class ResourceMapTest { @Test @@ -32,7 +34,7 @@ public void testString() throws IOException { final Resource urlPom = resourceLoader.getResource("file:/pom.xml"); res1.put("pom.xml", urlPom); - Map urls= new LinkedHashMap<>(); + Map urls = new LinkedHashMap<>(); for (Map.Entry en : res1.entrySet()) { urls.put(en.getKey(), CommonPropHelper.toString(en.getValue())); } @@ -45,13 +47,13 @@ public void testString() throws IOException { final JsonNode nodes = objectMapper.readTree(json); final Iterator> it = nodes.fields(); - while (it.hasNext()){ + while (it.hasNext()) { final Map.Entry en = it.next(); res2.put(en.getKey(), resourceLoader.getResource(en.getValue().asText())); } - Assertions.assertEquals(res1,res2); - System.out.println(json); + log.info("json={}", json); + Assertions.assertEquals(res1, res2); } } diff --git a/radiant/tiny-mail/src/test/resources/application.properties b/radiant/tiny-mail/src/test/resources/application.properties index 33965b463..0dfb08897 100644 --- a/radiant/tiny-mail/src/test/resources/application.properties +++ b/radiant/tiny-mail/src/test/resources/application.properties @@ -1,6 +1,6 @@ -spring.application.name=tiny-mail-test server.port=8086 -debug=true +spring.application.name=tiny-mail + wings.enabled.faceless.flywave=true spring.mail.properties.mail.debug=true wings.tiny.mail.sender.force-prefix=DEBUG diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java index a24142e0c..2fc39be6f 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java @@ -18,8 +18,7 @@ * @since 2022-12-13 */ @SpringBootTest(properties = { - "debug=true", - "logging.level.root=DEBUG", + "logging.level.root=DEBUG", // AssertionLogger }) @Slf4j @Disabled("Simulate: batch, check manually") diff --git a/radiant/tiny-task/src/test/resources/application.properties b/radiant/tiny-task/src/test/resources/application.properties index e538f214c..5ac38b8fa 100644 --- a/radiant/tiny-task/src/test/resources/application.properties +++ b/radiant/tiny-task/src/test/resources/application.properties @@ -1,6 +1,5 @@ -spring.application.name=tiny-task-test server.port=8086 -debug=true +spring.application.name=tiny-task wings.enabled.faceless.flywave=true wings.faceless.flywave.auto-init=true diff --git a/wings/batrider-test/src/test/resources/application.properties b/wings/batrider-test/src/test/resources/application.properties index 9b37bcdee..a801f7cde 100644 --- a/wings/batrider-test/src/test/resources/application.properties +++ b/wings/batrider-test/src/test/resources/application.properties @@ -1,6 +1,5 @@ server.port=8085 spring.application.name=batrider-test -debug=true servicecomb.service.application=servicecomb-demo servicecomb.service.name=batrider diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java index c4790d317..521cb19b1 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java @@ -2,6 +2,7 @@ import io.qameta.allure.TmsLink; import lombok.Setter; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.MethodOrderer.MethodName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; @@ -25,6 +26,7 @@ @SpringBootTest @TestMethodOrder(MethodName.class) +@Slf4j public class ConstantEnumI18nTest { @Setter(onMethod_ = {@Autowired}) @@ -70,7 +72,7 @@ public void test4I18n() { public void printAllBean() { int i = 1; for (String bean : applicationContext.getBeanDefinitionNames()) { - System.out.printf("[%d] %s\n", i++, bean); + log.info("[{}] {}", i++, bean); } } } diff --git a/wings/faceless-flywave/src/test/resources/application.properties b/wings/faceless-flywave/src/test/resources/application.properties index ac56d8c4c..ee187b01b 100644 --- a/wings/faceless-flywave/src/test/resources/application.properties +++ b/wings/faceless-flywave/src/test/resources/application.properties @@ -1,6 +1,5 @@ -spring.application.name=wings-faceless server.port=8082 -debug=true +spring.application.name=faceless-flywave wings.enabled.faceless.flywave=true testing.dbname=wings_faceless diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java index 5b76d36a4..3defb44dd 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java @@ -49,8 +49,7 @@ @SpringBootTest(properties = { - "debug=true", - "logging.level.root=DEBUG", + "logging.level.root=DEBUG", // AssertionLogger "wings.faceless.jooq.conf.auto-qualify=true", "wings.faceless.jooq.conf.render-table=ALWAYS", // "wings.faceless.jooq.conf.auto-qualify=false", diff --git a/wings/faceless-jooq/src/test/resources/application.properties b/wings/faceless-jooq/src/test/resources/application.properties index b9735fa15..24522a6af 100644 --- a/wings/faceless-jooq/src/test/resources/application.properties +++ b/wings/faceless-jooq/src/test/resources/application.properties @@ -1,4 +1,4 @@ -spring.application.name=wings-faceless server.port=8082 -debug=true -logging.level.org.jooq.tools.LoggerListener=DEBUG +spring.application.name=faceless-jooq + +logging.level.org.jooq.tools.LoggerListener=${LOG_LEVEL:DEBUG} diff --git a/wings/faceless-shard/src/test/resources/application.properties b/wings/faceless-shard/src/test/resources/application.properties index d46e76a6e..cd4fdf1cd 100644 --- a/wings/faceless-shard/src/test/resources/application.properties +++ b/wings/faceless-shard/src/test/resources/application.properties @@ -1,7 +1,7 @@ -spring.application.name=wings-faceless server.port=8082 -debug=true +spring.application.name=faceless-shard + +logging.level.org.jooq.tools.LoggerListener=${LOG_LEVEL:DEBUG} -logging.level.org.jooq.tools.LoggerListener=DEBUG wings.faceless.flywave.auto-init=false wings.faceless.flywave.checker=false \ No newline at end of file diff --git a/wings/faceless/src/test/resources/application.properties b/wings/faceless/src/test/resources/application.properties index 528c4621d..536051e88 100644 --- a/wings/faceless/src/test/resources/application.properties +++ b/wings/faceless/src/test/resources/application.properties @@ -1,6 +1,5 @@ -spring.application.name=wings-faceless server.port=8082 -debug=true +spring.application.name=faceless wings.test.module=Faceless testing.dbname=wings_faceless diff --git a/wings/silencer-curse/src/main/resources/wings-conf/spring-logging-79.properties b/wings/silencer-curse/src/main/resources/wings-conf/spring-logging-79.properties index 2e88b3101..5fb0b8aa6 100644 --- a/wings/silencer-curse/src/main/resources/wings-conf/spring-logging-79.properties +++ b/wings/silencer-curse/src/main/resources/wings-conf/spring-logging-79.properties @@ -6,7 +6,7 @@ ## org/springframework/boot/logging/logback/file-appender.xml ##This will cause Spring to output the default debug information, which is quieter than logging.level.root=debug -#debug=true +#debug=${TEST_VERBOSE:true} ## uncomment this, no output to the console , only to the `logging.file.name` file #logging.config=classpath:logback-fileonly.xml @@ -17,7 +17,7 @@ logging.logback.rollingpolicy.max-file-size=500MB logging.logback.rollingpolicy.max-history=30 #logging.file.total-size-cap= -logging.level.root=INFO +logging.level.root=${LOG_LEVEL:INFO} #logging.level.org.springframework.web=DEBUG #logging.level.org.jooq=DEBUG diff --git a/wings/silencer-curse/src/test/resources/application.properties b/wings/silencer-curse/src/test/resources/application.properties index 538150b1a..764b6f62f 100644 --- a/wings/silencer-curse/src/test/resources/application.properties +++ b/wings/silencer-curse/src/test/resources/application.properties @@ -1,3 +1,5 @@ -spring.application.name=curse -debug=true +server.port=8081 +spring.application.name=silencer-curse + +debug=${TEST_VERBOSE:true} #wings.enabled.silencer.autoconf=false \ No newline at end of file diff --git a/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java b/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java index 9a3cea988..0119d264c 100644 --- a/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java +++ b/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java @@ -6,6 +6,7 @@ import jakarta.xml.bind.Marshaller; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlRootElement; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import java.io.StringWriter; @@ -17,6 +18,7 @@ * @author trydofor * @since 2019-12-31 */ +@Slf4j public class StringMapXmlWriterTest { @XmlRootElement(name = "xml") @@ -52,8 +54,8 @@ public void map() throws JAXBException { StringMapXmlWriter writer = StringMapXmlWriter.linkMap(); marshallerObj.marshal(xml, writer); Map tree = writer.getResultTree(); - System.out.println(tree); - System.out.println(new TreeMap<>(tree)); + log.info("tree={}", tree); + log.info("TreeMap={}", new TreeMap<>(tree)); } @Test @@ -67,6 +69,6 @@ public void xml() throws JAXBException { TestXml xml = new TestXml(); StringWriter strw = new StringWriter(); marshallerObj.marshal(xml, strw); - System.out.println(strw.toString()); + log.info("xml={}", strw); } } diff --git a/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java index 5e7ebfd9b..ba8f5d36c 100644 --- a/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java +++ b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java @@ -6,15 +6,14 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author trydofor * @since 2023-11-01 */ @SpringBootTest(properties = { - "debug=true", - "logging.level.root=DEBUG", + "logging.level.root=DEBUG", // AssertionLogger }) @Slf4j class AssertionLoggerTest { diff --git a/wings/silencer-test/src/test/resources/application.properties b/wings/silencer-test/src/test/resources/application.properties new file mode 100644 index 000000000..2ef0fec21 --- /dev/null +++ b/wings/silencer-test/src/test/resources/application.properties @@ -0,0 +1 @@ +debug=${TEST_VERBOSE:true} \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java index b68a1b81f..cdf1b07b9 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java @@ -36,11 +36,11 @@ public class WingsSilencerProfile0Test { @TmsLink("C11006") public void profile() { assertEquals("Silencer", module); - assertEquals("wings-silencer", name); + assertEquals("silencer", name); assertEquals("empty", moduleTest); assertEquals("empty", nameTest); assertEquals("empty", moduleDev); assertEquals("empty", nameDev); - assertEquals("wings-silencer-empty", nameEmpty); + assertEquals("silencer-empty", nameEmpty); } } diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java index c4dce946a..55582e5db 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java @@ -38,11 +38,11 @@ public class WingsSilencerProfile1Test { @TmsLink("C11007") public void profile() { assertEquals("Silencer-dev", module); - assertEquals("wings-silencer-dev", name); + assertEquals("silencer-dev", name); assertEquals("Silencer-dev", moduleDev); - assertEquals("wings-silencer-dev", nameDev); + assertEquals("silencer-dev", nameDev); assertEquals("empty", moduleTest); assertEquals("empty", nameTest); - assertEquals("wings-silencer-empty", nameEmpty); + assertEquals("silencer-empty", nameEmpty); } } diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java index bd7fdcdb9..e6be95473 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java @@ -38,11 +38,11 @@ public class WingsSilencerProfile2Test { @TmsLink("C11008") public void profile() { assertEquals("Silencer-test30", moduleTest); - assertEquals("wings-silencer-test", nameTest); + assertEquals("silencer-test", nameTest); assertEquals("Silencer-dev", moduleDev); - assertEquals("wings-silencer-dev", nameDev); - assertEquals("wings-silencer-test", name); // spring Alphabetical order, latter taking precedence + assertEquals("silencer-dev", nameDev); + assertEquals("silencer-test", name); // spring Alphabetical order, latter taking precedence assertEquals("Silencer-test30", module); // Seq override - assertEquals("wings-silencer-empty", nameEmpty); + assertEquals("silencer-empty", nameEmpty); } } diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java index acc9bbfd6..81c9024a3 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java @@ -38,11 +38,11 @@ public class WingsSilencerSpringTest { @TmsLink("C11009") public void profile() { assertEquals("empty", module); - assertEquals("wings-silencer-dev", name); + assertEquals("silencer-dev", name); assertEquals("empty", moduleTest); assertEquals("empty", nameTest); assertEquals("empty", moduleDev); - assertEquals("wings-silencer-dev", nameDev); - assertEquals("wings-silencer-empty", nameEmpty); + assertEquals("silencer-dev", nameDev); + assertEquals("silencer-empty", nameEmpty); } } diff --git a/wings/silencer/src/test/resources/application-dev.properties b/wings/silencer/src/test/resources/application-dev.properties index 3d0fd2d6e..340feb48a 100644 --- a/wings/silencer/src/test/resources/application-dev.properties +++ b/wings/silencer/src/test/resources/application-dev.properties @@ -1,2 +1,2 @@ -spring.application.name=wings-silencer-dev -spring.application.name-dev=wings-silencer-dev +spring.application.name=silencer-dev +spring.application.name-dev=silencer-dev diff --git a/wings/silencer/src/test/resources/application-test.properties b/wings/silencer/src/test/resources/application-test.properties index 5aea6a5ab..088099a23 100644 --- a/wings/silencer/src/test/resources/application-test.properties +++ b/wings/silencer/src/test/resources/application-test.properties @@ -1,2 +1,2 @@ -spring.application.name=wings-silencer-test -spring.application.name-test=wings-silencer-test +spring.application.name=silencer-test +spring.application.name-test=silencer-test diff --git a/wings/silencer/src/test/resources/application.properties b/wings/silencer/src/test/resources/application.properties index ff18b429f..6c898f713 100644 --- a/wings/silencer/src/test/resources/application.properties +++ b/wings/silencer/src/test/resources/application.properties @@ -1,6 +1,6 @@ server.port=8081 -spring.application.name=wings-silencer -spring.application.name-empty=wings-silencer-empty -debug=true -#wings.enabled.silencer.scanner=true -logging.level.org.springframework=DEBUG \ No newline at end of file +spring.application.name=silencer +spring.application.name-empty=silencer-empty + +debug=${TEST_VERBOSE:true} +logging.level.org.springframework=${LOG_LEVEL:DEBUG} \ No newline at end of file diff --git a/wings/silencer/src/test/resources/wings-conf/application-30@test.properties b/wings/silencer/src/test/resources/wings-conf/application-30@test.properties index 337c7a478..c28a44753 100644 --- a/wings/silencer/src/test/resources/wings-conf/application-30@test.properties +++ b/wings/silencer/src/test/resources/wings-conf/application-30@test.properties @@ -1,3 +1,3 @@ ## wings scan, wings handle, profile test, equal application-test.properties, seq is 30 -spring.application.name=wings-silencer-wings-test30 -spring.application.name-test=wings-silencer-wings-test30 +spring.application.name=silencer-wings-test30 +spring.application.name-test=silencer-wings-test30 diff --git a/wings/silencer/src/test/resources/wings-conf/application-test.properties b/wings/silencer/src/test/resources/wings-conf/application-test.properties index 6276a35dc..a1bb2a5fa 100644 --- a/wings/silencer/src/test/resources/wings-conf/application-test.properties +++ b/wings/silencer/src/test/resources/wings-conf/application-test.properties @@ -1,3 +1,3 @@ ## wings scan, spring handle, profile test, equal application-test.properties, low priority -spring.application.name=wings-silencer-wings-test -spring.application.name-test=wings-silencer-wings-test +spring.application.name=silencer-wings-test +spring.application.name-test=silencer-wings-test diff --git a/wings/silencer/src/test/resources/wings-conf/application.properties b/wings/silencer/src/test/resources/wings-conf/application.properties index 969b202d7..39955582b 100644 --- a/wings/silencer/src/test/resources/wings-conf/application.properties +++ b/wings/silencer/src/test/resources/wings-conf/application.properties @@ -1,2 +1,2 @@ ## wings scan, spring handle, low priority then spring -spring.application.name=wings-silencer-wings +spring.application.name=silencer-wings diff --git a/wings/silencer/src/test/resources/wings-conf/application@test.properties b/wings/silencer/src/test/resources/wings-conf/application@test.properties index 58dea234c..1ac27c55b 100644 --- a/wings/silencer/src/test/resources/wings-conf/application@test.properties +++ b/wings/silencer/src/test/resources/wings-conf/application@test.properties @@ -1,3 +1,3 @@ ## wings scan, wings handle, profile test, equal application-test.properties, low priority -spring.application.name=wings-silencer-wings-test70 -spring.application.name-test=wings-silencer-wings-test70 +spring.application.name=silencer-wings-test70 +spring.application.name-test=silencer-wings-test70 diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java index 17f337af3..34f05e7cc 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.app.service; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; @@ -8,6 +9,9 @@ import pro.fessional.wings.slardar.app.event.TestApplicationEvent; import pro.fessional.wings.slardar.app.event.TestEvent; +import java.util.HashMap; +import java.util.Map; + /** * @author trydofor * @since 2021-06-09 @@ -16,17 +20,19 @@ @Slf4j public class TestEventListener { + @Getter + private Map events = new HashMap<>(); @EventListener public void syncListen(TestEvent event) { log.info("sync-listen:{}:{}", Thread.currentThread().getName(), event.getMessage()); - throw new DebugException("sync-listen"); + events.put(event.getMessage(),event); } @Async @EventListener public void asyncListen(TestEvent event) { log.info("async-listen:{}:{}", Thread.currentThread().getName(), event.getMessage()); - throw new DebugException("async-listen"); + events.put(event.getMessage(),event); } @EventListener diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java index fef497d0b..d682ae8a6 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java @@ -1,16 +1,21 @@ package pro.fessional.wings.slardar.event; import io.qameta.allure.TmsLink; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.mirana.best.TypedReg; import pro.fessional.mirana.time.Sleep; import pro.fessional.wings.slardar.app.event.TestEvent; +import pro.fessional.wings.slardar.app.service.TestEventListener; import pro.fessional.wings.slardar.context.AttributeHolder; import pro.fessional.wings.slardar.event.attr.AttributeRidEvent; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * @author trydofor * @since 2021-06-09 @@ -19,28 +24,36 @@ @Slf4j public class EventPublishHelperTest { + @Setter(onMethod_ = {@Autowired}) + protected TestEventListener testEventListener; + @Test @TmsLink("C13019") public void testSyncSpring() { - try { - EventPublishHelper.SyncSpring.publishEvent(new TestEvent("SyncSpring")); - Assertions.fail(); - } - catch (Exception e) { - log.warn("caught", e); - } + String msg = "SyncSpring"; + EventPublishHelper.SyncSpring.publishEvent(new TestEvent(msg)); + TestEvent ent = testEventListener.getEvents().get(msg); + assertEquals(msg, ent.getMessage()); } @Test @TmsLink("C13020") public void testAsyncSpring() { - EventPublishHelper.AsyncSpring.publishEvent(new TestEvent("AsyncSpring")); + String msg = "AsyncSpring"; + EventPublishHelper.AsyncSpring.publishEvent(new TestEvent(msg)); + Sleep.ignoreInterrupt(1000); + TestEvent ent = testEventListener.getEvents().get(msg); + assertEquals(msg, ent.getMessage()); } @Test @TmsLink("C13021") public void testAsyncGlobal() { - EventPublishHelper.AsyncGlobal.publishEvent(new TestEvent("AsyncHazelcast")); + String msg = "AsyncHazelcast"; + EventPublishHelper.AsyncGlobal.publishEvent(new TestEvent(msg)); + Sleep.ignoreInterrupt(1000); + TestEvent ent = testEventListener.getEvents().get(msg); + assertEquals(msg, ent.getMessage()); } private final TypedReg Test1 = new TypedReg<>() {}; @@ -49,7 +62,7 @@ public void testAsyncGlobal() { @TmsLink("C13118") public void testAttributeRidEvent() { AttributeHolder.putAttr(Test1, 1, "1"); - Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1)); + assertEquals("1", AttributeHolder.getAttr(Test1, 1)); AttributeRidEvent event = new AttributeRidEvent(); event.rid(Test1, 1); EventPublishHelper.AsyncGlobal.publishEvent(event); @@ -58,7 +71,7 @@ public void testAttributeRidEvent() { // AttributeHolder.putAttr(Test1, 1, "1"); - Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1)); + assertEquals("1", AttributeHolder.getAttr(Test1, 1)); // unregister, no listener affect AttributeHolder.unregister(Test1); @@ -67,6 +80,6 @@ public void testAttributeRidEvent() { event2.rid(Test1, 1); EventPublishHelper.AsyncGlobal.publishEvent(event2); Sleep.ignoreInterrupt(1000); - Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1)); + assertEquals("1", AttributeHolder.getAttr(Test1, 1)); } } diff --git a/wings/slardar-sprint/src/test/resources/application.properties b/wings/slardar-sprint/src/test/resources/application.properties index f56b3239c..755e4bfc8 100644 --- a/wings/slardar-sprint/src/test/resources/application.properties +++ b/wings/slardar-sprint/src/test/resources/application.properties @@ -1,9 +1,5 @@ server.port=8083 - -spring.application.name=test-slardar - -debug=true -logging.level.pro.fessional=DEBUG +spring.application.name=slardar-sprint #wings.slardar.monitor.cron=- #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java index fc1dceb4c..2c3b03344 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java @@ -5,6 +5,7 @@ import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.Request; @@ -35,6 +36,7 @@ * @since 2020-06-03 */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@Slf4j public class RetrofitTest { @Setter(onMethod_ = {@Value("http://localhost:${local.server.port}")}) @@ -110,21 +112,21 @@ public void printFastjsonAndJackson() { bad.setSsStr("ssStr"); bad.setSStr("sStr"); final String j1 = JSON.toJSONString(bad, FastJsonHelper.DefaultWriter()); - System.out.println("fastjson:" + j1); + log.info("fastjson:{}", j1); final String j2 = objectMapper.writeValueAsString(bad); - System.out.println("jackson:" + j2); + log.info("jackson:{}", j2); // final Bad o1 = JSON.parseObject(j1, Bad.class, FastJsonHelper.DefaultReader()); - System.out.println("fastjson-fastjson:" + o1); + log.info("fastjson-fastjson:{}", o1); final Bad o2 = objectMapper.readValue(j1, Bad.class); - System.out.println("fastjson-jackson:" + o2); + log.info("fastjson-jackson:{}", o2); final Bad o3 = JSON.parseObject(j2, Bad.class, FastJsonHelper.DefaultReader()); - System.out.println("jackson-fastjson:" + o3); + log.info("jackson-fastjson:{}", o3); final Bad o4 = objectMapper.readValue(j2, Bad.class); - System.out.println("jackson-jackson:" + o4); + log.info("jackson-jackson:{}", o4); } } diff --git a/wings/slardar-webmvc/src/test/resources/application.properties b/wings/slardar-webmvc/src/test/resources/application.properties index 6513444a9..4683a49ee 100644 --- a/wings/slardar-webmvc/src/test/resources/application.properties +++ b/wings/slardar-webmvc/src/test/resources/application.properties @@ -1,9 +1,5 @@ server.port=8083 -## -spring.application.name=test-slardar - -debug=true -logging.level.pro.fessional=DEBUG +spring.application.name=slardar-webmvc #wings.slardar.monitor.cron=- #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java index f39fa2315..246e75d2f 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java @@ -34,7 +34,7 @@ public void testSolo() { Assertions.assertEquals(Integer.class, Solos.PasssaltByUid.keyType); Assertions.assertEquals(String.class, Solos.PasssaltByUid.valType); - System.out.println(">>>" + Solos.PasssaltByUid.regType.getName().substring(Solos.PasssaltByUid.regType.getPackageName().length() + 1)); + log.info(">>>{}", Solos.PasssaltByUid.regType.getName().substring(Solos.PasssaltByUid.regType.getPackageName().length() + 1)); } TypedReg Expiry = new TypedReg<>() {}; diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java index 56df9196f..bfc3e23c7 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.context; import io.qameta.allure.TmsLink; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -21,6 +22,7 @@ @SpringBootTest(properties = { "wings.silencer.tweak.clock-offset = " + NowTest.Offset, "wings.silencer.i18n.zoneid=" + NowTest.Cn}) +@Slf4j class NowTest { public static final String Cn = "Asia/Shanghai"; @@ -32,7 +34,7 @@ void initClock() { long sysMs = System.currentTimeMillis(); long nowMs = Now.millis(); long ofs = nowMs - sysMs; - System.out.println("offset=" + ofs); + log.info("offset={}", ofs); Assertions.assertTrue(ofs >= Offset); } @@ -51,13 +53,13 @@ void clientClock() { ZonedDateTime szd = Now.zonedDateTime(); ZonedDateTime czd = Now.clientZonedDateTime(); - System.out.println("Asia/Shanghai szd=" + szd); - System.out.println("Asia/Tokyo czd=" + czd); + log.info("Asia/Shanghai szd={}", szd); + log.info("Asia/Tokyo czd={}", czd); final LocalDateTime sld = szd.toLocalDateTime(); final LocalDateTime cld = czd.toLocalDateTime(); final Duration dur = Duration.between(sld, cld); - System.out.println("PT1H dur=" + dur); + log.info("PT1H dur={}", dur); Assertions.assertEquals(jp, czd.getZone()); Assertions.assertEquals(ZoneId.of(Cn), szd.getZone()); diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java index e94c3cfc7..a147d243f 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.datatime; import io.qameta.allure.TmsLink; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -13,6 +14,7 @@ * @author trydofor * @since 2021-05-18 */ +@Slf4j public class SmartFormatterTest { @Test @@ -20,7 +22,7 @@ public class SmartFormatterTest { public void print() { LocalDateTime d = LocalDateTime.of(2021, 1, 2, 3, 0, 0, 0); DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy[-MM][-dd][ ][HH][:mm][:ss][ ][VV]"); - System.out.println(d.format(df)); + log.info("format={}",d.format(df)); } @Test diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java index c6de7ae52..8c2ad2284 100644 --- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java +++ b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java @@ -33,8 +33,7 @@ * @since 2022-03-09 */ @SpringBootTest(properties = { - "debug=true", - "logging.level.root=DEBUG", + "logging.level.root=DEBUG", // AssertionLogger "wings.faceless.jooq.cud.table[win_conf_runtime]=key,current,handler", }) @DependsOnDatabaseInitialization diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java index 751bfc287..6e33e80af 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java @@ -16,8 +16,7 @@ */ @Slf4j @SpringBootTest(properties = { - "debug=true", - "logging.level.root=DEBUG", + "logging.level.root=DEBUG", // AssertionLogger }) @DependsOnDatabaseInitialization class WarlockPermCacheTest { diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java index 0ea39fa8a..2b6c6cf2a 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java @@ -15,7 +15,7 @@ * @author trydofor * @since 2023-07-03 */ -@SpringBootTest(properties = {"logging.level.root=debug"}) +@SpringBootTest @DependsOnDatabaseInitialization class WarlockPermServiceTest { diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java index 2dcac7d53..00682a9ad 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java @@ -17,7 +17,7 @@ */ @SpringBootTest(properties = { "wings.faceless.jooq.cud.table[win_role_entry]=-", - "logging.level.root=debug"}) +}) @DependsOnDatabaseInitialization class WarlockRoleServiceTest { @@ -31,7 +31,7 @@ void loadRoleAll() { final Map a2 = warlockRoleService.loadRoleAll(); Assertions.assertSame(a1, a2); - warlockRoleService.modify(1,"super user"); + warlockRoleService.modify(1, "super user"); Sleep.ignoreInterrupt(2_000); final Map a3 = warlockRoleService.loadRoleAll(); diff --git a/wings/warlock-bond/src/test/resources/application.properties b/wings/warlock-bond/src/test/resources/application.properties index 19e0b3c8c..4ac26d038 100644 --- a/wings/warlock-bond/src/test/resources/application.properties +++ b/wings/warlock-bond/src/test/resources/application.properties @@ -1,2 +1 @@ -logging.level.org.springframework.web=DEBUG -logging.level.root=DEBUG +logging.level.org.springframework.web=${LOG_LEVEL:DEBUG} diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java index a27a99e61..f258aba95 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java @@ -93,7 +93,7 @@ private void testObj(Object obj, String... acc) throws JsonProcessingException { break; } } - System.out.printf("fastjson=[%s], jackson=[%s]\n", ft, jk); + log.info("fastjson=[{}], jackson=[{}]", ft, jk); Assertions.assertTrue(ok, String.join(",", acc)); } diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java index eff7f3c98..104263fd9 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.warlock.service.auth; import io.qameta.allure.TmsLink; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import pro.fessional.wings.warlock.service.auth.WarlockTicketService.SimpleTerm; @@ -10,6 +11,7 @@ * @author trydofor * @since 2022-11-08 */ +@Slf4j class WarlockTicketServiceTest { @Test @@ -18,7 +20,7 @@ public void testTerm() { Term t0 = new SimpleTerm(); t0.setUserId(10086L); final String s0 = Term.encode(t0); - System.out.println(s0); + log.info("s0={}", s0); final SimpleTerm st0 = new SimpleTerm(); Assertions.assertTrue(st0.decode(s0)); Assertions.assertEquals(t0, st0); @@ -27,7 +29,7 @@ public void testTerm() { t1.setUserId(10086L); t1.setType(Term.TypeAuthorizeCode); final String s1 = Term.encode(t1); - System.out.println(s1); + log.info("s1={}", s1); final SimpleTerm st1 = new SimpleTerm(); Assertions.assertTrue(st1.decode(s1)); Assertions.assertEquals(t1, st1); @@ -36,7 +38,7 @@ public void testTerm() { t2.setUserId(10086L); t2.setType(Term.TypeAccessToken); final String s2 = Term.encode(t2); - System.out.println(s2); + log.info("s2={}", s2); final SimpleTerm st2 = new SimpleTerm(); Assertions.assertTrue(st2.decode(s2)); Assertions.assertEquals(t2, st2); @@ -46,7 +48,7 @@ public void testTerm() { t3.setType(Term.TypeAccessToken); t3.setScopes("a b c"); final String s3 = Term.encode(t3); - System.out.println(s3); + log.info("s3={}", s3); final SimpleTerm st3 = new SimpleTerm(); Assertions.assertTrue(st3.decode(s3)); Assertions.assertEquals(t3, st3); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java index 46eeee368..5f825374d 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java @@ -20,7 +20,7 @@ */ @SpringBootTest(properties = { "debug=false", - "logging.level.root=WARN" + "logging.level.root=WARN" // quiet }) @Slf4j @Disabled("Benchmark: light id provider") diff --git a/wings/warlock-shadow/src/test/resources/application.properties b/wings/warlock-shadow/src/test/resources/application.properties index 06b35104b..191df2805 100644 --- a/wings/warlock-shadow/src/test/resources/application.properties +++ b/wings/warlock-shadow/src/test/resources/application.properties @@ -1,11 +1,8 @@ -spring.wings.warlock.enabled.controller-debug=true wings.warlock.security.permit-all[admin-debug]=/admin/debug/** wings.warlock.ticket.client[wings-trydofor].user-id=79 wings.warlock.ticket.client[wings-trydofor].secret=wings-trydofor-secret wings.warlock.ticket.client[wings-trydofor].hosts=localhost wings.warlock.ticket.client[wings-trydofor].scopes=api1, api2 -logging.level.org.springframework.web=DEBUG -logging.level.root=DEBUG wings.enabled.warlock.dummy-service=true \ No newline at end of file diff --git a/wings/warlock-test/src/main/resources/application.properties b/wings/warlock-test/src/main/resources/application.properties index ad86b7111..050e98a29 100644 --- a/wings/warlock-test/src/main/resources/application.properties +++ b/wings/warlock-test/src/main/resources/application.properties @@ -1,7 +1,5 @@ server.port=8084 -spring.application.name=wings-warlock -debug=true -#logging.level.root=debug +spring.application.name=warlock-test wings.warlock.security.authority[ROLE_ADMIN]=/admin/** wings.warlock.security.authenticated[user]=/user/**