当前位置: 首页>>代码示例>>Java>>正文


Java CommonsArrayList类代码示例

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


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


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