• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CommonsArrayList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.helger.commons.collection.impl.CommonsArrayList的典型用法代码示例。如果您正苦于以下问题:Java CommonsArrayList类的具体用法?Java CommonsArrayList怎么用?Java CommonsArrayList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommonsArrayList类属于com.helger.commons.collection.impl包,在下文中一共展示了CommonsArrayList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testUserMessageSOAPBodyPayloadEncryptSuccess

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageSOAPBodyPayloadEncryptSuccess () throws Exception
{
  final Node aPayload = DOMReader.readXMLDOM (new ClassPathResource (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML));

  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  Document aDoc = MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion, aPayload, aAttachments);
  aDoc = new EncryptionCreator (AS4CryptoFactory.DEFAULT_INSTANCE).encryptSoapBodyPayload (m_eSOAPVersion,
                                                                                           aDoc,
                                                                                           false,
                                                                                           ECryptoAlgorithmCrypt.ENCRPYTION_ALGORITHM_DEFAULT);

  final String sResponse = sendPlainMessage (new HttpXMLEntity (aDoc, m_eSOAPVersion), true, null);

  assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:17,代码来源:UserMessageSoapBodyPayloadTest.java


示例2: testUserMessageSOAPBodyPayloadSignedEncryptedSuccess

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageSOAPBodyPayloadSignedEncryptedSuccess () throws Exception
{
  final Node aPayload = DOMReader.readXMLDOM (new ClassPathResource (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML));

  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  Document aDoc = MockMessages.testSignedUserMessage (m_eSOAPVersion, aPayload, aAttachments, s_aResMgr);
  aDoc = new EncryptionCreator (AS4CryptoFactory.DEFAULT_INSTANCE).encryptSoapBodyPayload (m_eSOAPVersion,
                                                                                           aDoc,
                                                                                           false,
                                                                                           ECryptoAlgorithmCrypt.ENCRPYTION_ALGORITHM_DEFAULT);

  final String sResponse = sendPlainMessage (new HttpXMLEntity (aDoc, m_eSOAPVersion), true, null);

  assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
  assertTrue (sResponse.contains (AS4TestConstants.NON_REPUDIATION_INFORMATION));
  assertTrue (sResponse.contains (ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT.getAlgorithmURI ()));
  assertTrue (sResponse.contains (ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT.getAlgorithmURI ()));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:20,代码来源:UserMessageSoapBodyPayloadTest.java


示例3: testUserMessageOneAttachmentMimeSuccess

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageOneAttachmentMimeSuccess () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  final AS4ResourceManager aResMgr = s_aResMgr;
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  null,
                                                                  aResMgr));

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion,
                                                                   MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion,
                                                                                                              null,
                                                                                                              aAttachments),

                                                                   aAttachments);

  final String sResponse = sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);

  assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:22,代码来源:UserMessageOneAttachmentTest.java


示例4: testUserMessageOneAttachmentEncryptedMimeSuccess

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageOneAttachmentEncryptedMimeSuccess () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  final AS4ResourceManager aResMgr = s_aResMgr;
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  null,
                                                                  aResMgr));

  final MimeMessage aMsg = new EncryptionCreator (AS4CryptoFactory.DEFAULT_INSTANCE).encryptMimeMessage (m_eSOAPVersion,
                                                                                                         MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion,
                                                                                                                                                    null,
                                                                                                                                                    aAttachments),
                                                                                                         false,
                                                                                                         aAttachments,
                                                                                                         s_aResMgr,
                                                                                                         ECryptoAlgorithmCrypt.ENCRPYTION_ALGORITHM_DEFAULT);
  final String sResponse = sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);

  assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:23,代码来源:UserMessageOneAttachmentTest.java


