directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [43/50] [abbrv] directory-kerby git commit: Improved test by declaring expected exception.
Date Thu, 30 Jul 2015 06:24:50 GMT
Improved test by declaring expected exception.

Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/3f41d932
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/3f41d932
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/3f41d932

Branch: refs/heads/pkinit-support
Commit: 3f41d932282d3a8d0f06ac14622af901b5f90d10
Parents: 5a3040e
Author: Stefan Seelmann <mail@stefan-seelmann.de>
Authored: Sun Jul 26 20:53:07 2015 +0200
Committer: Stefan Seelmann <mail@stefan-seelmann.de>
Committed: Sun Jul 26 20:53:07 2015 +0200

----------------------------------------------------------------------
 .../TokenLoginTestWithTokenPreauthDisabled.java | 22 +++++++-------------
 1 file changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3f41d932/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestWithTokenPreauthDisabled.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestWithTokenPreauthDisabled.java
b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestWithTokenPreauthDisabled.java
index 857d6f2..1dd8417 100644
--- a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestWithTokenPreauthDisabled.java
+++ b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestWithTokenPreauthDisabled.java
@@ -19,6 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.integration.test;
 
+import javax.security.auth.login.LoginException;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -32,23 +34,15 @@ public class TokenLoginTestWithTokenPreauthDisabled extends TokenLoginTestBase
{
         return false;
     }
 
-    @Test
+    @Test(expected = LoginException.class)
     public void testLoginWithTokenStr() throws Exception {
-        try {
-            super.testLoginWithTokenStr();
-            Assert.fail("Exception should have been thrown");
-        } catch (Exception e) {
-          //expects exception
-        }
+        super.testLoginWithTokenStr();
+        Assert.fail("Exception should have been thrown");
     }
 
-    @Test
+    @Test(expected = LoginException.class)
     public void testLoginWithTokenCache() throws Exception {
-        try {
-            super.testLoginWithTokenCache();
-            Assert.fail("Exception should have been thrown");
-        } catch (Exception e) {
-          //expects exception
-        }
+        super.testLoginWithTokenCache();
+        Assert.fail("Exception should have been thrown");
     }
 }
\ No newline at end of file


Mime
View raw message