Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
225 lines (209 loc) · 9.68 KB
/
Copy pathpom.xml
File metadata and controls
225 lines (209 loc) · 9.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.zorcc</groupId>
<artifactId>tenet</artifactId>
<version>0.0.1</version>
<modules>
<module>common</module>
<module>orm</module>
<module>app</module>
<module>mint</module>
<module>gateway</module>
<module>http</module>
</modules>
<packaging>pom</packaging>
<name>tenet</name>
<url>http://cn.zorcc</url>
<description>A simple, fast, easy, lightweight library to build distributed microservice system</description>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>benrush</name>
<email>benrush0705@gmail.com</email>
</developer>
</developers>
<properties>
<java.version>28</java.version>
<resource.delimiter>@</resource.delimiter>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<jmh.version>1.37</jmh.version>
<junit.version>5.10.1</junit.version>
<scram.version>2.1</scram.version>
<jctools.version>4.0.2</jctools.version>
<!--
Directory holding libtenet.so, libssl.so, libcrypto.so and the compression libraries.
Override on the command line when the native libraries live elsewhere:
mvn test -Dtenet.library.path=/opt/tenet/lib
-->
<tenet.library.path>${user.home}/tenet-lib/lib</tenet.library.path>
</properties>
<!-- general dependencies for all modules -->
<dependencies>
<!-- junit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- jmh -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<encoding>${maven.compiler.encoding}</encoding>
<parameters>true</parameters> <!-- adding -parameter so that java reflection could see the parameter names -->
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
<compilerArgs>
<arg>--enable-preview</arg>
<arg>--add-modules</arg>
<arg>jdk.incubator.vector</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!--
Do NOT hardcode <skipTests> here. Explicit plugin configuration outranks the -D user property for
the same parameter, so a literal <skipTests>false</skipTests> would silently defeat
`mvn test -DskipTests` and `mvn test -Dmaven.test.skip`. Surefire already defaults to running tests.
-->
<!--
A -Dtest=LogTest filter empties the http-test execution, and vice versa. That is expected now
that the container tests are selected by tag, so an execution that matches nothing is not an error.
-->
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<!--
TENET_LIBRARY_PATH is read by NativeUtil via System.getProperty, an exported env var alone is not enough.
log.file points at a test config that disables console output: ConsoleLogEventHandler writes to the native
stdout FILE stream, which is the same pipe Surefire uses for its forked JVM protocol, so console logging
corrupts it. The add-modules option must mirror the compiler args, otherwise classes touching
jdk.incubator.vector (VectorJmhTest) fail with NoClassDefFoundError and abort JUnit discovery
for the whole module.
-->
<argLine>--enable-preview --enable-native-access=ALL-UNNAMED --add-modules jdk.incubator.vector -DTENET_LIBRARY_PATH=${tenet.library.path} -Dlog.file=/log-test.json</argLine>
<environmentVariables>
<TENET_LIBRARY_PATH>${tenet.library.path}</TENET_LIBRARY_PATH>
</environmentVariables>
<excludes>
<!--
These are interactive demo programs, not automated tests: every method ends in
Thread.sleep(Long.MAX_VALUE) so a live server can be poked by hand, and several of them
call Context.init() or create a Net per method, which the static single-instance guards
in Context/Net/LoggerConsumer forbid. Leaving them in the run would hang the build forever.
The patterns are prefixed with a wildcard after the class name on purpose: Surefire matches
compiled class files, and nested fixtures such as ContextTest$LifeCycleTest also match its
default ** / *Test include pattern.
-->
<exclude>**/EchoTest*.java</exclude>
<exclude>**/TagTest*.java</exclude>
<exclude>**/ContextTest*.java</exclude>
<!--
RefMapTest and IntMapTest are stress tests, not unit tests: RefMapTest spawns one thread per core
and each thread performs ROUND x BATCH map operations with assertions (100 x 100000 per core), and
IntMapTest repeats a 100000 entry put/get/replace/remove cycle ROUNDS (100) times. On a many-core
machine they run for an unbounded time. Run one explicitly when the behaviour matters:
mvn -pl common test -Dtest=IntMapTest -Dsurefire.excludes=
-->
<exclude>**/RefMapTest.java</exclude>
<exclude>**/IntMapTest.java</exclude>
</excludes>
</configuration>
<executions>
<!--
HttpTest and LogTest are the only automated tests that boot a real container. Context, Net,
LoggerConsumer and Wheel are process global singletons: Context.init() is one-shot per JVM and never
returns to INITIAL, and Net/LoggerConsumer refuse to be constructed twice. Two classes needing
Context.init() therefore cannot share one forked JVM, so each is given its own Surefire execution,
and Surefire gives every execution its own fork.
fork-per-test-class (reuseForks=false) would express this more broadly, but it breaks under
preview features: Surefire then resolves test classes on the Maven side, whose JVM is not started
with the preview flag, so every preview-compiled test class fails with UnsupportedClassVersionError.
-->
<execution>
<id>default-test</id>
<configuration>
<!--
A nested excludes list replaces the plugin level one instead of merging with it, so the interactive
and stress exclusions have to be repeated here.
-->
<excludes>
<exclude>**/EchoTest*.java</exclude>
<exclude>**/TagTest*.java</exclude>
<exclude>**/ContextTest*.java</exclude>
<exclude>**/RefMapTest.java</exclude>
<exclude>**/IntMapTest.java</exclude>
</excludes>
<!--
The two container tests are pulled out by tag, not by class name pattern. A -Dtest=HttpTest
overrides <includes> and <excludes> in every execution, which used to make that one test run
three times, binding the same fixed ports in quick succession and occasionally killing the
fork. Tags survive -Dtest, so each container test still runs exactly once per build.
-->
<excludedGroups>container-http,container-log</excludedGroups>
</configuration>
</execution>
<execution>
<id>http-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<groups>container-http</groups>
</configuration>
</execution>
<execution>
<id>log-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<groups>container-log</groups>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>