Package org.apache.cxf.binding.corba

Examples of org.apache.cxf.binding.corba.CorbaTypeMap


    }
   
    @Test
    public void testErrorConditionNullTypeQName() {
        try {
            CorbaUtils.getTypeCode(orb, null, new CorbaTypeMap("dud:namespace"));
            fail("expect exception on null type");
        } catch (CorbaBindingException expected) {
            //ignore
        }
       
        CorbaTypeMap typeMap = new CorbaTypeMap("dud:namespace");
        QName seen = new QName("bla", "Bla");
        Stack<QName> seenTypes = new Stack<QName>();           
        seenTypes.add(seen);
        try {
            CorbaUtils.getTypeCode(orb, null, typeMap, seenTypes);
View Full Code Here


        CorbaMessage message = (CorbaMessage) msg;

        Exchange exchange = message.getExchange();

        CorbaTypeMap typeMap = message.getCorbaTypeMap();

        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();
        String opName = exchange.get(String.class);
        Iterator i = bInfo.getOperations().iterator();
View Full Code Here

        a.insert_string("TestMessage");

        QName anyName = new QName("AnyHandlerName");
        QName anyIdlType = CorbaConstants.NT_CORBA_ANY;
        TypeCode anyTC = orb.get_primitive_tc(TCKind.from_int(TCKind._tk_any));
        CorbaTypeMap tm = new CorbaTypeMap(CorbaConstants.NU_WSDL_CORBA);
       
        CorbaAnyHandler anyHandler = new CorbaAnyHandler(anyName, anyIdlType, anyTC, null);
        anyHandler.setTypeMap(tm);

        // Test the get/set value methods
        anyHandler.setValue(a);
        Any resultAny = anyHandler.getValue();

        assertNotNull(resultAny);

        String value = resultAny.extract_string();
        assertEquals("TestMessage", value);

        // Test get/set CorbaTypeMap methods
        CorbaTypeMap resultTM = anyHandler.getTypeMap();
        assertTrue(resultTM.getTargetNamespace().equals(CorbaConstants.NU_WSDL_CORBA));
    }
View Full Code Here

        }
        return null;
    }

    public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
        CorbaTypeMap map = null;
        if (tmTypes != null) {
            //Currently, only one type map
            TypeMappingType tmType = tmTypes.get(0);
            map = new CorbaTypeMap(tmType.getTargetNamespace());

            List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
            LOG.fine("Found " + types.size() + " types defined in the typemap");
            for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
                CorbaTypeImpl corbaType = it.next();
                String name = corbaType.getName();
                // There can be some instances where a prefix is added to the name by the tool
                // (e.g. Object Reference Names).  Since the name is read as a string, this
                // prefix is added to the types name.  Remove this as it is not needed.
                int pos = name.lastIndexOf(":");
                if (pos != -1) {
                    name = name.substring(pos + 1);
                    corbaType.setName(name);
                }

                map.addType(name, corbaType);
                LOG.fine("Adding type " + name);
            }
        }
        return map;
    }
View Full Code Here

        }
        return null;
    }

    public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
        CorbaTypeMap map = null;
        if (tmTypes != null) {
            //Currently, only one type map
            TypeMappingType tmType = tmTypes.get(0);
            map = new CorbaTypeMap(tmType.getTargetNamespace());

            List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
            LOG.fine("Found " + types.size() + " types defined in the typemap");
            for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
                CorbaTypeImpl corbaType = it.next();
                String name = corbaType.getName();
                // There can be some instances where a prefix is added to the name by the tool
                // (e.g. Object Reference Names).  Since the name is read as a string, this
                // prefix is added to the types name.  Remove this as it is not needed.
                int pos = name.lastIndexOf(":");
                if (pos != -1) {
                    name = name.substring(pos + 1);
                    corbaType.setName(name);
                }
                   
                map.addType(name, corbaType);
                LOG.fine("Adding type " + name);
            }
        }
        return map;
    }
View Full Code Here

            }

            Iterator<?> tm = model.getExtensibilityElements().iterator();
            assertTrue(tm.hasNext());
            TypeMappingType tmt = (TypeMappingType)tm.next();
            CorbaTypeMap typeMap = CorbaUtils.createCorbaTypeMap(Arrays.asList(tmt));

            assertNull("All nested anonymous types should have \"nested\" names", typeMap.getType("item"));

            // Checkstyle forces me to split the method...
            assertMixedArraysMappingEasyTypes(typeMap);

            // elem types are no longer strings from now.
View Full Code Here

        }
        return null;
    }

    public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
        CorbaTypeMap map = null;
        if (tmTypes != null) {
            //Currently, only one type map
            TypeMappingType tmType = tmTypes.get(0);
            map = new CorbaTypeMap(tmType.getTargetNamespace());

            List<CorbaType> types = tmType.getStructOrExceptionOrUnion();
            LOG.fine("Found " + types.size() + " types defined in the typemap");
            for (Iterator<CorbaType> it = types.iterator(); it.hasNext();) {
                CorbaType corbaType = it.next();
                String name = corbaType.getName();
                // There can be some instances where a prefix is added to the name by the tool
                // (e.g. Object Reference Names).  Since the name is read as a string, this
                // prefix is added to the types name.  Remove this as it is not needed.
                int pos = name.lastIndexOf(":");
                if (pos != -1) {
                    name = name.substring(pos + 1);
                    corbaType.setName(name);
                }

                map.addType(name, corbaType);
                LOG.fine("Adding type " + name);
            }
        }
        return map;
    }
View Full Code Here

        }
        return null;
    }

    public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
        CorbaTypeMap map = null;
        if (tmTypes != null) {
            //Currently, only one type map
            TypeMappingType tmType = tmTypes.get(0);
            map = new CorbaTypeMap(tmType.getTargetNamespace());

            List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
            LOG.fine("Found " + types.size() + " types defined in the typemap");
            for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
                CorbaTypeImpl corbaType = it.next();
                String name = corbaType.getName();
                // There can be some instances where a prefix is added to the name by the tool
                // (e.g. Object Reference Names).  Since the name is read as a string, this
                // prefix is added to the types name.  Remove this as it is not needed.
                int pos = name.lastIndexOf(":");
                if (pos != -1) {
                    name = name.substring(pos + 1);
                    corbaType.setName(name);
                }

                map.addType(name, corbaType);
                LOG.fine("Adding type " + name);
            }
        }
        return map;
    }
View Full Code Here

        CorbaMessage message = (CorbaMessage) msg;

        Exchange exchange = message.getExchange();

        CorbaTypeMap typeMap = message.getCorbaTypeMap();

        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();
        String opName = exchange.get(String.class);
        Iterator<BindingOperationInfo> i = bInfo.getOperations().iterator();
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.corba.CorbaTypeMap

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.