Repository navigation
Expand file tree
/
Copy pathrun-tests.sh
More file actions
117 lines (105 loc) · 2.75 KB
/
Copy pathrun-tests.sh
File metadata and controls
117 lines (105 loc) · 2.75 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
#!/bin/bash
# Courier Tracking Application Test Runner
# This script provides various options for running tests
echo "Courier Tracking Application - Test Runner"
echo "=========================================="
# Function to display usage
usage() {
echo "Usage: $0 [OPTION]"
echo ""
echo "Options:"
echo " all Run all tests"
echo " unit Run unit tests only"
echo " integration Run integration tests only"
echo " ui Run UI tests only"
echo " scenarios Run scenario tests only"
echo " model Run model tests only"
echo " repository Run repository tests only"
echo " clean Clean and compile"
echo " help Show this help message"
echo ""
echo "Examples:"
echo " $0 all # Run all tests"
echo " $0 unit # Run unit tests only"
echo " $0 integration # Run integration tests only"
echo " $0 scenarios # Run scenario tests only"
}
# Function to run all tests
run_all_tests() {
echo "Running all tests..."
mvn test
}
# Function to run unit tests
run_unit_tests() {
echo "Running unit tests..."
mvn test -Dtest="com.example.couriertracking.model.*"
}
# Function to run integration tests
run_integration_tests() {
echo "Running integration tests..."
mvn test -Dtest="com.example.couriertracking.integration.*"
}
# Function to run UI tests
run_ui_tests() {
echo "Running UI tests..."
mvn test -Dtest="com.example.couriertracking.ui.*"
}
# Function to run scenario tests
run_scenario_tests() {
echo "Running scenario tests..."
mvn test -Dtest="com.example.couriertracking.scenarios.*"
}
# Function to run model tests
run_model_tests() {
echo "Running model tests..."
mvn test -Dtest="com.example.couriertracking.model.*"
}
# Function to run repository tests
run_repository_tests() {
echo "Running repository tests..."
mvn test -Dtest="com.example.couriertracking.repository.*"
}
# Function to clean and compile
clean_and_compile() {
echo "Cleaning and compiling..."
mvn clean compile
}
# Main script logic
case "$1" in
"all")
run_all_tests
;;
"unit")
run_unit_tests
;;
"integration")
run_integration_tests
;;
"ui")
run_ui_tests
;;
"scenarios")
run_scenario_tests
;;
"model")
run_model_tests
;;
"repository")
run_repository_tests
;;
"clean")
clean_and_compile
;;
"help"|"-h"|"--help")
usage
;;
"")
echo "No option specified. Use 'help' for usage information."
usage
;;
*)
echo "Unknown option: $1"
usage
exit 1
;;
esac