Package org.codehaus.enunciate.template.freemarker

Examples of org.codehaus.enunciate.template.freemarker.ClientClassnameForMethod


   */
  public void testClientClassnameFor() throws Exception {
    HashMap<String, String> conversions = new HashMap<String, String>();
    conversions.put("org.codehaus.enunciate.samples", "red.herring");
    conversions.put("org.codehaus.enunciate.samples.xfire_client.with.a.nested", "org.codehaus.enunciate.other.pckg.and.nested");
    ClientClassnameForMethod classnameFor14Method = new ClientClassnameForMethod(conversions);
    ClientClassnameForMethod classnameFor15Method = new ClientClassnameForMethod(conversions);
    classnameFor15Method.setJdk15(true);
    TypeDeclaration classDeclaration = getDeclaration("org.codehaus.enunciate.samples.xfire_client.with.a.nested.pckg.NestedPackageClass");
    assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg.NestedPackageClass", classnameFor14Method.convert(classDeclaration));
    assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg.NestedPackageClass", classnameFor15Method.convert(classDeclaration));
    for (FieldDeclaration fieldDeclaration : classDeclaration.getFields()) {
      if ("items".equals(fieldDeclaration.getSimpleName())) {
        assertEquals(Collection.class.getName(), classnameFor14Method.convert(fieldDeclaration.getType()));
        assertEquals("java.util.Collection<org.codehaus.enunciate.other.pckg.and.nested.pckg.NestedPackageItem>", classnameFor15Method.convert(fieldDeclaration.getType()));
      }
      else if ("type".equals(fieldDeclaration.getSimpleName())) {
        assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg.NestedPackageEnum", classnameFor14Method.convert(fieldDeclaration.getType()));
        assertEquals("org.codehaus.enunciate.other.pckg.and.nested.pckg.NestedPackageEnum", classnameFor15Method.convert(fieldDeclaration.getType()));
      }
    }

    classDeclaration = getDeclaration("org.codehaus.enunciate.samples.xfire_client.with.a.nested.pckg.NestedPackageItem");
    for (FieldDeclaration fieldDeclaration : classDeclaration.getFields()) {
      if ("property1".equals(fieldDeclaration.getSimpleName())) {
        assertEquals("boolean", classnameFor14Method.convert(fieldDeclaration.getType()));
        assertEquals("boolean", classnameFor15Method.convert(fieldDeclaration.getType()));
      }
      else if ("property2".equals(fieldDeclaration.getSimpleName())) {
        assertEquals("int[]", classnameFor14Method.convert(fieldDeclaration.getType()));
        assertEquals("int[]", classnameFor15Method.convert(fieldDeclaration.getType()));
      }
    }

    try {
      classnameFor14Method.convert(classDeclaration.getPackage());
View Full Code Here


  private final Set<String> serverSideTypesToUse;
  private final ClientClassnameForMethod clientConversion;

  public JavaClientValidator(Set<String> serverSideTypesToUse, Map<String, String> packageConversions) {
    this.serverSideTypesToUse = serverSideTypesToUse;
    this.clientConversion = new ClientClassnameForMethod(packageConversions);
  }
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.template.freemarker.ClientClassnameForMethod

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.