Skip to content

Commit eb53f28

Browse files
committed
add workflow for integration test of bootable jar
1 parent cdb9176 commit eb53f28

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Test Bootable JAR
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main, development ]
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
java: [17]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK ${{ matrix.java }}
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: ${{ matrix.java }}
25+
26+
- name: Grant execute permission for Gradle wrapper (Unix)
27+
if: runner.os != 'Windows'
28+
run: chmod +x gradlew
29+
30+
- name: Build bootable JAR (skip tests)
31+
run: ./gradlew bootJar -x test
32+
33+
- name: Find JAR file
34+
id: find-jar
35+
run: |
36+
echo "JAR_PATH=$(find build/libs -name '*.jar' | head -n 1)" >> $GITHUB_ENV
37+
38+
- name: Run JAR with auto-input
39+
shell: bash
40+
run: |
41+
echo -e "\n\n\n\n\n\nok\nyes" | java -jar "$JAR_PATH" &
42+
echo $! > server.pid
43+
sleep 30 # Give the server time to start
44+
45+
- name: hurl tests
46+
uses: gacts/install-hurl@v1
47+
run: hurl --variable host=http://localhost --test integration_tests/*.hurl --verbose --error-format=long

integration_tests/create_anno.hurl

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# server root is reachable
2+
GET {{host}}/wap/
3+
HTTP 200
4+
5+
#create container
6+
POST {{host}}/wap/
7+
Content-Type: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
8+
Link: <http://www.w3.org/ns/ldp\#BasicContainer>; rel="type"
9+
Slug: helloWorld
10+
{
11+
"@context": [ "http://www.w3.org/ns/anno.jsonld", "http://www.w3.org/ns/ldp.jsonld" ],
12+
"@type": [ "ldp:Container", "ldp:BasicContainer", "AnnotationCollection"],
13+
"label":"This container will contain nothing"
14+
}
15+
HTTP 201
16+
17+
# Create an Annotation
18+
POST {{host}}/wap/helloWorld/
19+
Content-Type: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
20+
21+
{
22+
"@context": "http://www.w3.org/ns/anno.jsonld",
23+
"type": "Annotation",
24+
"body": {
25+
"type": "TextualBody",
26+
"value": "This is a comment",
27+
"format": "text/plain"
28+
},
29+
"target": "http://example.org/page1"
30+
}
31+
HTTP 201
32+
[Captures]
33+
anno: header "Location"
34+
35+
# Get the Annotation and capture ETag
36+
GET {{anno}}
37+
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
38+
HTTP 200
39+
[Captures]
40+
etag: header "ETag"
41+
42+
# Delete the Annotation using ETag
43+
DELETE {{anno}}
44+
If-Match: {{etag}}
45+
HTTP 204
46+
47+
# Get the Container and capture ETag
48+
GET {{host}}/wap/helloWorld/
49+
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
50+
HTTP 200
51+
[Captures]
52+
etag: header "ETag"
53+
54+
# Delete the Container using ETag
55+
DELETE {{host}}/wap/helloWorld/
56+
If-Match: {{etag}}
57+
HTTP 204
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# server root is reachable
2+
GET {{host}}/wap/
3+
HTTP 200
4+
5+
#create container
6+
POST {{host}}/wap/
7+
Content-Type: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
8+
Link: <http://www.w3.org/ns/ldp\#BasicContainer>; rel="type"
9+
Slug: annocontainer
10+
{
11+
"@context": [ "http://www.w3.org/ns/anno.jsonld", "http://www.w3.org/ns/ldp.jsonld" ],
12+
"@type": [ "ldp:Container", "ldp:BasicContainer", "AnnotationCollection"],
13+
"label":"This container will contain nothing"
14+
}
15+
HTTP 201
16+
17+
# Get the Container and capture ETag
18+
GET {{host}}/wap/annocontainer/
19+
Accept: application/ld+json; profile="http://www.w3.org/ns/anno.jsonld"
20+
HTTP 200
21+
[Captures]
22+
etag: header "ETag"
23+
24+
# Delete the Container using ETag
25+
DELETE {{host}}/wap/annocontainer/
26+
If-Match: {{etag}}
27+
HTTP 204

integration_tests/get_static.hurl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# server root is reachable
2+
GET {{host}}
3+
HTTP 200
4+
5+
GET {{host}}/webapp
6+
[Options]
7+
location-trusted: true
8+
HTTP 200
9+
10+
GET {{host}}/javadoc
11+
[Options]
12+
location-trusted: true
13+
HTTP 200

0 commit comments

Comments
 (0)