Skip to content

Commit 379ab15

Browse files
authored
Merge pull request #99 from cloudbees-oss/feat-693-test-excution
feat(LUNCH-693)-Add initial Java application with unit and integratio…
2 parents 541c3d2 + 2758c49 commit 379ab15

19 files changed

Lines changed: 1160 additions & 0 deletions

File tree

maven/basic/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Java
2+
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.nar
19+
*.ear
20+
*.zip
21+
*.tar.gz
22+
*.rar
23+
24+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
25+
hs_err_pid*
26+
27+
# Maven
28+
29+
target/
30+
pom.xml.tag
31+
pom.xml.releaseBackup
32+
pom.xml.versionsBackup
33+
pom.xml.next
34+
release.properties
35+
dependency-reduced-pom.xml
36+
buildNumber.properties
37+
.mvn/timing.properties
38+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
39+
.mvn/wrapper/maven-wrapper.jar

maven/basic/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Maven Basic Example
2+
3+
This is a simple Maven project using JUnit 4 to demonstrate basic Launchable integration.
4+
5+
## Project Structure
6+
7+
- Simple Maven project with JUnit 4
8+
- Two test classes: `AppTest.java` and `App2Test.java`
9+
- Basic "Hello World" application
10+
11+
## Running Tests
12+
13+
```sh
14+
# Run all tests
15+
mvn test
16+
```
17+
18+
## Recording Test Results
19+
20+
```sh
21+
# Record build
22+
BUILD_NAME=my-build-$(date +%s)
23+
launchable record build --name ${BUILD_NAME} --source .
24+
25+
# Run tests
26+
mvn test
27+
28+
# Record test results
29+
launchable record tests --build ${BUILD_NAME} maven surefire ./target/surefire-reports
30+
```
31+
32+
## Subsetting Test Runs
33+
34+
```sh
35+
# Set up variables
36+
BUILD_NAME=my-build-$(date +%s)
37+
TARGET="80%"
38+
39+
# Record build
40+
launchable record build --name ${BUILD_NAME} --source .
41+
42+
# Request subset
43+
launchable subset --target ${TARGET} --build ${BUILD_NAME} maven surefire ./target/surefire-reports > subset.txt
44+
45+
# Run only the subset
46+
mvn test -Dtest=$(cat subset.txt | tr '\n' ',')
47+
48+
# Record the subset results
49+
launchable record tests --build ${BUILD_NAME} maven surefire ./target/surefire-reports
50+
```
51+
52+
## Learn More
53+
54+
- [Launchable Documentation](https://www.launchableinc.com/docs/)
55+
- [Maven Surefire Plugin](https://maven.apache.org/surefire/maven-surefire-plugin/)
File renamed without changes.

maven/src/main/java/com/launchableinc/rocket_car_maven/App.java renamed to maven/basic/src/main/java/com/launchableinc/rocket_car_maven/App.java

File renamed without changes.

maven/src/test/java/com/launchableinc/rocket_car_maven/App2Test.java renamed to maven/basic/src/test/java/com/launchableinc/rocket_car_maven/App2Test.java

File renamed without changes.

maven/src/test/java/com/launchableinc/rocket_car_maven/AppTest.java renamed to maven/basic/src/test/java/com/launchableinc/rocket_car_maven/AppTest.java

File renamed without changes.

maven/test-exclusion/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Java
2+
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.nar
19+
*.ear
20+
*.zip
21+
*.tar.gz
22+
*.rar
23+
24+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
25+
hs_err_pid*
26+
27+
# Maven
28+
29+
target/
30+
pom.xml.tag
31+
pom.xml.releaseBackup
32+
pom.xml.versionsBackup
33+
pom.xml.next
34+
release.properties
35+
dependency-reduced-pom.xml
36+
buildNumber.properties
37+
.mvn/timing.properties
38+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
39+
.mvn/wrapper/maven-wrapper.jar

0 commit comments

Comments
 (0)