diff --git a/core/src/test/java/org/springframework/security/acls/AclFormattingUtilsTests.java b/core/src/test/java/org/springframework/security/acls/AclFormattingUtilsTests.java index 135b0f0278..6ddb8340bc 100644 --- a/core/src/test/java/org/springframework/security/acls/AclFormattingUtilsTests.java +++ b/core/src/test/java/org/springframework/security/acls/AclFormattingUtilsTests.java @@ -12,7 +12,7 @@ public class AclFormattingUtilsTests extends TestCase { //~ Methods ======================================================================================================== - public final void testDemergePatternsParametersConstraints() { + public final void testDemergePatternsParametersConstraints() throws Exception { try { AclFormattingUtils.demergePatterns(null, "SOME STRING"); Assert.fail("It should have thrown IllegalArgumentException"); @@ -46,7 +46,7 @@ public class AclFormattingUtilsTests extends TestCase { } } - public final void testDemergePatterns() { + public final void testDemergePatterns() throws Exception { String original = "...........................A...R"; String removeBits = "...............................R"; Assert.assertEquals("...........................A....", AclFormattingUtils @@ -56,7 +56,7 @@ public class AclFormattingUtilsTests extends TestCase { Assert.assertEquals("......", AclFormattingUtils.demergePatterns("ABCDEF", "GHIJKL")); } - public final void testMergePatternsParametersConstraints() { + public final void testMergePatternsParametersConstraints() throws Exception { try { AclFormattingUtils.mergePatterns(null, "SOME STRING"); Assert.fail("It should have thrown IllegalArgumentException"); @@ -90,7 +90,7 @@ public class AclFormattingUtilsTests extends TestCase { } } - public final void testMergePatterns() { + public final void testMergePatterns() throws Exception { String original = "...............................R"; String extraBits = "...........................A...."; Assert.assertEquals("...........................A...R", AclFormattingUtils @@ -100,7 +100,7 @@ public class AclFormattingUtilsTests extends TestCase { Assert.assertEquals("GHIJKL", AclFormattingUtils.mergePatterns("ABCDEF", "GHIJKL")); } - public final void testBinaryPrints() { + public final void testBinaryPrints() throws Exception { Assert.assertEquals("............................****", AclFormattingUtils.printBinary(15)); try { diff --git a/core/src/test/java/org/springframework/security/acls/domain/AccessControlEntryTests.java b/core/src/test/java/org/springframework/security/acls/domain/AccessControlEntryTests.java index 3c54343ce3..7c0700c704 100644 --- a/core/src/test/java/org/springframework/security/acls/domain/AccessControlEntryTests.java +++ b/core/src/test/java/org/springframework/security/acls/domain/AccessControlEntryTests.java @@ -22,7 +22,7 @@ public class AccessControlEntryTests extends TestCase { //~ Methods ======================================================================================================== - public void testConstructorRequiredFields() { + public void testConstructorRequiredFields() throws Exception { // Check Acl field is present try { AccessControlEntry ace = new AccessControlEntryImpl(null, null, new PrincipalSid("johndoe"), @@ -54,7 +54,7 @@ public class AccessControlEntryTests extends TestCase { } } - public void testAccessControlEntryImplGetters() { + public void testAccessControlEntryImplGetters() throws Exception { Acl mockAcl = new MockAcl(); Sid sid = new PrincipalSid("johndoe"); @@ -72,7 +72,7 @@ public class AccessControlEntryTests extends TestCase { Assert.assertTrue(((AuditableAccessControlEntry) ace).isAuditSuccess()); } - public void testEquals() { + public void testEquals() throws Exception { Acl mockAcl = new MockAcl(); Sid sid = new PrincipalSid("johndoe"); diff --git a/core/src/test/java/org/springframework/security/acls/domain/AclImplementationSecurityCheckTests.java b/core/src/test/java/org/springframework/security/acls/domain/AclImplementationSecurityCheckTests.java index 6753471fe2..3740239423 100644 --- a/core/src/test/java/org/springframework/security/acls/domain/AclImplementationSecurityCheckTests.java +++ b/core/src/test/java/org/springframework/security/acls/domain/AclImplementationSecurityCheckTests.java @@ -34,7 +34,7 @@ public class AclImplementationSecurityCheckTests extends TestCase { SecurityContextHolder.clearContext(); } - public void testSecurityCheckNoACEs() { + public void testSecurityCheckNoACEs() throws Exception { Authentication auth = new TestingAuthenticationToken("user", "password", new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_GENERAL"), new GrantedAuthorityImpl("ROLE_AUDITING"), new GrantedAuthorityImpl("ROLE_OWNERSHIP") }); @@ -98,7 +98,7 @@ public class AclImplementationSecurityCheckTests extends TestCase { } } - public void testSecurityCheckWithMultipleACEs() { + public void testSecurityCheckWithMultipleACEs() throws Exception { // Create a simple authentication with ROLE_GENERAL Authentication auth = new TestingAuthenticationToken("user", "password", new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_GENERAL") }); @@ -199,7 +199,7 @@ public class AclImplementationSecurityCheckTests extends TestCase { } } - public void testSecurityCheckWithInheritableACEs() { + public void testSecurityCheckWithInheritableACEs() throws Exception { // Create a simple authentication with ROLE_GENERAL Authentication auth = new TestingAuthenticationToken("user", "password", new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_GENERAL") }); @@ -257,7 +257,7 @@ public class AclImplementationSecurityCheckTests extends TestCase { } } - public void testSecurityCheckPrincipalOwner() { + public void testSecurityCheckPrincipalOwner() throws Exception { Authentication auth = new TestingAuthenticationToken("user", "password", new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_ONE") }); diff --git a/core/src/test/java/org/springframework/security/acls/domain/AuditLoggerTests.java b/core/src/test/java/org/springframework/security/acls/domain/AuditLoggerTests.java index 039855aef4..b4a24a674b 100644 --- a/core/src/test/java/org/springframework/security/acls/domain/AuditLoggerTests.java +++ b/core/src/test/java/org/springframework/security/acls/domain/AuditLoggerTests.java @@ -36,7 +36,7 @@ public class AuditLoggerTests extends TestCase { System.setOut(console); } - public void testLoggingTests() { + public void testLoggingTests() throws Exception { ConsoleAuditLogger logger = new ConsoleAuditLogger(); MockAccessControlEntryImpl auditableAccessControlEntry = new MockAccessControlEntryImpl(); diff --git a/core/src/test/java/org/springframework/security/acls/objectidentity/ObjectIdentityTests.java b/core/src/test/java/org/springframework/security/acls/objectidentity/ObjectIdentityTests.java index 59a1a90a02..1af40d2961 100644 --- a/core/src/test/java/org/springframework/security/acls/objectidentity/ObjectIdentityTests.java +++ b/core/src/test/java/org/springframework/security/acls/objectidentity/ObjectIdentityTests.java @@ -14,7 +14,7 @@ public class ObjectIdentityTests extends TestCase { //~ Methods ======================================================================================================== - public void testConstructorsRequiredFields() { + public void testConstructorsRequiredFields() throws Exception { // Check one-argument constructor required field try { ObjectIdentity obj = new ObjectIdentityImpl(null); @@ -64,7 +64,7 @@ public class ObjectIdentityTests extends TestCase { } } - public void testGetIdMethodConstraints() { + public void testGetIdMethodConstraints() throws Exception { // Check the getId() method is present try { ObjectIdentity obj = new ObjectIdentityImpl("A_STRING_OBJECT"); @@ -105,7 +105,7 @@ public class ObjectIdentityTests extends TestCase { } } - public void testConstructorInvalidClassParameter() { + public void testConstructorInvalidClassParameter() throws Exception { try { ObjectIdentity obj = new ObjectIdentityImpl("not.a.Class", new Long(1)); } @@ -115,7 +115,7 @@ public class ObjectIdentityTests extends TestCase { Assert.fail("It should have thrown IllegalStateException"); } - public void testEquals() { + public void testEquals() throws Exception { ObjectIdentity obj = new ObjectIdentityImpl( "org.springframework.security.acls.objectidentity.ObjectIdentityTests$MockIdDomainObject", new Long(1)); MockIdDomainObject mockObj = new MockIdDomainObject(); @@ -144,7 +144,7 @@ public class ObjectIdentityTests extends TestCase { .equals(new ObjectIdentityImpl(mockObj))); } - public void testHashCode() { + public void testHashCode() throws Exception { ObjectIdentity obj = new ObjectIdentityImpl( "org.springframework.security.acls.objectidentity.ObjectIdentityTests$MockIdDomainObject", new Long(1)); Assert.assertEquals(new ObjectIdentityImpl( @@ -158,7 +158,7 @@ public class ObjectIdentityTests extends TestCase { .hashCode() != obj.hashCode()); } - public void testGetters() { + public void testGetters() throws Exception { ObjectIdentity obj = new ObjectIdentityImpl( "org.springframework.security.acls.objectidentity.ObjectIdentityTests$MockIdDomainObject", new Long(1)); Assert.assertEquals(new Long(1), obj.getIdentifier()); diff --git a/core/src/test/java/org/springframework/security/acls/sid/SidRetrievalStrategyTests.java b/core/src/test/java/org/springframework/security/acls/sid/SidRetrievalStrategyTests.java index 458220c8bb..ac2bb70797 100644 --- a/core/src/test/java/org/springframework/security/acls/sid/SidRetrievalStrategyTests.java +++ b/core/src/test/java/org/springframework/security/acls/sid/SidRetrievalStrategyTests.java @@ -17,7 +17,7 @@ public class SidRetrievalStrategyTests extends TestCase { //~ Methods ======================================================================================================== - public void testSidsRetrieval() { + public void testSidsRetrieval() throws Exception { Authentication authentication = new TestingAuthenticationToken("scott", "password", new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_1"), new GrantedAuthorityImpl("ROLE_2"), new GrantedAuthorityImpl("ROLE_3") }); SidRetrievalStrategy retrStrategy = new SidRetrievalStrategyImpl(); diff --git a/core/src/test/java/org/springframework/security/acls/sid/SidTests.java b/core/src/test/java/org/springframework/security/acls/sid/SidTests.java index 5007272172..fa00972d5f 100644 --- a/core/src/test/java/org/springframework/security/acls/sid/SidTests.java +++ b/core/src/test/java/org/springframework/security/acls/sid/SidTests.java @@ -15,7 +15,7 @@ public class SidTests extends TestCase { //~ Methods ======================================================================================================== - public void testPrincipalSidConstructorsRequiredFields() { + public void testPrincipalSidConstructorsRequiredFields() throws Exception { // Check one String-argument constructor try { String string = null; @@ -71,7 +71,7 @@ public class SidTests extends TestCase { } } - public void testGrantedAuthoritySidConstructorsRequiredFields() { + public void testGrantedAuthoritySidConstructorsRequiredFields() throws Exception { // Check one String-argument constructor try { String string = null; @@ -127,7 +127,7 @@ public class SidTests extends TestCase { } } - public void testPrincipalSidEquals() { + public void testPrincipalSidEquals() throws Exception { Authentication authentication = new TestingAuthenticationToken("johndoe", "password", null); Sid principalSid = new PrincipalSid(authentication); @@ -141,7 +141,7 @@ public class SidTests extends TestCase { Assert.assertFalse(principalSid.equals(new PrincipalSid("scott"))); } - public void testGrantedAuthoritySidEquals() { + public void testGrantedAuthoritySidEquals() throws Exception { GrantedAuthority ga = new GrantedAuthorityImpl("ROLE_TEST"); Sid gaSid = new GrantedAuthoritySid(ga); @@ -155,7 +155,7 @@ public class SidTests extends TestCase { Assert.assertFalse(gaSid.equals(new GrantedAuthoritySid("ROLE_NOT_EQUAL"))); } - public void testPrincipalSidHashCode() { + public void testPrincipalSidHashCode() throws Exception { Authentication authentication = new TestingAuthenticationToken("johndoe", "password", null); Sid principalSid = new PrincipalSid(authentication); @@ -166,7 +166,7 @@ public class SidTests extends TestCase { null)).hashCode()); } - public void testGrantedAuthoritySidHashCode() { + public void testGrantedAuthoritySidHashCode() throws Exception { GrantedAuthority ga = new GrantedAuthorityImpl("ROLE_TEST"); Sid gaSid = new GrantedAuthoritySid(ga); @@ -176,7 +176,7 @@ public class SidTests extends TestCase { Assert.assertTrue(gaSid.hashCode() != new GrantedAuthoritySid(new GrantedAuthorityImpl("ROLE_TEST_2")).hashCode()); } - public void testGetters() { + public void testGetters() throws Exception { Authentication authentication = new TestingAuthenticationToken("johndoe", "password", null); PrincipalSid principalSid = new PrincipalSid(authentication); GrantedAuthority ga = new GrantedAuthorityImpl("ROLE_TEST");