Package org.opensaml.xmlsec.keyinfo.impl
Class StaticKeyInfoGeneratorTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.keyinfo.impl.StaticKeyInfoGeneratorTest
-
public class StaticKeyInfoGeneratorTest extends XMLObjectBaseTestCase
Test the static KeyInfo generator.
-
-
Field Summary
Fields Modifier and Type Field Description private StringexpectedKeyAlgorithmprivate StringexpectedKeyName1private StringexpectedKeyName2private PublicKeyexpectedKeyValueprivate StaticKeyInfoGeneratorgeneratorprivate KeyInfoorigKeyInfo-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description StaticKeyInfoGeneratorTest()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckKeyInfo(KeyInfo keyInfo)Check the correctness of the generated KeyInfo.protected voidsetUp()voidtestSimple()Simple test, should return the same instance every time.voidtestWithCloningNoDOMCache()Test with cloning, original KeyInfo has no cached DOM.voidtestWithCloningWithDOMCache()Test with cloning, original KeyInfo has a cached DOM.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
generator
private StaticKeyInfoGenerator generator
-
origKeyInfo
private KeyInfo origKeyInfo
-
expectedKeyName1
private String expectedKeyName1
-
expectedKeyName2
private String expectedKeyName2
-
expectedKeyAlgorithm
private String expectedKeyAlgorithm
-
expectedKeyValue
private PublicKey expectedKeyValue
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testSimple
public void testSimple() throws SecurityException, KeyExceptionSimple test, should return the same instance every time.- Throws:
SecurityException- ...KeyException- ...
-
testWithCloningNoDOMCache
public void testWithCloningNoDOMCache() throws SecurityException, KeyExceptionTest with cloning, original KeyInfo has no cached DOM.- Throws:
SecurityException- ...KeyException- ...
-
testWithCloningWithDOMCache
public void testWithCloningWithDOMCache() throws SecurityException, KeyException, MarshallingExceptionTest with cloning, original KeyInfo has a cached DOM.- Throws:
SecurityException- ...KeyException- ...MarshallingException- ...
-
checkKeyInfo
private void checkKeyInfo(KeyInfo keyInfo) throws KeyException
Check the correctness of the generated KeyInfo.- Parameters:
keyInfo- the KeyInfo to check- Throws:
KeyException- if there is an error extracting the Java key from the KeyInfo
-
-