-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Jenkins-69756] Improve test coverage
- Loading branch information
1 parent
a0de40c
commit 99d2d80
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterValueTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.jvnet.jenkins.plugins.nodelabelparameter; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNotEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
|
||
public class NodeParameterValueTest { | ||
@Test | ||
public void testToString() { | ||
NodeParameterValue nvp = new NodeParameterValue("node", "description", "label"); | ||
assertEquals("[NodeParameterValue: node=label]", nvp.toString()); | ||
} | ||
|
||
@Test | ||
public void testHashCode() { | ||
NodeParameterValue nvp = new NodeParameterValue("node", "description", "label"); | ||
NodeParameterValue nvp2 = new NodeParameterValue("node", "description", "label"); | ||
assertEquals(nvp.hashCode(), nvp2.hashCode()); | ||
|
||
NodeParameterValue nvp3 = new NodeParameterValue("node", "description", "label2"); | ||
assertNotEquals(nvp, nvp3); | ||
} | ||
|
||
@Test | ||
public void testEquals() { | ||
NodeParameterValue nvp = new NodeParameterValue("node", "description", "label"); | ||
NodeParameterValue nvp2 = new NodeParameterValue("node", "description", "label"); | ||
assertTrue(nvp.equals(nvp2)); | ||
|
||
NodeParameterValue nvp3 = new NodeParameterValue("node", "description", "label2"); | ||
assertFalse(nvp.equals(nvp3)); | ||
|
||
assertFalse(nvp.equals(null)); | ||
assertFalse(nvp.equals(new Object())); | ||
assertTrue(nvp.equals(nvp)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters