Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmpt-370-group-project-group26
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eyan Cunningham (esc568)
cmpt-370-group-project-group26
Commits
5b097fd5
Commit
5b097fd5
authored
2 years ago
by
Rafi Zereselasie (raz070)
Browse files
Options
Downloads
Patches
Plain Diff
Added a testing suite in the main method
parent
fdc1e627
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SchedulerApp/src/main/java/com/example/scheduler_server/Staff.java
+4
-5
4 additions, 5 deletions
...App/src/main/java/com/example/scheduler_server/Staff.java
with
4 additions
and
5 deletions
SchedulerApp/src/main/java/com/example/scheduler_server/Staff.java
+
4
−
5
View file @
5b097fd5
...
@@ -253,7 +253,7 @@ public class Staff {
...
@@ -253,7 +253,7 @@ public class Staff {
}
}
// Staff testing suite
// Staff testing suite
// This test suite must be started w
hile the staff table is empty
.
// This test suite must be started w
ith an empty Employees and Positions tables
.
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
try
{
try
{
Connection
dbConnection
=
DriverManager
.
getConnection
(
"jdbc:mysql://localhost:3306/ScheduleApp"
,
"root"
,
"password"
);
Connection
dbConnection
=
DriverManager
.
getConnection
(
"jdbc:mysql://localhost:3306/ScheduleApp"
,
"root"
,
"password"
);
...
@@ -264,9 +264,9 @@ public class Staff {
...
@@ -264,9 +264,9 @@ public class Staff {
String
queryString
;
String
queryString
;
int
queryInt
;
int
queryInt
;
int
success
=
0
;
int
success
=
0
;
System
.
out
.
println
(
"Staff Testing Suite:"
);
System
.
out
.
println
(
"\nStaff Test 1: "
);
System
.
out
.
println
(
"Staff Test 1: "
);
System
.
out
.
println
(
"Test Scenario: "
+
"Testing allEmployees()"
);
System
.
out
.
println
(
"Test Scenario: "
+
"Testing allEmployees()"
);
System
.
out
.
println
(
"Test Data: "
+
"none"
);
System
.
out
.
println
(
"Test Data: "
+
"none"
);
System
.
out
.
println
(
"Expected Results: "
+
"allEmployees"
);
System
.
out
.
println
(
"Expected Results: "
+
"allEmployees"
);
...
@@ -335,7 +335,7 @@ public class Staff {
...
@@ -335,7 +335,7 @@ public class Staff {
System
.
out
.
println
(
"Pass/Fail: Fail"
);
System
.
out
.
println
(
"Pass/Fail: Fail"
);
}
}
//Setup to test removePositionAllEmployees()
properly
//Setup to
properly
test removePositionAllEmployees()
staff
.
addEmployee
(
"Jane"
,
"Doe"
,
"false"
,
"jane.doe@email.com"
,
staff
.
addEmployee
(
"Jane"
,
"Doe"
,
"false"
,
"jane.doe@email.com"
,
"1234567890"
,
10.0f
);
"1234567890"
,
10.0f
);
staff
.
addPosition
(
2
,
"cashier"
);
staff
.
addPosition
(
2
,
"cashier"
);
...
@@ -352,7 +352,6 @@ public class Staff {
...
@@ -352,7 +352,6 @@ public class Staff {
System
.
out
.
println
(
"Actual Results: "
+
queryString
);
System
.
out
.
println
(
"Actual Results: "
+
queryString
);
if
(
queryString
.
equals
(
"allEmployees/1,Jonathan,Deer,0,jonathan.deer@email.com,0987654321,15.0,null/2,Jane,"
+
if
(
queryString
.
equals
(
"allEmployees/1,Jonathan,Deer,0,jonathan.deer@email.com,0987654321,15.0,null/2,Jane,"
+
"Doe,0,jane.doe@email.com,1234567890,10.0,null"
)){
"Doe,0,jane.doe@email.com,1234567890,10.0,null"
)){
success
+=
1
;
success
+=
1
;
System
.
out
.
println
(
"Pass/Fail: Pass"
);
System
.
out
.
println
(
"Pass/Fail: Pass"
);
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment