Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JUnit_demo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kyle Muldoon
JUnit_demo
Commits
eb3ad0c7
Commit
eb3ad0c7
authored
Apr 09, 2021
by
Kyle Muldoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests that throw exceptions
parent
c6ed808c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
SampleTest.java
src/test/java/SampleTest.java
+18
-0
No files found.
src/test/java/SampleTest.java
View file @
eb3ad0c7
...
@@ -22,6 +22,24 @@ public class SampleTest extends TestResult {
...
@@ -22,6 +22,24 @@ public class SampleTest extends TestResult {
assertEquals
(
(
a
+
b
),
30
);
assertEquals
(
(
a
+
b
),
30
);
}
}
@org
.
junit
.
Test
(
timeout
=
500
)
public
void
WithDelay
()
throws
InterruptedException
{
int
a
=
10
;
int
b
=
20
;
Thread
.
sleep
(
1000
);
assertEquals
(
(
a
+
b
),
30
);
}
@org
.
junit
.
Test
(
expected
=
ArithmeticException
.
class
)
public
void
withException
()
{
int
a
=
10
;
int
b
=
20
;
int
res
=
a
+
b
;
throw
new
ArithmeticException
(
"some error happened"
);
}
public
synchronized
void
stop
()
{
public
synchronized
void
stop
()
{
// stop test here
// stop test here
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment