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


Java ICommonsList类代码示例

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


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

示例1: testUserMessageSOAPBodyPayloadEncryptSuccess

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的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.ICommonsList; //导入依赖的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.ICommonsList; //导入依赖的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.ICommonsList; //导入依赖的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.ICommonsList; //导入依赖的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.ICommonsList; //导入依赖的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: testUserMessageWithCompressedAttachmentSuccessful

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的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

示例8: testUserMessageWithCompressedSignedSuccessful

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的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

示例9: testUserMessageCompressedEncrpytedSuccessful

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的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

示例10: _convertExpressionList

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的package包/类
@Nonnull
private static STXExpressionList _convertExpressionList (@Nonnull final STXNode aNode)
{
  _expectNodeType (aNode, ParserSTXTreeConstants.JJTEXPR);
  final int nChildCount = aNode.jjtGetNumChildren ();
  if (nChildCount == 0)
    _throwUnexpectedChildrenCount (aNode, "Expected at least 1 child!");

  final ICommonsList <ISTXExpression> aExpressions = new CommonsArrayList<> ();
  for (int i = 0; i < nChildCount; ++i)
  {
    final STXNode aChildNode = aNode.jjtGetChild (i);
    aExpressions.add (_convertExpressionSingle (aChildNode));
  }

  final STXExpressionList ret = new STXExpressionList (aExpressions);
  return ret;
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:19,代码来源:STXNodeToDomainObject.java

示例11: testSignedUserMessage

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的package包/类
public static Document testSignedUserMessage (@Nonnull final ESOAPVersion eSOAPVersion,
                                              @Nullable final Node aPayload,
                                              @Nullable final ICommonsList <WSS4JAttachment> aAttachments,
                                              @Nonnull final AS4ResourceManager aResMgr) throws WSSecurityException
{

  final Document aSignedDoc = SignedMessageCreator.createSignedMessage (AS4CryptoFactory.DEFAULT_INSTANCE,
                                                                        testUserMessageSoapNotSigned (eSOAPVersion,
                                                                                                      aPayload,
                                                                                                      aAttachments),
                                                                        eSOAPVersion,
                                                                        aAttachments,
                                                                        aResMgr,
                                                                        false,
                                                                        ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT,
                                                                        ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT);
  return aSignedDoc;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:19,代码来源:MockMessages.java

示例12: _convertAxisStep

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的package包/类
@Nonnull
private static STXAxisStep _convertAxisStep (@Nonnull final STXNode aNode)
{
  _expectNodeType (aNode, ParserSTXTreeConstants.JJTAXISSTEP);
  final int nChildCount = aNode.jjtGetNumChildren ();
  if (nChildCount < 1 || nChildCount > 2)
    _throwUnexpectedChildrenCount (aNode, "Expected exactly 1 or 2 children!");

  final STXNode aChildNode = aNode.jjtGetChild (0);
  ISTXSingleStep aSingleStep;
  if (aChildNode.getNodeType () == ParserSTXTreeConstants.JJTREVERSESTEP)
    aSingleStep = _convertReverseStep (aChildNode);
  else
    aSingleStep = _convertForwardStep (aChildNode);

  final ICommonsList <STXPredicate> aPredicates = new CommonsArrayList<> ();
  if (nChildCount > 1)
  {
    final STXPredicate aPredicate = _convertPredicate (aNode.jjtGetChild (1));
    aPredicates.add (aPredicate);
  }
  return new STXAxisStep (aSingleStep, new STXPredicateList (aPredicates));
}
 
开发者ID:phax,项目名称:ph-stx,代码行数:24,代码来源:STXNodeToDomainObject.java

示例13: testUserMessageDifferentPropertiesValues

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的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

示例14: testUserMessageFinalRecipientButNoOriginalSender

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的package包/类
@Test
public void testUserMessageFinalRecipientButNoOriginalSender () throws Exception
{
  final Ebms3MessageProperties aEbms3MessageProperties = new Ebms3MessageProperties ();
  final ICommonsList <Ebms3Property> aEbms3Properties = MockEbmsHelper.getEBMSProperties ();
  aEbms3Properties.removeIf (prop -> prop.getName ().equals (CAS4.ORIGINAL_SENDER));

  assertEquals (1, aEbms3Properties.size ());

  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,
                    "originalSender property is empty or not existant but mandatory");
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:22,代码来源:PModeCheckTest.java

示例15: testReceiptMessage

import com.helger.commons.collection.impl.ICommonsList; //导入依赖的package包/类
public static Document testReceiptMessage (@Nonnull final ESOAPVersion eSOAPVersion,
                                           @Nullable final Node aPayload,
                                           @Nullable final ICommonsList <WSS4JAttachment> aAttachments,
                                           @Nonnull final AS4ResourceManager aResMgr) throws WSSecurityException,
                                                                                      DOMException
{
  final Document aUserMessage = testSignedUserMessage (eSOAPVersion, aPayload, aAttachments, aResMgr);

  final Document aDoc = ReceiptMessageCreator.createReceiptMessage (eSOAPVersion,
                                                                    MessageHelperMethods.createRandomMessageID (),
                                                                    null,
                                                                    aUserMessage,
                                                                    true)
                                             .setMustUnderstand (true)
                                             .getAsSOAPDocument ();

  final Document aSignedDoc = SignedMessageCreator.createSignedMessage (AS4CryptoFactory.DEFAULT_INSTANCE,
                                                                        aDoc,
                                                                        eSOAPVersion,
                                                                        aAttachments,
                                                                        aResMgr,
                                                                        false,
                                                                        ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT,
                                                                        ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT);
  return aSignedDoc;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:27,代码来源:MockClientMessages.java


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