Skip to content

Commit

Permalink
Prepared for release
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Nov 17, 2024
1 parent e3f82b3 commit 09d9d9e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void _send (@Nonnull final IAS4CryptoFactory aCF, final Path aSen
aClient.signingParams ().setAlgorithmSign (ECryptoAlgorithmSign.RSA_SHA_512);
aClient.signingParams ().setAlgorithmSignDigest (ECryptoAlgorithmSignDigest.DIGEST_SHA_512);

// FIXME Action, Service etc. are missing
// TODO Action, Service etc. need to be provided by you
aClient.setAction ("xxx");
aClient.setServiceType ("xxx");
aClient.setServiceValue ("xxx");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ public void testAS4_TA03 () throws Exception
aEbms3PartyInfo,
aEbms3MessageProperties,
null,
m_eSoapVersion)
.setMustUnderstand (true);
m_eSoapVersion).setMustUnderstand (true);

final Document aSignedDoc = AS4Signer.createSignedMessage (m_aCryptoFactory,
aMsg.getAsSoapDocument (m_aPayload),
Expand Down Expand Up @@ -202,14 +201,13 @@ public void testAS4_TA06 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeType (CMimeType.APPLICATION_XML)
.compression (EAS4CompressionMode.GZIP)
.build (),
s_aResMgr));
.build (), s_aResMgr));
final AS4MimeMessage aMsg = AS4MimeMessageHelper.generateMimeMessage (m_eSoapVersion,
createTestSignedUserMessage (m_eSoapVersion,
m_aPayload,
aAttachments,
s_aResMgr),
aAttachments);
createTestSignedUserMessage (m_eSoapVersion,
m_aPayload,
aAttachments,
s_aResMgr),
aAttachments);
final String sResponse = sendMimeMessage (HttpMimeMessageEntity.create (aMsg), true, null);
assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
assertTrue (sResponse.contains (AS4TestConstants.NON_REPUDIATION_INFORMATION));
Expand All @@ -236,8 +234,7 @@ public void testAS4_TA07 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeType (CMimeType.APPLICATION_XML)
.compression (EAS4CompressionMode.GZIP)
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -271,8 +268,7 @@ public void testAS4_TA08 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -303,8 +299,7 @@ public void testAS4_TA09 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -421,7 +416,7 @@ public void testAS4_TA11 () throws Exception
@Test
public void testAS4_TA12 ()
{
// XXX
// empty so far
}

/**
Expand Down Expand Up @@ -457,8 +452,8 @@ public void testAS4_TA13 () throws Exception
aAttachments.get (0).setSourceStreamProvider (new ClassPathResource ("attachment/CompressedPayload.txt"));

final AS4MimeMessage aMimeMsg = AS4MimeMessageHelper.generateMimeMessage (m_eSoapVersion,
aMsg.getAsSoapDocument (m_aPayload),
aAttachments);
aMsg.getAsSoapDocument (m_aPayload),
aAttachments);
sendMimeMessage (HttpMimeMessageEntity.create (aMimeMsg),
false,
EEbmsError.EBMS_DECOMPRESSION_FAILURE.getErrorCode ());
Expand Down Expand Up @@ -502,8 +497,7 @@ public void testAS4_TA15 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -532,20 +526,17 @@ public void testAS4_TA16 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_TEST_IMG_JPG))
.mimeType (CMimeType.IMAGE_JPG)
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML2_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -573,8 +564,7 @@ public void testAS4_TA17 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand Down Expand Up @@ -605,8 +595,7 @@ public void testAS4_TA18 () throws Exception
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final Document aDoc = createTestSignedUserMessage (m_eSoapVersion, m_aPayload, aAttachments, s_aResMgr);

Expand All @@ -615,8 +604,7 @@ public void testAS4_TA18 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final AS4MimeMessage aMsg = AS4MimeMessageHelper.generateMimeMessage (m_eSoapVersion, aDoc, aAttachments);
sendMimeMessage (HttpMimeMessageEntity.create (aMsg), false, EEbmsError.EBMS_VALUE_INCONSISTENT.getErrorCode ());
Expand All @@ -641,8 +629,7 @@ public void testAS4_TA19 () throws Exception
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final AS4UserMessage aMsg = MockMessages.createUserMessageNotSigned (m_eSoapVersion, null, aAttachments);
final AS4MimeMessage aMimeMsg = AS4Encryptor.encryptToMimeMessage (m_eSoapVersion,
Expand Down Expand Up @@ -691,7 +678,7 @@ public void testAS4_TA20 () throws Exception
// Compression
final NonBlockingByteArrayOutputStream aCompressedOS = new NonBlockingByteArrayOutputStream ();
try (final InputStream aIS = new NonBlockingByteArrayInputStream (aSrc);
final OutputStream aOS = EAS4CompressionMode.GZIP.getCompressStream (aCompressedOS))
final OutputStream aOS = EAS4CompressionMode.GZIP.getCompressStream (aCompressedOS))
{
StreamHelper.copyInputStreamToOutputStream (aIS, aOS);
}
Expand Down Expand Up @@ -722,8 +709,7 @@ public void testAS4_TA21 () throws Exception
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.compressionGZIP ()
.build (),
s_aResMgr));
.build (), s_aResMgr));

final AS4UserMessage aMsg = MockMessages.createUserMessageNotSigned (m_eSoapVersion, null, aAttachments);
final Document aDoc = AS4Signer.createSignedMessage (m_aCryptoFactory,
Expand Down Expand Up @@ -807,20 +793,18 @@ public void testAS4_TA28 () throws Exception
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML))
.mimeTypeXML ()
.build (),
s_aResMgr));
.build (), s_aResMgr));
aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (AS4OutgoingAttachment.builder ()
.data (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_TEST_IMG_JPG))
.mimeType (CMimeType.IMAGE_JPG)
.build (),
s_aResMgr));
.build (), s_aResMgr));

final AS4MimeMessage aMsg = AS4MimeMessageHelper.generateMimeMessage (m_eSoapVersion,
MockMessages.createUserMessageNotSigned (m_eSoapVersion,
null,
aAttachments)
.getAsSoapDocument (),
aAttachments);
MockMessages.createUserMessageNotSigned (m_eSoapVersion,
null,
aAttachments)
.getAsSoapDocument (),
aAttachments);
final String sResponse = sendMimeMessage (HttpMimeMessageEntity.create (aMsg), true, null);

assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public final class HolodeckOnlineTestSuite
{
/** The default URL where Holodeck is supposed to run */
// TODO will be changed soon
// TODO change to whatever you use
public static final String DEFAULT_HOLODECK_URI = "http://localhost:8080/msh";

private static ScopedAS4Configuration s_aSC;
Expand Down

0 comments on commit 09d9d9e

Please sign in to comment.