示例5: testPayloadChangedAfterSigningShouldFail

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testPayloadChangedAfterSigningShouldFail () throws Exception
{
  final Node aPayload = DOMReader.readXMLDOM (new ClassPathResource (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML));

  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  final Document aDoc = MockMessages.testSignedUserMessage (m_eSOAPVersion, aPayload, aAttachments, s_aResMgr);
  final NodeList nList = aDoc.getElementsByTagName (m_eSOAPVersion.getNamespacePrefix () + ":Body");
  for (int i = 0; i < nList.getLength (); i++)
  {
    final Node nNode = nList.item (i);
    final Element eElement = (Element) nNode;
    eElement.setAttribute ("INVALID", "INVALID");
  }
  sendPlainMessage (new HttpXMLEntity (aDoc, m_eSOAPVersion),
                    false,
                    EEbmsError.EBMS_FAILED_DECRYPTION.getErrorCode ());
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:19,代码来源:UserMessageFailureForgeryTest.java


示例6: testUserMessageWithAttachmentPartInfoOnly

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageWithAttachmentPartInfoOnly () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  final AS4ResourceManager aResMgr = s_aResMgr;
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_TEST_XML_GZ),
                                                                  CMimeType.APPLICATION_GZIP,
                                                                  null,
                                                                  aResMgr));

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion,
                                                                   MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion,
                                                                                                              null,
                                                                                                              aAttachments),

                                                                   aAttachments);

  final SoapMimeMultipart aMultipart = (SoapMimeMultipart) aMsg.getContent ();

  // Since we want to remove the attachment
  aMultipart.removeBodyPart (1);

  aMsg.saveChanges ();
  sendMimeMessage (new HttpMimeMessageEntity (aMsg), false, EEbmsError.EBMS_EXTERNAL_PAYLOAD_ERROR.getErrorCode ());
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:26,代码来源:UserMessageFailureForgeryTest.java


示例7: testUserMessageWithOnlyAttachmentsNoPartInfo

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageWithOnlyAttachmentsNoPartInfo () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();

  final Document aSoapDoc = MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion, null, aAttachments);
  final AS4ResourceManager aResMgr = s_aResMgr;

  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_TEST_XML_GZ),
                                                                  CMimeType.APPLICATION_GZIP,
                                                                  null,
                                                                  aResMgr));

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion,
                                                                   aSoapDoc,

                                                                   aAttachments);
  aMsg.saveChanges ();
  sendMimeMessage (new HttpMimeMessageEntity (aMsg), false, EEbmsError.EBMS_EXTERNAL_PAYLOAD_ERROR.getErrorCode ());
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:21,代码来源:UserMessageFailureForgeryTest.java


示例8: testUserMessageWithCompressedAttachmentSuccessful

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Category (IHolodeckTests.class)
@Test
public void testUserMessageWithCompressedAttachmentSuccessful () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion,
                                                                   MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion,
                                                                                                              null,
                                                                                                              aAttachments),

                                                                   aAttachments);

  sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:20,代码来源:UserMessageCompressionTest.java


示例9: testUserMessageWithCompressedSignedSuccessful

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageWithCompressedSignedSuccessful () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final Document aDoc = SignedMessageCreator.createSignedMessage (AS4CryptoFactory.DEFAULT_INSTANCE,
                                                                  MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion,
                                                                                                             null,
                                                                                                             aAttachments),
                                                                  m_eSOAPVersion,
                                                                  aAttachments,
                                                                  s_aResMgr,
                                                                  false,
                                                                  ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT,
                                                                  ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT);
  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion, aDoc, aAttachments);

  sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:UserMessageCompressionTest.java


示例10: testUserMessageCompressedEncrpytedSuccessful

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageCompressedEncrpytedSuccessful () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.TEST_SOAP_BODY_PAYLOAD_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final Document aDoc = MockMessages.testUserMessageSoapNotSigned (m_eSOAPVersion, null, aAttachments);

  final MimeMessage aMsg = new EncryptionCreator (AS4CryptoFactory.DEFAULT_INSTANCE).encryptMimeMessage (m_eSOAPVersion,
                                                                                                         aDoc,
                                                                                                         false,
                                                                                                         aAttachments,
                                                                                                         s_aResMgr,
                                                                                                         ECryptoAlgorithmCrypt.ENCRPYTION_ALGORITHM_DEFAULT);
  sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:20,代码来源:UserMessageCompressionTest.java


