From 084969182869403f7aa5327dced72d7bc5fe3888 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 30 Sep 2024 11:19:55 +0800 Subject: [PATCH] Fixes incorrect environment variable definition in SASL integration doc --- .github/workflows/graalvm.yml | 3 +-- .../configuration/external-integration/sasl.cn.md | 4 ++-- .../configuration/external-integration/sasl.en.md | 5 ++--- pom.xml | 2 +- test/native/pom.xml | 6 +++--- .../elasticjob/test/natived/TestMain.java | 3 +++ .../elasticjob/test/natived/it/operation/JavaTest.java | 10 ++++++++-- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index f57cd810d..3e3a79859 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -44,6 +44,5 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' native-image-job-reports: 'true' - - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} - continue-on-error: true + - name: Run nativeTest with GraalVM CE for ${{ matrix.java }} run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/docs/content/user-manual/configuration/external-integration/sasl.cn.md b/docs/content/user-manual/configuration/external-integration/sasl.cn.md index 74929efe4..5be5529de 100644 --- a/docs/content/user-manual/configuration/external-integration/sasl.cn.md +++ b/docs/content/user-manual/configuration/external-integration/sasl.cn.md @@ -21,7 +21,7 @@ services: - ./jaas-server-test.conf:/jaas-test.conf environment: JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf" - ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" + ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" ports: - "2181:2181" ``` @@ -100,4 +100,4 @@ public class ExampleUtils { 要使 ElasticJob 的 `org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter` 连接至开启 Kerberos 鉴权的 Zookeeper Server, 流程类似于 DIGEST-MD5。以 https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication 为准。 -部分地区可能不被允许使用 MIT Kerberos 的源代码或二进制产物,可参考 MIT Kerberos 的分发站点 https://web.mit.edu/kerberos/dist/index.html 。 +Kerberos KDC 不存在可用的 Docker Image,用户可能需要手动启动 Kerberos KDC。 diff --git a/docs/content/user-manual/configuration/external-integration/sasl.en.md b/docs/content/user-manual/configuration/external-integration/sasl.en.md index f77ad37b4..288d39d14 100644 --- a/docs/content/user-manual/configuration/external-integration/sasl.en.md +++ b/docs/content/user-manual/configuration/external-integration/sasl.en.md @@ -23,7 +23,7 @@ services: - ./jaas-server-test.conf:/jaas-test.conf environment: JVMFLAGS: "-Djava.security.auth.login.config=/jaas-test.conf" - ZOO_CFG_EXTRA: "org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" + ZOO_CFG_EXTRA: "authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider sessionRequireClientSASLAuth=true" ports: - "2181:2181" ``` @@ -109,5 +109,4 @@ To connect ElasticJob's `org.apache.shardingsphere.elasticjob.reg.zookeeper.Zook the process is similar to DIGEST-MD5. Refer to https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication . -Some regions may not allow the use of MIT Kerberos source code or binary products. -Please refer to the MIT Kerberos distribution site https://web.mit.edu/kerberos/dist/index.html . +There is no available Docker Image for Kerberos KDC. Users may need to start Kerberos KDC manually. diff --git a/pom.xml b/pom.xml index 9231ff2dc..399162a31 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ 3.4 1.10 - 0.10.2 + 0.10.3 diff --git a/test/native/pom.xml b/test/native/pom.xml index d031f4f76..805c2ea15 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -29,9 +29,9 @@ true - 3.3.2 - 2.0.13 - 1.5.6 + 3.3.4 + 2.0.16 + 1.5.8 diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java index b70478796..efc11187c 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java @@ -20,6 +20,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +/** + * Spring Boot Web Server for testing only. + */ @SpringBootApplication public class TestMain { diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java index 72305f2af..1ea2421c7 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java @@ -91,9 +91,9 @@ static void beforeAll() throws Exception { client.start(); Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected); } - firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java")); firstRegCenter.init(); - secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-operation-java")); secondRegCenter.init(); HikariConfig config = new HikariConfig(); config.setDriverClassName("org.h2.Driver"); @@ -114,6 +114,7 @@ static void afterAll() throws IOException { * TODO Executing {@link JobConfigurationAPI#removeJobConfiguration(String)} will always cause the listener * to throw an exception similar to {@code Caused by: java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]} . * This is not acceptable behavior. + * The logic inside {@link org.junit.jupiter.api.Assertions#assertDoesNotThrow(Executable)} should be removed. */ @Test void testJobConfigurationAPI() { @@ -141,6 +142,11 @@ void testJobConfigurationAPI() { JobConfigurationPOJO newTestJavaSimpleJob = jobConfigAPI.getJobConfiguration(jobName); assertThat(newTestJavaSimpleJob, notNullValue()); assertThat(newTestJavaSimpleJob.getCron(), is("0/10 * * * * ?")); + assertDoesNotThrow(() -> { + List ipList = secondRegCenter.getChildrenKeys("/" + jobName + "/servers"); + assertThat(ipList.size(), is(1)); + secondRegCenter.remove("/" + jobName + "/servers/" + ipList.get(0)); + }); jobConfigAPI.removeJobConfiguration(jobName); assertThat(jobConfigAPI.getJobConfiguration(jobName), nullValue()); job.shutdown();