use of com.sun.xml.ws.test.CollectionMap in project metro-jax-ws by eclipse-ee4j.
the class EclipselinkJAXBBasicTest method testCollectionMap.
public void testCollectionMap() throws Exception {
Class<?> endpointClass = CollectionMapImpl.class;
Class<?> proxySEIClass = CollectionMap.class;
DatabindingConfig srvConfig = new DatabindingConfig();
srvConfig.setEndpointClass(endpointClass);
DatabindingModeFeature dbm = databindingMode();
WebServiceFeature[] f = { dbm };
srvConfig.setFeatures(f);
DatabindingConfig cliConfig = new DatabindingConfig();
cliConfig.setContractClass(proxySEIClass);
cliConfig.setFeatures(f);
CollectionMap p = createProxy(CollectionMap.class, srvConfig, cliConfig, false);
{
List<String> req = Arrays.asList("x", "Eclipselink", "parameterized", "List");
List<String> res = p.echoListOfString(req);
assertEqualList(req, res);
}
{
Integer[] num = { 123, -456, 789, 0 };
Map<String, Integer> req = new HashMap<String, Integer>();
for (Integer i : num) req.put(i.toString(), i);
Map<Integer, String> res = p.echoMapOfString(req);
Map<Integer, String> ans = new HashMap<Integer, String>();
for (Integer i : num) ans.put(i, i.toString());
assertTrue(equalsMap(ans, res));
}
}
Aggregations