示例11: testErrorMessage

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
public static Document testErrorMessage (@Nonnull final ESOAPVersion eSOAPVersion,
                                         @Nullable final ICommonsList <WSS4JAttachment> aAttachments,
                                         @Nonnull final AS4ResourceManager aResMgr) throws WSSecurityException
{
  final ICommonsList <Ebms3Error> aEbms3ErrorList = new CommonsArrayList <> (EEbmsError.EBMS_INVALID_HEADER.getAsEbms3Error (Locale.US,
                                                                                                                             null));
  final Document aSignedDoc = SignedMessageCreator.createSignedMessage (AS4CryptoFactory.DEFAULT_INSTANCE,
                                                                        ErrorMessageCreator.createErrorMessage (eSOAPVersion,
                                                                                                                MessageHelperMethods.createEbms3MessageInfo (),
                                                                                                                aEbms3ErrorList)
                                                                                           .setMustUnderstand (true)
                                                                                           .getAsSOAPDocument (),
                                                                        eSOAPVersion,
                                                                        aAttachments,
                                                                        aResMgr,
                                                                        false,
                                                                        ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT,
                                                                        ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT);
  return aSignedDoc;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:21,代码来源:MockMessages.java


示例12: testUserMessageDifferentPropertiesValues

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void testUserMessageDifferentPropertiesValues () throws Exception
{
  final Ebms3MessageProperties aEbms3MessageProperties = new Ebms3MessageProperties ();
  final ICommonsList <Ebms3Property> aEbms3Properties = new CommonsArrayList <> ();

  aEbms3Properties.add (_createRandomProperty ());
  aEbms3MessageProperties.setProperty (aEbms3Properties);

  m_aEbms3UserMessage.setMessageProperties (aEbms3MessageProperties);
  final Document aDoc = UserMessageCreator.getUserMessageAsAS4UserMessage (m_eSOAPVersion, m_aEbms3UserMessage)
                                          .setMustUnderstand (true)
                                          .getAsSOAPDocument (m_aPayload);

  sendPlainMessage (new HttpXMLEntity (aDoc, m_eSOAPVersion), false, "");
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:17,代码来源:PModeCheckTest.java


示例13: sendPullRequestSuccessTwoWayPushPull

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void sendPullRequestSuccessTwoWayPushPull () throws Exception
{
  // Depending on the payload a different EMEPBinding get chosen by
  // @MockPullRequestProcessorSPI
  // To Test the pull request part of the EMEPBinding
  final Document aPayload = DOMReader.readXMLDOM (new ClassPathResource ("testfiles/PushPull.xml"));
  final ICommonsList <Object> aAny = new CommonsArrayList <> ();
  aAny.add (aPayload.getDocumentElement ());

  final Document aDoc = PullRequestMessageCreator.createPullRequestMessage (m_eSOAPVersion,
                                                                            MessageHelperMethods.createEbms3MessageInfo (),
                                                                            AS4TestConstants.DEFAULT_MPC,
                                                                            aAny)
                                                 .getAsSOAPDocument ();
  final HttpEntity aEntity = new HttpXMLEntity (aDoc, m_eSOAPVersion);
  final String sResponse = sendPlainMessage (aEntity, true, null);

  assertTrue (sResponse.contains (AS4TestConstants.USERMESSAGE_ASSERTCHECK));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:21,代码来源:PullRequestTest.java


示例14: sendPullRequestSuccessTwoWayPullPush

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void sendPullRequestSuccessTwoWayPullPush () throws Exception
{
  // Depending on the payload a different EMEPBinding get chosen by
  // @MockPullRequestProcessorSPI
  // To Test the pull request part of the EMEPBinding
  final Document aPayload = DOMReader.readXMLDOM (new ClassPathResource ("testfiles/PullPush.xml"));
  final ICommonsList <Object> aAny = new CommonsArrayList <> ();
  aAny.add (aPayload.getDocumentElement ());

  final Document aDoc = PullRequestMessageCreator.createPullRequestMessage (m_eSOAPVersion,
                                                                            MessageHelperMethods.createEbms3MessageInfo (),
                                                                            AS4TestConstants.DEFAULT_MPC,
                                                                            aAny)
                                                 .getAsSOAPDocument ();
  final HttpEntity aEntity = new HttpXMLEntity (aDoc, m_eSOAPVersion);
  final String sResponse = sendPlainMessage (aEntity, true, null);

  assertTrue (sResponse.contains (AS4TestConstants.USERMESSAGE_ASSERTCHECK));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:21,代码来源:PullRequestTest.java


示例15: receiveUserMessageWithMimeAsResponseSuccessWithoutEncryption

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
@Test
public void receiveUserMessageWithMimeAsResponseSuccessWithoutEncryption () throws Exception
{
  m_aPMode.getLeg2 ().getSecurity ().setX509EncryptionAlgorithm (null);
  MetaAS4Manager.getPModeMgr ().createOrUpdatePMode (m_aPMode);

  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  null,
                                                                  s_aResMgr));

  final Document aDoc = _modifyUserMessage (m_aPMode.getID (), null, null, _defaultProperties (), aAttachments);
  final MimeMessage aMimeMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion, aDoc, aAttachments);
  final String sResponse = sendMimeMessage (new HttpMimeMessageEntity (aMimeMsg), true, null);
  assertTrue (sResponse.contains (AS4TestConstants.USERMESSAGE_ASSERTCHECK));
  assertFalse (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
  assertTrue (sResponse.contains (m_aPMode.getLeg2 ()
                                          .getSecurity ()
                                          .getX509SignatureAlgorithm ()
                                          .getAlgorithmURI ()));
  // Checking if he adds the attachment to the response message, the mock spi
  // just adds the xml that gets sent in the original message and adds it to
  // the response
  assertTrue (sResponse.contains ("<dummy>This is a test XML</dummy>"));
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:27,代码来源:TwoWayMEPTest.java


示例16: AS4_TA06

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
/**
 * Prerequisite:<br>
 * SMSH and RMSH are configured to exchange AS4 messages according to the
 * e-SENS profile (One-Way/Push MEP). Producer submits a Message with metadata
 * information and XML payload to the SMSH.<br>
 * <br>
 * Predicate: <br>
 * The SMSH generates an AS4 message with a gzip compressed payload.
 *
 * @throws Exception
 *         In case of error
 */
@Test
public void AS4_TA06 () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));
  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion,
                                                                   testSignedUserMessage (m_eSOAPVersion,
                                                                                          m_aPayload,
                                                                                          aAttachments,
                                                                                          new AS4ResourceManager ()),
                                                                   aAttachments);
  final String sResponse = sendMimeMessage (new HttpMimeMessageEntity (aMsg), true, null);
  assertTrue (sResponse.contains (AS4TestConstants.RECEIPT_ASSERTCHECK));
  assertTrue (sResponse.contains (AS4TestConstants.NON_REPUDIATION_INFORMATION));

}
 
