org.openmdx.test.security.auth
Class TestAuthenticatedPrincipals

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.openmdx.test.security.auth.TestAuthenticatedPrincipals
All Implemented Interfaces:
junit.framework.Test

public class TestAuthenticatedPrincipals
extends junit.framework.TestCase


Field Summary
static String GROUP_TYPE
          A group principal
protected static Principal[] PRINCIPAL_SET
           
static String PRINCIPAL_TYPE
          A generic principal
protected  org.openmdx.kernel.security.token.TokenFactory tokenFactory
           
protected  org.openmdx.kernel.security.token.TokenValidator tokenValidator
           
 
Constructor Summary
TestAuthenticatedPrincipals()
          Constructor
TestAuthenticatedPrincipals(String name)
          Constructor
 
Method Summary
 void consume(String cookie)
           
protected  String getAlgorithm()
           
protected  String getAlias()
           
protected  Key getKey(KeyStore keyStore, String alias, String passphrase)
          Get a spoecific key
protected static KeyStore getKeyStore(String keyStoreType, String keyStoreFileName, String keyStorePassPhrase)
          Get a specific Key Store
protected  String getKeyStoreFileName()
           
protected  String getKeyStorePassPhrase()
           
protected  String getKeyStoreType()
           
protected  String getPrivateKeyPassPhrase()
           
static void main(String[] args)
          The batch TestRunner can be given a class to run directly.
 String produce()
           
protected  void setUp()
           
static junit.framework.Test suite()
          A test runner either expects a static method suite as the entry point to get a test to run or it will extract the suite automatically.
 void testCookie()
          Coookie test
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tokenFactory

protected org.openmdx.kernel.security.token.TokenFactory tokenFactory

tokenValidator

protected org.openmdx.kernel.security.token.TokenValidator tokenValidator

PRINCIPAL_TYPE

public static final String PRINCIPAL_TYPE
A generic principal

See Also:
Constant Field Values

GROUP_TYPE

public static final String GROUP_TYPE
A group principal

See Also:
Constant Field Values

PRINCIPAL_SET

protected static final Principal[] PRINCIPAL_SET
Constructor Detail

TestAuthenticatedPrincipals

public TestAuthenticatedPrincipals()
Constructor


TestAuthenticatedPrincipals

public TestAuthenticatedPrincipals(String name)
Constructor

Parameters:
name -
Method Detail

main

public static void main(String[] args)
The batch TestRunner can be given a class to run directly. To start the batch runner from your main you can write:


suite

public static junit.framework.Test suite()
A test runner either expects a static method suite as the entry point to get a test to run or it will extract the suite automatically.


getAlias

protected String getAlias()

getKeyStorePassPhrase

protected String getKeyStorePassPhrase()

getPrivateKeyPassPhrase

protected String getPrivateKeyPassPhrase()

getAlgorithm

protected String getAlgorithm()

getKeyStoreType

protected String getKeyStoreType()

getKeyStoreFileName

protected String getKeyStoreFileName()

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

getKeyStore

protected static KeyStore getKeyStore(String keyStoreType,
                                      String keyStoreFileName,
                                      String keyStorePassPhrase)
                               throws KeyStoreException,
                                      NoSuchAlgorithmException,
                                      CertificateException,
                                      IOException
Get a specific Key Store

Parameters:
keyStoreType -
keyStoreFileName -
keyStorePassPhrase -
Returns:
the initialized key store
Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

getKey

protected Key getKey(KeyStore keyStore,
                     String alias,
                     String passphrase)
              throws KeyStoreException,
                     NoSuchAlgorithmException,
                     UnrecoverableKeyException
Get a spoecific key

Parameters:
keyStore -
alias -
passphrase -
Returns:
the requested key
Throws:
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException

testCookie

public void testCookie()
                throws Throwable
Coookie test

Throws:
Throwable

produce

public String produce()
               throws org.openmdx.kernel.security.token.TokenException
Throws:
org.openmdx.kernel.security.token.TokenException

consume

public void consume(String cookie)
             throws org.openmdx.kernel.security.token.TokenException
Throws:
org.openmdx.kernel.security.token.TokenException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.