List of usage examples for java.security GeneralSecurityException getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.jasig.cas.adaptors.x509.authentication.handler.support.AbstractCRLRevocationCheckerTests.java
/** * Test method for {@link AbstractCRLRevocationChecker#check(X509Certificate)}. *///from w w w. ja v a 2 s .c o m @Test public void testCheck() { try { for (X509Certificate cert : this.certificates) { getChecker().check(cert); } if (this.expected != null) { Assert.fail("Expected exception of type " + this.expected.getClass()); } } catch (final GeneralSecurityException e) { if (this.expected == null) { e.printStackTrace(); Assert.fail("Revocation check failed unexpectedly with exception: " + e); } else { final Class<?> expectedClass = this.expected.getClass(); final Class<?> actualClass = e.getClass(); Assert.assertTrue( String.format("Expected exception of type %s but got %s", expectedClass, actualClass), expectedClass.isAssignableFrom(actualClass)); } } }