summaryrefslogtreecommitdiff
path: root/bkucommon/src/test/java/at/gv/egiz
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-11-24 18:48:00 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-11-24 18:48:00 +0000
commit5af9b75dccc1b52d1382fe0f2df30affd509f5b9 (patch)
tree8640f3e4f0446e85cbe34f2d87916e187f5b40ad /bkucommon/src/test/java/at/gv/egiz
parent650732adaff82503b19a41b6c53d4299be9a1533 (diff)
downloadmocca-5af9b75dccc1b52d1382fe0f2df30affd509f5b9.tar.gz
mocca-5af9b75dccc1b52d1382fe0f2df30affd509f5b9.tar.bz2
mocca-5af9b75dccc1b52d1382fe0f2df30affd509f5b9.zip
Filenames derived from reference URI
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@553 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/test/java/at/gv/egiz')
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java50
1 files changed, 49 insertions, 1 deletions
diff --git a/bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java b/bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java
index 7ce7b42d..ccd29e85 100644
--- a/bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java
+++ b/bkucommon/src/test/java/at/gv/egiz/bku/slcommands/impl/xsect/SignatureTest.java
@@ -443,8 +443,11 @@ public class SignatureTest {
@SuppressWarnings("unchecked")
@Test
+
public void testDataObject_XMLContent_1() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_XMLContent_1 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_XMLContent_1.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -485,6 +488,8 @@ public class SignatureTest {
@Test
public void testDataObject_XMLContent_2() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_XMLContent_2 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_XMLContent_2.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -526,6 +531,8 @@ public class SignatureTest {
@Test
public void testDataObject_LocRefContent_1() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_LocRefContent_1 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_LocRefContent_1.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -535,7 +542,7 @@ public class SignatureTest {
}
signature.buildXMLSignature();
-
+
signAndMarshalSignature(signature);
List<Reference> references = signature.getReferences();
@@ -564,6 +571,8 @@ public class SignatureTest {
@Test
public void testDataObject_LocRefContent_2() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_LocRefContent_2 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_LocRefContent_2.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -602,6 +611,8 @@ public class SignatureTest {
@Test
public void testDataObject_Reference_1() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_Reference_1 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_Reference_1.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -640,6 +651,8 @@ public class SignatureTest {
@Test
public void testDataObject_Detached_1() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_Detached_1 \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_Detached_1.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -671,6 +684,8 @@ public class SignatureTest {
@Test
public void testDataObject_Detached_Base64Content() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+ System.out.println("\n ****************** testDataObject_Detached_Base64Content \n");
+
List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_Detached_Base64Content.xml");
Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
@@ -698,6 +713,39 @@ public class SignatureTest {
}
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testDataObject_Detached_LocRefContent() throws JAXBException, SLCommandException, XMLStreamException, SLRequestException, MarshalException, XMLSignatureException, SLViewerException {
+
+ System.out.println("\n ****************** testDataObject_Detached_LocRefContent \n");
+
+ List<DataObjectInfoType> dataObjectInfos = unmarshalDataObjectInfo("DataObjectInfo_Detached_LocRefContent.xml");
+
+ Signature signature = new Signature(null, new IdValueFactoryImpl(), new AlgorithmMethodFactoryImpl());
+
+ for (DataObjectInfoType dataObjectInfo : dataObjectInfos) {
+ signature.addDataObject(dataObjectInfo);
+ }
+
+ signature.buildXMLSignature();
+
+ signAndMarshalSignature(signature);
+
+ List<Reference> references = signature.getReferences();
+ assertTrue(references.size() == 2);
+
+ Reference reference = references.get(0);
+ assertNotNull(reference.getId());
+
+ List<Transform> transforms = reference.getTransforms();
+ assertTrue(transforms.size() == 0);
+
+ List<XMLObject> objects = signature.getXMLObjects();
+ assertNotNull(objects);
+ assertTrue(objects.size() == 1);
+
+ }
+
//
//
// TransformsInfo