Package org.omg.CORBA

Examples of org.omg.CORBA.Any.type()


        long ulonglongValue = 123456789;
        any.insert_ulonglong(ulonglongValue);
        anyHandler.setValue(any);
        expectedSchemaType = "xs:unsignedLong";
        result = anyHandler.getValue();
        assertTrue(result.type().kind().value() == TCKind._tk_ulonglong);
        long ulonglongResult = result.extract_ulonglong();
        assertTrue(ulonglongResult == ulonglongValue);
        resultSchemaType = anyHandler.getSchemaType();
        assertTrue(resultSchemaType.equals(expectedSchemaType));
View Full Code Here


        double doubleValue = 1234.56;
        any.insert_double(doubleValue);
        anyHandler.setValue(any);
        expectedSchemaType = "xs:double";
        result = anyHandler.getValue();
        assertTrue(result.type().kind().value() == TCKind._tk_double);
        double doubleResult = result.extract_double();
        assertTrue(doubleResult == doubleValue);
        resultSchemaType = anyHandler.getSchemaType();
        assertTrue(resultSchemaType.equals(expectedSchemaType));
View Full Code Here

        float floatValue = 123456.78f;
        any.insert_float(floatValue);
        anyHandler.setValue(any);
        expectedSchemaType = "xs:float";
        result = anyHandler.getValue();
        assertTrue(result.type().kind().value() == TCKind._tk_float);
        float floatResult = result.extract_float();
        assertTrue(floatResult == floatValue);
        resultSchemaType = anyHandler.getSchemaType();
        assertTrue(resultSchemaType.equals(expectedSchemaType));
       
View Full Code Here

        String stringValue = "test string";
        any.insert_string(stringValue);
        anyHandler.setValue(any);
        expectedSchemaType = "xs:string";
        result = anyHandler.getValue();
        assertTrue(result.type().kind().value() == TCKind._tk_string);
        String stringResult = result.extract_string();
        assertTrue(stringResult == stringValue);
        resultSchemaType = anyHandler.getSchemaType();
        assertTrue(resultSchemaType.equals(expectedSchemaType));
View Full Code Here

                break;

            default:
                try {
                    Any a = orb.create_any();
                    a.type(tc);
                    d1 = factory.create_dyn_any_from_type_code(tc);
                    d1.from_any(a);
                    TEST("from_any() should not have succeeded" == null);
                } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) {
                    // expected
View Full Code Here

     * @return the object read from the stream.
     */
    public Object readAny(InputStream in)
    {
        Any any = in.read_any();
        if ( any.type().kind().value() == TCKind._tk_objref )
            return any.extract_Object ();
        else
            return any.extract_Value();
    }

View Full Code Here

    public void unmarshalReply(InputStream is)
    {
        // First unmarshal the return value if it is not void
        if ( _result != null ) {
            Any returnAny = _result.value();
            TypeCode returnType = returnAny.type();
            if ( returnType.kind().value() != TCKind._tk_void )
                returnAny.read_value(is, returnType);
        }

        // Now unmarshal the out/inout args
View Full Code Here

                case ARG_IN.value:
                    break;
                case ARG_OUT.value:
                case ARG_INOUT.value:
                    Any any = nv.value();
                    any.read_value(is, any.type());
                    break;
                }
            }
        }
        catch ( org.omg.CORBA.Bounds ex ) {
View Full Code Here

                        break;
                    }
                case TCKind._tk_enum:
                    {
                        int value = src.read_long();
                        tagValue.type(_discriminator);
                        tagValue.insert_long(value);
                        dst.write_long(value);
                        break;
                    }
                case TCKind._tk_longlong:
View Full Code Here

                try {
                    expectedMemberType = expectedTypeCode.member_type(i);
                } catch (BadKind badKind) { // impossible
                } catch (Bounds bounds) { // impossible
                }
                if (! expectedMemberType.equal(memberAny.type())) {
                    clearData();
                    // _REVISIT_ More info
                    throw new TypeMismatch();
                }
                try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.