开发者ID:phax,项目名称:ph-as4,代码行数:32,代码来源:AS4CEFOneWayFuncTest.java


示例17: AS4_TA07

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
/**
 * Prerequisite:<br>
 * SMSH and RMSH are configured to exchange AS4 messages according to the
 * e-SENS profile (One-Way/Push MEP). Producer submits a Message with metadata
 * information and payload to the SMSH.<br>
 * <br>
 * Predicate: <br>
 * In the AS4 message generated by the SMSH, a property element with name
 * "CompressionType" and value set to "application/gzip" is present.
 *
 * @throws Exception
 *         In case of error
 */
@Test
public void AS4_TA07 () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final Document aDoc = testSignedUserMessage (m_eSOAPVersion, m_aPayload, aAttachments, new AS4ResourceManager ());

  final NodeList nList = aDoc.getElementsByTagName ("eb:PartProperties");
  assertEquals (nList.item (0).getLastChild ().getAttributes ().getNamedItem ("name").getTextContent (),
                "CompressionType");
  assertEquals (nList.item (0).getLastChild ().getTextContent (), "application/gzip");
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:30,代码来源:AS4CEFOneWayFuncTest.java


示例18: AS4_TA08

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
/**
 * Prerequisite:<br>
 * SMSH and RMSH are configured to exchange AS4 messages according to the
 * e-SENS profile (One-Way/Push MEP). Producer submits a message to the SMSH
 * with payload (ex: xml document) and metadata information including a
 * property element with name "MimeType" and value ("application/xml").<br>
 * <br>
 * Predicate: <br>
 * The SMSH generates an AS4 message with the property "MimeType" present and
 * set to the value specified by the producer ("application/xml").
 *
 * @throws Exception
 *         In case of error
 */
