コード例 #1
0
  public void testSelectPort_portType() {
    QName portTypeName = new QName("http://example.com/translator", "textTranslator");

    SoapEndpointReference reference = getReference();
    reference.setPortTypeName(portTypeName);
    Port port = reference.selectPort(catalog);

    assertEquals(portTypeName, port.getBinding().getPortType().getQName());
  }
コード例 #2
0
  public void testSelectPort_service() {
    QName portTypeName = new QName("urn:samples:ATMService", "atm");
    QName serviceName = new QName("urn:samples:ATMService", "atmService");

    SoapEndpointReference reference = getReference();
    reference.setPortTypeName(portTypeName);
    reference.setServiceName(serviceName);
    Port port = reference.selectPort(catalog);

    assertEquals(portTypeName, port.getBinding().getPortType().getQName());
    assertTrue(hasPort(serviceName, port));
  }
コード例 #3
0
  public void testSelectPort_portType_address() {
    QName portTypeName = new QName("http://example.com/translator", "textTranslator");
    String address = "http://mirror.example.com/translator/text";

    SoapEndpointReference reference = getReference();
    reference.setPortTypeName(portTypeName);
    reference.setAddress(address);
    Port port = reference.selectPort(catalog);

    assertEquals(portTypeName, port.getBinding().getPortType().getQName());
    assertEquals(address, SoapEndpointReference.getSoapAddress(port));
  }
コード例 #4
0
  public void testSelectPort_service_port() {
    QName portTypeName = new QName("http://example.com/translator", "documentTranslator");
    QName serviceName = new QName("http://example.com/translator", "translatorService");
    String portName = "documentTranslatorPort";

    SoapEndpointReference reference = getReference();
    reference.setPortTypeName(portTypeName);
    reference.setServiceName(serviceName);
    reference.setPortName(portName);
    Port port = reference.selectPort(catalog);

    assertEquals(portTypeName, port.getBinding().getPortType().getQName());
    assertTrue(hasPort(serviceName, port));
    assertEquals(portName, port.getName());
  }