Package org.jboss.soa.esb.addressing.eprs

Examples of org.jboss.soa.esb.addressing.eprs.EmailEpr


  public void testConstructor ()
  {
    try
    {
      new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
    }
    catch (Exception ex)
    {
      fail(ex.toString());
    }
View Full Code Here


 
  public void testSetGet ()
  {
    try
    {
      EmailEpr em = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
     
      assertEquals(em.getHost(), "myhost");
      assertEquals(em.getProtocol(), EmailEpr.SMTP_PROTOCOL);
      assertEquals(em.getPort(), 25);
      assertEquals(em.getUserName(), "foo");
      assertEquals(em.getPassword(), "bar");
    }
    catch (Exception ex)
    {
      fail(ex.toString());
    }
View Full Code Here

 
  public void testToFromXML ()
  {
    try
    {
      EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
     
      final StringWriter writer = new StringWriter() ;
      final XMLStreamWriter out = XMLHelper.getXMLStreamWriter(writer) ;
     
      final QName header = new QName("header") ;
      final String origHeaderURI = StreamHelper.writeStartElement(out, header) ;
      PortReferenceHelper.toXML(out, XMLUtil.QNAME_FROM_TAG, email.getAddr()) ;
                        StreamHelper.writeEndElement(out, header.getPrefix(), origHeaderURI) ;
                        out.flush() ;
                       
                        final String content = writer.toString() ;
                        log.debug("Exported XML: "+content);
                       
                        final StringReader reader = new StringReader(content) ;
                        final XMLStreamReader in = XMLHelper.getXMLStreamReader(reader) ;
                        StreamHelper.checkNextStartTag(in, header) ;
                        StreamHelper.checkNextStartTag(in, XMLUtil.QNAME_FROM_TAG) ;
     
      PortReference pr = PortReferenceHelper.fromXML(in);     
      StreamHelper.checkEndTag(in, XMLUtil.QNAME_FROM_TAG) ;
      StreamHelper.checkParentFinished(in) ;
     
      EPR basicEpr = new EPR(pr);
      EmailEpr nEpr = new EmailEpr(basicEpr);

      assertEquals(nEpr.getAddr().getAddress(), email.getAddr().getAddress());
    }
    catch (Exception ex)
    {
      fail();
    }   
View Full Code Here

    }
  }
 
  public void testSpecificInputOutput ()
  {
    EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
   
    String tmpDir = System.getProperty("java.io.tmpdir");
    EPRManager manager = EPRManager.getInstance(tmpDir);

    try
View Full Code Here

{
  private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
 
  public void testToFromXMLString () throws MarshalException, UnmarshalException
  {
    EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
   
    String xmlString = EPRHelper.toXMLString(email);
   
    log.debug("xmlString is: "+xmlString);
   
View Full Code Here

  {
    Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);

    try
    {
      EmailEpr epr = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foo.bar", "25", "me", "password");
     
      msg.getHeader().getCall().setTo(epr);
     
      ByteArrayOutputStream s = new ByteArrayOutputStream();
      ObjectOutputStream o = new ObjectOutputStream(s);
View Full Code Here

    assertEquals(manager1.equals(manager3), false);
  }
 
  public void testInputOutput ()
  {
    EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
   
    String tmpDir = System.getProperty("java.io.tmpdir");
    EPRManager manager = EPRManager.getInstance(tmpDir);

    try
    {
      manager.saveEPR("MyEmail", email);

      EmailEpr loaded = new EmailEpr(manager.loadEPR("MyEmail"));
   
      assertEquals(loaded.getHost().equals("foobar"), true);
      assertEquals(loaded.getPassword().equals("letmein"), true);
    }
    catch (Exception ex)
    {
      log.error(ex);
     
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.eprs.EmailEpr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.