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
cc85482b
Commit
cc85482b
authored
Apr 09, 2021
by
Kyle Muldoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added parameterized test in SampleTest.java
parent
eb3ad0c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
SampleTest.java
src/test/java/SampleTest.java
+9
-10
No files found.
src/test/java/SampleTest.java
View file @
cc85482b
import
junit.framework.AssertionFailedError
;
import
junit.framework.AssertionFailedError
;
import
junit.framework.Test
;
import
junit.framework.Test
;
import
junit.framework.TestResult
;
import
junit.framework.TestResult
;
import
org.junit.runners.Parameterized
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
junit
.
Assert
.*;
...
@@ -39,6 +43,11 @@ public class SampleTest extends TestResult {
...
@@ -39,6 +43,11 @@ public class SampleTest extends TestResult {
throw
new
ArithmeticException
(
"some error happened"
);
throw
new
ArithmeticException
(
"some error happened"
);
}
}
@Parameterized
.
Parameters
public
static
Collection
primeNumbers
()
{
return
Arrays
.
asList
(
new
Object
[][]
{
{
2
,
true
},{
6
,
false
},{
19
,
true
},{
22
,
false
},{
23
,
true
}});
}
public
synchronized
void
stop
()
{
public
synchronized
void
stop
()
{
// stop test here
// stop test here
...
@@ -47,13 +56,3 @@ public class SampleTest extends TestResult {
...
@@ -47,13 +56,3 @@ public class SampleTest extends TestResult {
}
}
//public class SampleTest {
// int a = 10;
// int b = 20;
//
// @Test
// public void testAdd() {
// assertEquals( (a + b), 30 );
// }
//}
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