Package org.omg.DynamicAny

Examples of org.omg.DynamicAny.NameValuePair


            for( int i = 0 ; i < limit; i++ )
            {
                org.omg.CORBA.TypeCode _tc =
                    TypeCode.originalType( typeCode.member_type(i) );
                members[i] =
                    new NameValuePair(
                            typeCode.member_name(i),
                            dynFactory.create_dyn_any_from_type_code( _tc ).to_any());

            }
        }
View Full Code Here


                {
                    Any any = (org.jacorb.orb.Any)orb.create_any();
                    any.read_value(is,
                                 TypeCode.originalType(typeCode.member_type(i)));

                    members[i] = new NameValuePair( type().member_name(i), any);
                }
                catch( org.omg.CORBA.TypeCodePackage.Bounds e )
                {
                    throw unexpectedException(e);
                }
View Full Code Here

        }
        members = new NameValuePair[nvp.length];
        for( int i = 0; i < limit; i++ )
        {
            members[i] = new NameValuePair( nvp[i].id, nvp[i].value.to_any() );
        }
    }
View Full Code Here

            for( int i = 0 ; i < limit; i++ )
            {
                org.omg.CORBA.TypeCode _tc =
                    TypeCode.originalType( typeCode.member_type(i) );
                members[i] =
                    new NameValuePair(
                            typeCode.member_name(i),
                            dynFactory.create_dyn_any_from_type_code( _tc ).to_any());

            }
        }
View Full Code Here

                {
                    Any any = (org.jacorb.orb.Any)orb.create_any();
                    any.read_value(is,
                                 TypeCode.originalType(typeCode.member_type(i)));

                    members[i] = new NameValuePair( type().member_name(i), any);
                }
                catch( org.omg.CORBA.TypeCodePackage.Bounds e )
                {
                    throw unexpectedException(e);
                }
View Full Code Here

        }
        members = new NameValuePair[nvp.length];
        for( int i = 0; i < limit; i++ )
        {
            members[i] = new NameValuePair( nvp[i].id, nvp[i].value.to_any() );
        }
    }
View Full Code Here

      // test inserting a sequence with the wrong number of members
      pairs = new NameValuePair [1];
      any = orb.create_any ();
      any.insert_char ('a');
      pairs [0] = new NameValuePair ("name", any);

      msg = "Failed to raise an InvalidValue exception when passing in a ";
      msg += "name/value sequence containing too many members";
      try
      {
View Full Code Here

      assertEquals (msg, oldStr, pairs [1].value.extract_string ());

      pairs = new NameValuePair [2]; // specific to IDL
      any = orb.create_any ();
      any.insert_long (newInt);
      pairs [0] = new NameValuePair (name1, any);
      any = orb.create_any ();
      any.insert_string (newStr);
      pairs [1] = new NameValuePair (name2, any);

      msg = "Failed to set DynStruct members using DynStruct::set_members ";
      msg += "operation";
      try
      {
View Full Code Here

      // test inserting a member with an incorrect type
      pairs = new NameValuePair [2];
      any = orb.create_any ();
      any.insert_char ('a');
      pairs [0] = new NameValuePair (name1, any);
      any = orb.create_any ();
      any.insert_string ("WrongType");
      pairs [0] = new NameValuePair (name2, any);

      msg = "Failed to raise a TypeMismatch exception when passing in a ";
      msg += "name/value pair containing an incorrect member value";
      try
      {
         dynAny.set_members (pairs);

         fail (msg);
      }
      catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex)
      {
         // success
      }
      catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex)
      {
         fail (msg + ": " + ex);
      }

      // test inserting a member with an incorrect name
      pairs = new NameValuePair [2];
      any = orb.create_any ();
      any.insert_char ('a');
      pairs [0] = new NameValuePair (name1, any);
      any = orb.create_any ();
      any.insert_longlong ((long) 1);
      pairs [1] = new NameValuePair ("WrongName", any);

      msg = "Failed to raise a TypeMismatch exception when passing in a ";
      msg += "name/value pair containing an incorrect member name";
      try
      {
         dynAny.set_members (pairs);

         fail (msg);
      }
      catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex)
      {
         // success
      }
      catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex)
      {
         fail (msg + ": " + ex);
      }

      // test inserting a sequence with the wrong number of members
      pairs = new NameValuePair [3];
      any = orb.create_any ();
      any.insert_char ('a');
      pairs [0] = new NameValuePair (name1, any);
      any = orb.create_any ();
      any.insert_longlong ((long) 1);
      pairs [1] = new NameValuePair (name2, any);
      any = orb.create_any ();
      any.insert_longlong ((long) 1);
      pairs [2] = new NameValuePair (name2, any);

      msg = "Failed to raise an InvalidValue exception when passing in a ";
      msg += "name/value sequence containing too many members";
      try
      {
View Full Code Here

      assertEquals (msg, oldStr, pairs [1].value.extract_string ());

      pairs = new NameValuePair [2]; // specific to IDL
      any = orb.create_any ();
      any.insert_long (newInt);
      pairs [0] = new NameValuePair (name1, any);
      any = orb.create_any ();
      any.insert_string (newStr);
      pairs [1] = new NameValuePair (name2, any);

      try
      {
         dynAny.set_members (pairs);
      }
View Full Code Here

TOP

Related Classes of org.omg.DynamicAny.NameValuePair

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.