org.apache.ws.security.misc
Class FaultCodeTest

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.ws.security.misc.FaultCodeTest
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class FaultCodeTest
extends org.junit.Assert
implements javax.security.auth.callback.CallbackHandler

WS-Security Test Case for fault codes. The SOAP Message Security specification 1.1 defines standard fault codes and fault strings for error propagation.


Constructor Summary
FaultCodeTest()
           
 
Method Summary
 void handle(javax.security.auth.callback.Callback[] callbacks)
           
 void testFailedAuthentication()
          Test for the wsse:FailedAuthentication faultcode.
 void testFailedCheck()
          Test for the wsse:FailedCheck faultcode.
 void testInvalidSecurity()
          Test for the wsse:InvalidSecurity faultcode.
 void testInvalidSecurityToken()
          Test for the wsse:InvalidSecurityToken faultcode.
 void testMessageExpired()
          Test for the wsse:MessageExpired faultcode.
 void testUnsupportedAlgorithm()
          Test for the wsse:UnsupportedAlgorithm faultcode.
 
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaultCodeTest

public FaultCodeTest()
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

testFailedCheck

public void testFailedCheck()
                     throws java.lang.Exception
Test for the wsse:FailedCheck faultcode. This will fail due to a bad password in the callback handler.

Throws:
java.lang.Exception

testUnsupportedAlgorithm

public void testUnsupportedAlgorithm()
                              throws java.lang.Exception
Test for the wsse:UnsupportedAlgorithm faultcode. This will fail due to the argument passed to getCipherInstance.

Throws:
java.lang.Exception

testMessageExpired

public void testMessageExpired()
                        throws java.lang.Exception
Test for the wsse:MessageExpired faultcode. This will fail due to the argument passed to setTimeToLive.

Throws:
java.lang.Exception

testFailedAuthentication

public void testFailedAuthentication()
                              throws java.lang.Exception
Test for the wsse:FailedAuthentication faultcode. This will fail due to a bad password in the callback handler.

Throws:
java.lang.Exception

testInvalidSecurityToken

public void testInvalidSecurityToken()
                              throws java.lang.Exception
Test for the wsse:InvalidSecurityToken faultcode. This will fail due to the fact that a null username is used.

Throws:
java.lang.Exception

testInvalidSecurity

public void testInvalidSecurity()
                         throws java.lang.Exception
Test for the wsse:InvalidSecurity faultcode.

Throws:
java.lang.Exception

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws java.io.IOException,
                   javax.security.auth.callback.UnsupportedCallbackException
Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Throws:
java.io.IOException
javax.security.auth.callback.UnsupportedCallbackException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.