Skip to content

Commit 37be6cd

Browse files
authored
test(cluster-test): bump ct to version 1.7.0 (#2921)
1 parent a93cc21 commit 37be6cd

File tree

15 files changed

+681
-368
lines changed

15 files changed

+681
-368
lines changed

hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Licensed to the Apache Software Foundation (ASF) under one or more
4-
~ contributor license agreements. See the NOTICE file distributed with
5-
~ this work for additional information regarding copyright ownership.
6-
~ The ASF licenses this file to You under the Apache License, Version 2.0
7-
~ (the "License"); you may not use this file except in compliance with
8-
~ the License. You may obtain a copy of the License at
9-
~
10-
~ http://www.apache.org/licenses/LICENSE-2.0
11-
~
12-
~ Unless required by applicable law or agreed to in writing, software
13-
~ distributed under the License is distributed on an "AS IS" BASIS,
14-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
~ See the License for the specific language governing permissions and
16-
~ limitations under the License.
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
1717
-->
1818

1919
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

hugegraph-cluster-test/hugegraph-clustertest-dist/src/assembly/descriptor/assembly.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<!--
2-
~ Licensed to the Apache Software Foundation (ASF) under one or more
3-
~ contributor license agreements. See the NOTICE file distributed with
4-
~ this work for additional information regarding copyright ownership.
5-
~ The ASF licenses this file to You under the Apache License, Version 2.0
6-
~ (the "License"); you may not use this file except in compliance with
7-
~ the License. You may obtain a copy of the License at
8-
~
9-
~ http://www.apache.org/licenses/LICENSE-2.0
10-
~
11-
~ Unless required by applicable law or agreed to in writing, software
12-
~ distributed under the License is distributed on an "AS IS" BASIS,
13-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
~ See the License for the specific language governing permissions and
15-
~ limitations under the License.
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
1616
-->
1717

1818
<assembly>

hugegraph-cluster-test/hugegraph-clustertest-dist/src/assembly/static/conf/hugegraph.properties.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#
1717

1818
# gremlin entrance to create graph
19-
# auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy
20-
gremlin.graph=org.apache.hugegraph.HugeFactory
19+
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy
2120

2221
# cache config
2322
#schema.cache_capacity=100000

hugegraph-cluster-test/hugegraph-clustertest-dist/src/assembly/static/conf/rest-server.properties.template

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ arthas.ip=127.0.0.1
3434
arthas.disabled_commands=jad
3535

3636
# authentication configs
37-
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
38-
#auth.authenticator=
39-
# for admin password, By default, it is pa and takes effect upon the first startup
40-
#auth.admin_pa=pa
37+
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
38+
# 'org.apache.hugegraph.auth.ConfigAuthenticator'
39+
auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator
40+
# true if using hstore mode
41+
usePD=true
42+
43+
# default password
44+
auth.admin_pa=pa
4145

4246
# for StandardAuthenticator mode
4347
#auth.graph_store=hugegraph

hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Licensed to the Apache Software Foundation (ASF) under one or more
4-
~ contributor license agreements. See the NOTICE file distributed with
5-
~ this work for additional information regarding copyright ownership.
6-
~ The ASF licenses this file to You under the Apache License, Version 2.0
7-
~ (the "License"); you may not use this file except in compliance with
8-
~ the License. You may obtain a copy of the License at
9-
~
10-
~ http://www.apache.org/licenses/LICENSE-2.0
11-
~
12-
~ Unless required by applicable law or agreed to in writing, software
13-
~ distributed under the License is distributed on an "AS IS" BASIS,
14-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
~ See the License for the specific language governing permissions and
16-
~ limitations under the License.
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
1717
-->
1818

1919
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -33,7 +33,6 @@
3333
<maven.compiler.source>11</maven.compiler.source>
3434
<maven.compiler.target>11</maven.compiler.target>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<log4j2.version>2.17.0</log4j2.version>
3736
</properties>
3837

3938
<dependencies>

hugegraph-cluster-test/hugegraph-clustertest-minicluster/src/main/java/org/apache/hugegraph/ct/node/ServerNodeWrapper.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,21 @@
3434
import static org.apache.hugegraph.ct.base.ClusterConstant.SERVER_TEMPLATE_PATH;
3535
import static org.apache.hugegraph.ct.base.ClusterConstant.isJava11OrHigher;
3636

37+
import java.io.BufferedReader;
3738
import java.io.File;
3839
import java.io.IOException;
40+
import java.io.InputStream;
41+
import java.io.InputStreamReader;
42+
import java.nio.charset.StandardCharsets;
3943
import java.nio.file.Paths;
4044
import java.util.ArrayList;
4145
import java.util.Arrays;
46+
import java.util.Collections;
4247
import java.util.List;
4348

4449
public class ServerNodeWrapper extends AbstractNodeWrapper {
4550

51+
private static List<String> hgJars = loadHgJarsOnce();
4652
public ServerNodeWrapper(int clusterIndex, int index) {
4753
super(clusterIndex, index);
4854
this.fileNames = new ArrayList<>(
@@ -67,6 +73,38 @@ private static void addJarsToClasspath(File directory, List<String> classpath) {
6773
}
6874
}
6975

76+
private static void addOrderedJarsToClasspath(File directory, List<String> classpath) {
77+
// Add jar starts with hugegraph in proper order
78+
String path = directory.getAbsolutePath();
79+
for (String jar : hgJars) {
80+
classpath.add(path + File.separator + jar);
81+
}
82+
if (directory.exists() && directory.isDirectory()) {
83+
File[] files =
84+
directory.listFiles((dir, name) -> name.endsWith(".jar") && !name.contains(
85+
"hugegraph"));
86+
if (files != null) {
87+
for (File file : files) {
88+
classpath.add(file.getAbsolutePath());
89+
}
90+
}
91+
}
92+
}
93+
94+
private static List<String> loadHgJarsOnce(){
95+
ArrayList<String> jars = new ArrayList<>();
96+
try (InputStream is = ServerNodeWrapper.class.getResourceAsStream("/jar.txt");
97+
BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
98+
String line;
99+
while ((line = reader.readLine()) != null) {
100+
jars.add(line);
101+
}
102+
} catch (IOException e) {
103+
e.printStackTrace();
104+
}
105+
return Collections.unmodifiableList(jars);
106+
}
107+
70108
@Override
71109
public void start() {
72110
try {
@@ -79,14 +117,16 @@ public void start() {
79117
}
80118

81119
List<String> classpath = new ArrayList<>();
82-
addJarsToClasspath(new File(workPath + LIB_DIR), classpath);
120+
addOrderedJarsToClasspath(new File(workPath + LIB_DIR), classpath);
83121
addJarsToClasspath(new File(workPath + EXT_DIR), classpath);
84122
addJarsToClasspath(new File(workPath + PLUGINS_DIR), classpath);
85123
String storeClassPath = String.join(":", classpath);
86124

87125
startCmd.addAll(Arrays.asList(
88126
"-Dname=HugeGraphServer" + this.index,
89127
"--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED",
128+
"--add-modules=jdk.unsupported",
129+
"--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
90130
"-cp", storeClassPath,
91131
"org.apache.hugegraph.dist.HugeGraphServer",
92132
"./conf/gremlin-server.yaml",

hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Licensed to the Apache Software Foundation (ASF) under one or more
4-
~ contributor license agreements. See the NOTICE file distributed with
5-
~ this work for additional information regarding copyright ownership.
6-
~ The ASF licenses this file to You under the Apache License, Version 2.0
7-
~ (the "License"); you may not use this file except in compliance with
8-
~ the License. You may obtain a copy of the License at
9-
~
10-
~ http://www.apache.org/licenses/LICENSE-2.0
11-
~
12-
~ Unless required by applicable law or agreed to in writing, software
13-
~ distributed under the License is distributed on an "AS IS" BASIS,
14-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
~ See the License for the specific language governing permissions and
16-
~ limitations under the License.
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
1717
-->
1818

1919
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -57,6 +57,23 @@
5757
<version>4.13.2</version>
5858
<scope>compile</scope>
5959
</dependency>
60+
<dependency>
61+
<groupId>jakarta.ws.rs</groupId>
62+
<artifactId>jakarta.ws.rs-api</artifactId>
63+
<version>3.0.0</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.glassfish.jersey.inject</groupId>
67+
<artifactId>jersey-hk2</artifactId>
68+
<version>3.0.3</version>
69+
<scope>test</scope>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.glassfish.jersey.core</groupId>
73+
<artifactId>jersey-client</artifactId>
74+
<version>3.0.3</version>
75+
<scope>compile</scope>
76+
</dependency>
6077
</dependencies>
6178

6279
<build>
@@ -92,6 +109,31 @@
92109
</execution>
93110
</executions>
94111
</plugin>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-resources-plugin</artifactId>
115+
<executions>
116+
<execution>
117+
<id>generate-version</id>
118+
<phase>process-resources</phase>
119+
<goals>
120+
<goal>copy-resources</goal>
121+
</goals>
122+
<configuration>
123+
<outputDirectory>${project.build.directory}/classes</outputDirectory>
124+
<resources>
125+
<resource>
126+
<directory>src/main/resources</directory>
127+
<filtering>true</filtering>
128+
<includes>
129+
<include>jar.txt</include>
130+
</includes>
131+
</resource>
132+
</resources>
133+
</configuration>
134+
</execution>
135+
</executions>
136+
</plugin>
95137
</plugins>
96138
</build>
97139

0 commit comments

Comments
 (0)