Search in sources :

Example 1 with CollectionMap

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));
    }
}
Also used : CollectionMapImpl(com.sun.xml.ws.test.CollectionMapImpl) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) CollectionMap(com.sun.xml.ws.test.CollectionMap) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) List(java.util.List) Map(java.util.Map) HashMap(java.util.HashMap) CollectionMap(com.sun.xml.ws.test.CollectionMap)

Aggregations

DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)1 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)1 CollectionMap (com.sun.xml.ws.test.CollectionMap)1 CollectionMapImpl (com.sun.xml.ws.test.CollectionMapImpl)1 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1