Package org.codehaus.enunciate.contract.jaxws

Examples of org.codehaus.enunciate.contract.jaxws.EndpointInterface


   * Tests adding an endpoint interface.
   */
  public void testAddEndpointInterface() throws Exception {
    EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
    int originalNSSize = model.getNamespacesToPrefixes().size();
    EndpointInterface ei1 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService"));
    String targetNamespace = ei1.getTargetNamespace();
    model.add(ei1);
    assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
    WsdlInfo wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
    assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
    assertTrue(model.endpointInterfaces.contains(ei1));
    assertTrue(wsdlInfo.getEndpointInterfaces().contains(ei1));
    assertEquals(targetNamespace, wsdlInfo.getTargetNamespace());

    EndpointInterface ei2 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NoNamespaceWebServiceImpl"));
    targetNamespace = ei2.getTargetNamespace();
    model.add(ei2);
    assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
    wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
    assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
    assertTrue(model.endpointInterfaces.contains(ei2));
    assertTrue(wsdlInfo.getEndpointInterfaces().contains(ei2));
    assertEquals(targetNamespace, wsdlInfo.getTargetNamespace());

    EndpointInterface ei3 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.SuperNoNamespaceWebServiceImpl"));
    targetNamespace = ei3.getTargetNamespace();
    model.add(ei3);
    assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
    wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
    assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
    assertTrue(model.endpointInterfaces.contains(ei3));
View Full Code Here


  /**
   * Tests validating the model.
   */
  public void testValidate() throws Exception {
    final EndpointInterface ei = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService"));
    final ComplexTypeDefinition beanOne = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanOne"));
    final ComplexTypeDefinition beanTwo = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanTwo"));
    final ComplexTypeDefinition beanThree = new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanThree"));
    final Messager messager = EasyMock.createNiceMock(Messager.class);
    RootElementDeclaration beanThreeElement = new RootElementDeclaration((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanThree"), beanThree);
View Full Code Here

    assertNotNull(beanThreeField);
    assertEquals(KnownXmlType.STRING.getQname(), XmlTypeFactory.findSpecifiedType(beanThreeField).getQname());
    assertNotNull(stringBufferField);
    assertEquals(KnownXmlType.STRING.getQname(), XmlTypeFactory.findSpecifiedType(stringBufferField).getQname());

    EndpointInterface ei = new EndpointInterface(adaptedBeanExamplesDeclaration);
    WebParam beanFourParam = ei.getWebMethods().iterator().next().getWebParameters().iterator().next();
    assertNotNull(beanFourParam);
    assertEquals(new QName("http://org.codehaus.enunciate/core/samples/another", "adaptedBeanTwo"), XmlTypeFactory.findSpecifiedType(beanFourParam).getQname());

    try {
      new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.AdaptedBeanBadExamples"));
View Full Code Here

  /**
   * tests getting the imported namspaces
   */
  public void testGetImportedNamespaces() throws Exception {
    final TypeDeclaration decl = getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService");
    EndpointInterface ei1 = new EndpointInterface(decl) {
      @Override
      public Set<String> getReferencedNamespaces() {
        return new HashSet<String>(Arrays.asList("urn:ns1", "urn:ns2", "urn:ns3"));
      }
    };
    EndpointInterface ei2 = new EndpointInterface(decl) {
      @Override
      public Set<String> getReferencedNamespaces() {
        return new HashSet<String>(Arrays.asList("urn:ns3", "urn:ns4", "urn:ns5"));
      }
    };
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.contract.jaxws.EndpointInterface

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.