*/
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());