Allon Mureinik has uploaded a new change for review.

Change subject: restapi: Exceptions in FenceOptionsParserTest
......................................................................

restapi: Exceptions in FenceOptionsParserTest

Used proper expectations mechanism introduced in JUnit 4 in order to
make the code cleaner and easier to understand.

Change-Id: I464438a6952bf06b13e41d2bb4933cfe3f9a0127
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/FenceOptionsParserTest.java
1 file changed, 6 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/16808/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/FenceOptionsParserTest.java
 
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/FenceOptionsParserTest.java
index 523d44c..64367ec 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/FenceOptionsParserTest.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/FenceOptionsParserTest.java
@@ -91,32 +91,19 @@
         verifyResult(ret.get(0), "foo");
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     public void testParseMissingType() {
-        try {
-            parse("foo:one=1", "two=int");
-            fail("expected IllegalArgumentException");
-        } catch (IllegalArgumentException iae) {
-            System.out.println(iae);
-        }
+        parse("foo:one=1", "two=int");
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     public void testParseStrayColons() {
-        try {
-            parse("foo:::one=1,two=2,three=3", "one=bool,two=int,three=bool");
-            fail("expected IllegalArgumentException");
-        } catch (IllegalArgumentException iae) {
-        }
+        parse("foo:::one=1,two=2,three=3", "one=bool,two=int,three=bool");
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     public void testParseInvalidOption() {
-        try {
-            parse("foo:one=1,two=2,three", "one=bool,two=int,three=bool");
-            fail("expected IllegalArgumentException");
-        } catch (IllegalArgumentException iae) {
-        }
+        parse("foo:one=1,two=2,three", "one=bool,two=int,three=bool");
     }
 
     private void verifyResult(PowerManagement result, String type, String... 
options) {


-- 
To view, visit http://gerrit.ovirt.org/16808
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I464438a6952bf06b13e41d2bb4933cfe3f9a0127
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to