From 0a214e4930dbea798878c1bc5dc76fd26c375fc9 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Thu, 11 Oct 2007 15:23:01 +0000 Subject: [PATCH] Removed locale-specific message value assertions which will cause tests to fail if run with a different standard locale for which we have a message file (e.g. Chinese). --- .../AnonymousAuthenticationProviderTests.java | 11 ----------- .../providers/cas/CasAuthenticationProviderTests.java | 7 ------- .../RememberMeAuthenticationProviderTests.java | 11 ----------- 3 files changed, 29 deletions(-) diff --git a/core/src/test/java/org/springframework/security/providers/anonymous/AnonymousAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/providers/anonymous/AnonymousAuthenticationProviderTests.java index 32a9207466..706ba6d4fe 100644 --- a/core/src/test/java/org/springframework/security/providers/anonymous/AnonymousAuthenticationProviderTests.java +++ b/core/src/test/java/org/springframework/security/providers/anonymous/AnonymousAuthenticationProviderTests.java @@ -35,7 +35,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase { //~ Constructors =================================================================================================== public AnonymousAuthenticationProviderTests() { - super(); } public AnonymousAuthenticationProviderTests(String arg0) { @@ -44,14 +43,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase { //~ Methods ======================================================================================================== - public static void main(String[] args) { - junit.textui.TestRunner.run(AnonymousAuthenticationProviderTests.class); - } - - public final void setUp() throws Exception { - super.setUp(); - } - public void testDetectsAnInvalidKey() throws Exception { AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider(); aap.setKey("qwerty"); @@ -63,8 +54,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase { Authentication result = aap.authenticate(token); fail("Should have thrown BadCredentialsException"); } catch (BadCredentialsException expected) { - assertEquals("The presented AnonymousAuthenticationToken does not contain the expected key", - expected.getMessage()); } } diff --git a/core/src/test/java/org/springframework/security/providers/cas/CasAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/providers/cas/CasAuthenticationProviderTests.java index c23d72472b..80e3151967 100644 --- a/core/src/test/java/org/springframework/security/providers/cas/CasAuthenticationProviderTests.java +++ b/core/src/test/java/org/springframework/security/providers/cas/CasAuthenticationProviderTests.java @@ -48,7 +48,6 @@ public class CasAuthenticationProviderTests extends TestCase { //~ Constructors =================================================================================================== public CasAuthenticationProviderTests() { - super(); } public CasAuthenticationProviderTests(String arg0) { @@ -57,10 +56,6 @@ public class CasAuthenticationProviderTests extends TestCase { //~ Methods ======================================================================================================== - public static void main(String[] args) { - junit.textui.TestRunner.run(CasAuthenticationProviderTests.class); - } - private UserDetails makeUserDetails() { return new User("user", "password", true, true, true, true, new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")}); @@ -170,7 +165,6 @@ public class CasAuthenticationProviderTests extends TestCase { Authentication result = cap.authenticate(token); fail("Should have thrown BadCredentialsException"); } catch (BadCredentialsException expected) { - assertEquals("Failed to provide a CAS service ticket to validate", expected.getMessage()); } } @@ -192,7 +186,6 @@ public class CasAuthenticationProviderTests extends TestCase { Authentication result = cap.authenticate(token); fail("Should have thrown BadCredentialsException"); } catch (BadCredentialsException expected) { - assertEquals("The presented CasAuthenticationToken does not contain the expected key", expected.getMessage()); } } diff --git a/core/src/test/java/org/springframework/security/providers/rememberme/RememberMeAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/providers/rememberme/RememberMeAuthenticationProviderTests.java index 80591c4f2d..fc8bbc5af8 100644 --- a/core/src/test/java/org/springframework/security/providers/rememberme/RememberMeAuthenticationProviderTests.java +++ b/core/src/test/java/org/springframework/security/providers/rememberme/RememberMeAuthenticationProviderTests.java @@ -35,7 +35,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase { //~ Constructors =================================================================================================== public RememberMeAuthenticationProviderTests() { - super(); } public RememberMeAuthenticationProviderTests(String arg0) { @@ -44,14 +43,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase { //~ Methods ======================================================================================================== - public static void main(String[] args) { - junit.textui.TestRunner.run(RememberMeAuthenticationProviderTests.class); - } - - public final void setUp() throws Exception { - super.setUp(); - } - public void testDetectsAnInvalidKey() throws Exception { RememberMeAuthenticationProvider aap = new RememberMeAuthenticationProvider(); aap.setKey("qwerty"); @@ -63,8 +54,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase { Authentication result = aap.authenticate(token); fail("Should have thrown BadCredentialsException"); } catch (BadCredentialsException expected) { - assertEquals("The presented RememberMeAuthenticationToken does not contain the expected key", - expected.getMessage()); } }