Package org.jboss.soa.esb.addressing

Examples of org.jboss.soa.esb.addressing.PortReference


   * @deprecated
   */
 
  public final void setURL (URL url)
  {
    super.setAddr(new PortReference(url.toString()));
  }
View Full Code Here


        assertValidLogicalURI(URI.create(addr.getAddress()));
        super.setAddr(addr);
    }

    public Service toService() {
        PortReference portRef = getAddr();

        if(portRef == null) {
            throw new IllegalStateException("Invalid Logical EPR state.  No PortReference set on EPR.");
        }

        URI uri;
        try {
            uri = new URI(portRef.getAddress());
        } catch (URISyntaxException e) {
            throw new IllegalStateException("Invalid Logical EPR state.  '" + portRef.getAddress() + "' is not a valid URI.", e);
        }

        assertValidLogicalURI(uri);

        return new Service(uri.getSchemeSpecificPart(), uri.getFragment());
View Full Code Here

        epr = new LogicalEPR(URI.create("logical:My%20/%20Category#My%20/%20Name"));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR(new PortReference("logical:My%20/%20Category#My%20/%20Name"));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());
       
        epr = new LogicalEPR(new EPR(URI.create("logical:My%20/%20Category#My%20/%20Name")));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR(new EPR(new PortReference("logical:My%20/%20Category#My%20/%20Name")));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR();
        epr.setAddr(new PortReference("logical:My%20/%20Category#My%20/%20Name"));
        assertEquals("logical:My%20/%20Category#My%20/%20Name", epr.getAddr().getAddress());
        assertEquals("My / Category", epr.toService().getCategory());
        assertEquals("My / Name", epr.toService().getName());

        epr = new LogicalEPR("1234567890 -=`!\"£$%^&*()_+\\|,./;'#[]<>?:@~{}", "1234567890 -=`!\"£$%^&*()_+\\|,./;'#[]<>?:@~{}");
 
View Full Code Here

        } catch (IllegalArgumentException e) {
            assertEquals("'xxxx:a#b' is not a valid URI for a Logical EPR - URI scheme must be 'logical'.", e.getMessage());
        }

        try {
            new LogicalEPR(new PortReference("logical://a#b"));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'logical://a#b' is not a valid URI for a Logical EPR - URI must be opaque.", e.getMessage());
        }

        try {
            new LogicalEPR(new EPR(URI.create("xxxx:a#b")));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'xxxx:a#b' is not a valid URI for a Logical EPR - URI scheme must be 'logical'.", e.getMessage());
        }

        try {
            new LogicalEPR(new EPR(new PortReference("logical://a#b")));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'logical://a#b' is not a valid URI for a Logical EPR - URI must be opaque.", e.getMessage());
        }

        try {
            LogicalEPR epr = new LogicalEPR();
            epr.setAddr(new PortReference("logical:a"));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("'logical:a' is not a valid URI for a Logical EPR - no URI fragment (service name) part.", e.getMessage());
        }

        try {
            LogicalEPR epr = new LogicalEPR();
            epr.setAddr(new PortReference("logical:#b"));
            fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            assertEquals("Expected scheme-specific part at index 8: logical:#b", e.getCause().getMessage());
        }
    }
View Full Code Here

    public void test_Serialize_Deserialize()
        throws Exception
    {
        Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);

        EPR epr = new LogicalEPR(new PortReference("logical:a#b"));

        msg.getHeader().getCall().setTo(epr);

        final String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)msg) ;
View Full Code Here

    log.debug("Default EPR: "+epr);
  }
 
  public void testPortReferenceConstructor ()
  {
    EPR epr = new EPR(new PortReference("http://localhost:8080"));
   
    assertEquals(epr.getAddr().getAddress(), "http://localhost:8080");
  }
View Full Code Here

 
  public void testSetAddr ()
  {
    EPR epr = new EPR();
   
    epr.setAddr(new PortReference("http://localhost"));

    try
    {
      assertEquals(epr.getAddr().getAddress(), "http://localhost");
    }
View Full Code Here

                        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);
View Full Code Here

  }
 
  private static PortReference readToXML(final XMLStreamReader in)
      throws XMLStreamException
  {
      final PortReference portReference = new PortReference() ;
      final TextElement toElement = new TextElement(in) ;
      portReference.setAddress(toElement.getText()) ;
      return portReference ;
  }
View Full Code Here

        }

        public static EPR fromXML(XMLStreamReader in)
            throws XMLStreamException
        {
            final PortReference portReference = PortReferenceHelper.fromXML(in) ;
            return getSpecificEPR(new EPR(portReference)) ;
        }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.PortReference

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.