@Test
public void AS4_TA08 () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final Document aDoc = testSignedUserMessage (m_eSOAPVersion, m_aPayload, aAttachments, new AS4ResourceManager ());

  final NodeList nList = aDoc.getElementsByTagName ("eb:PartProperties");
  assertEquals (nList.item (0).getFirstChild ().getAttributes ().getNamedItem ("name").getTextContent (), "MimeType");
  assertEquals (nList.item (0).getFirstChild ().getTextContent (), "application/xml");
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:30,代码来源:AS4CEFOneWayFuncTest.java


示例19: AS4_TA09

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
/**
 * Prerequisite:<br>
 * SMSH and RMSH are configured to exchange AS4 messages according to the
 * e-SENS profile (One-Way/Push MEP). The SMSH is simulated to send an AS4
 * message without property "MimeType" present to the RMSH.<br>
 * <br>
 * Predicate: <br>
 * The RMSH sends a synchronous ebMS error response.
 *
 * @throws Exception
 *         In case of error
 */
@Test
public void AS4_TA09 () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  aAttachments.add (WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                  CMimeType.APPLICATION_XML,
                                                                  EAS4CompressionMode.GZIP,
                                                                  s_aResMgr));

  final Document aDoc = testSignedUserMessage (m_eSOAPVersion, m_aPayload, aAttachments, new AS4ResourceManager ());

  final NodeList nList = aDoc.getElementsByTagName ("eb:PartProperties");
  nList.item (0).removeChild (nList.item (0).getFirstChild ());

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion, aDoc, aAttachments);
  sendMimeMessage (new HttpMimeMessageEntity (aMsg), false, EEbmsError.EBMS_VALUE_INCONSISTENT.getErrorCode ());
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:30,代码来源:AS4CEFOneWayFuncTest.java


示例20: AS4_TA13

import com.helger.commons.collection.impl.CommonsArrayList; //导入依赖的package包/类
/**
 * Prerequisite:<br>
 * SMSH and RMSH are configured to exchange AS4 messages according to the
 * e-SENS profile (One-Way/Push MEP). SMSH is simulated to send an AS4 User
 * Message with compressed but damaged payloads. The SMSH sends the AS4 User
 * Message to the RMSH.<br>
 * <br>
 * Predicate: <br>
 * The RMSH sends back a synchronous error response with error code "Code =
 * EBMS:0303, Short Description = DecompressionFailure, Severity = Failure,
 * Category = Communication".
 *
 * @throws Exception
 *         In case of error
 */
@Test
public void AS4_TA13 () throws Exception
{
  final ICommonsList <WSS4JAttachment> aAttachments = new CommonsArrayList <> ();
  final WSS4JAttachment aAttachment = WSS4JAttachment.createOutgoingFileAttachment (ClassPathResource.getAsFile (AS4TestConstants.ATTACHMENT_SHORTXML_XML),
                                                                                    CMimeType.APPLICATION_XML,
                                                                                    EAS4CompressionMode.GZIP,
                                                                                    s_aResMgr);
  aAttachment.setCharset (StandardCharsets.UTF_8);
  aAttachments.add (aAttachment);

  final Document aDoc = testUserMessageSoapNotSigned (m_aPayload, aAttachments);
  // Damaged payload: txt file
  aAttachments.get (0).setSourceStreamProvider (new ClassPathResource ("attachment/CompressedPayload.txt"));

  final MimeMessage aMsg = MimeMessageCreator.generateMimeMessage (m_eSOAPVersion, aDoc, aAttachments);
  sendMimeMessage (new HttpMimeMessageEntity (aMsg), false, EEbmsError.EBMS_DECOMPRESSION_FAILURE.getErrorCode ());
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:34,代码来源:AS4CEFOneWayFuncTest.java



注:本文中的com.helger.commons.collection.impl.CommonsArrayList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NMTokenSecretManagerInNM类代码示例发布时间:2022-05-22
下一篇:
Java SubscriptionPersistenceUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap