Skip to content

Commit d88c0cd

Browse files
author
Robert Sauer
committed
Providing a more portable variant to initialize (and teardown) a test server.
Additionally this will use the classpath as modeled in pom.xml and avoids the need to keep shell scripts in sync.
1 parent 25aac91 commit d88c0cd

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,17 @@ Be sure to run the tests before submitting your pull request. PRs with failing
115115
tests won't be accepted.
116116

117117
$ mvn test-compile
118-
$ sh src/test/resources/boot-test.sh
118+
$ mvn exec:java@test-server-init
119119
$ mvn test
120120

121+
If your Maven installation is older than 3.3.1 you will get an error from the
122+
`mvn exec:java@...` command as this syntax variant was introduced with Maven
123+
3.3.1. Simply replace the original command with
124+
125+
$ ...
126+
$ mvn exec:java -DexecutionId=test-server-init
127+
$ ...
128+
121129
#### Push your changes
122130

123131
$ git push origin my-feature-branch

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more on contributing to this github p
108108
### Running JUnit Tests
109109

110110
$ mvn test-compile
111-
$ sh src/test/resources/boot-test.sh
111+
$ mvn exec:java@test-server-init
112112
$ mvn test
113113

114114
## Support

pom.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,35 @@
185185
<phase>deploy</phase>
186186
</execution>
187187
</executions>
188-
</plugin>
188+
</plugin>
189+
<plugin>
190+
<groupId>org.codehaus.mojo</groupId>
191+
<artifactId>exec-maven-plugin</artifactId>
192+
<version>1.5.0</version>
193+
<executions>
194+
<execution>
195+
<id>test-server-init</id>
196+
<goals>
197+
<goal>java</goal>
198+
</goals>
199+
</execution>
200+
<execution>
201+
<id>test-server-teardown</id>
202+
<goals>
203+
<goal>java</goal>
204+
</goals>
205+
<configuration>
206+
<arguments>
207+
<argument>teardown</argument>
208+
</arguments>
209+
</configuration>
210+
</execution>
211+
</executions>
212+
<configuration>
213+
<mainClass>com.marklogic.client.test.util.TestServerBootstrapper</mainClass>
214+
<classpathScope>test</classpathScope>
215+
</configuration>
216+
</plugin>
189217
</plugins>
190218
</build>
191219
<dependencies>

src/test/java/com/marklogic/client/test/BitemporalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
5656
public class BitemporalTest {
57-
// src/test/resources/bootstrap.xqy is run by src/test/resources/boot-test.sh
57+
// src/test/resources/bootstrap.xqy is run by com.marklogic.client.test.util.TestServerBootstrapper
5858
// and sets up the "temporal-collection" and required underlying axes
5959
// system-axis and valid-axis which have required underlying range indexes
6060
// system-start, system-end, valid-start, and valid-end

0 commit comments

Comments
 (0)