Examples of TCKind


Examples of org.omg.CORBA.TCKind

        }
        return tc;
    }

    public static TypeCode getPrimitiveTypeCode(ORB orb, QName type) {
        TCKind kind = PRIMITIVE_TYPECODES.get(type);
        if (kind != null) {
            return orb.get_primitive_tc(kind);
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

Examples of org.omg.CORBA.TCKind

        }
        return name;
    }

    public static boolean isPrimitiveIdlType(QName idltype) {
        TCKind kind = PRIMITIVE_TYPECODES.get(idltype);
        if (kind != null) {
            return true;
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

Examples of org.omg.CORBA.TCKind

    }

    public String getTypeName() {
        String ret = null;
        if (typeCode != null) {
            TCKind kind = typeCode.kind();
            if (kind != null) {
                switch(kind.value()) {
                    case TCKind._tk_long : ret = "int"; break;
                    case TCKind._tk_ulong : ret = "int"; break;
                    case TCKind._tk_longlong : ret = "long"; break;
                    case TCKind._tk_ulonglong : ret = "long"; break;
                    case TCKind._tk_short : ret = "short"; break;
View Full Code Here

Examples of org.omg.CORBA.TCKind

    public TypeCode getTypeCode() {
        return dataType.getTypeCode();
    }

    protected void write(Object value, DataType dataType, OutputStream outputStream) {
        TCKind kind = dataType.getTypeCode().kind();
        switch(kind.value()) {
            case TCKind._tk_long : outputStream.write_long(((Integer) value).intValue()); break;
            case TCKind._tk_ulong : outputStream.write_ulong(((Integer) value).intValue()); break;
            case TCKind._tk_longlong : outputStream.write_longlong(((Long) value).longValue()); break;
            case TCKind._tk_ulonglong : outputStream.write_ulonglong(((Long) value).longValue()); break;
            case TCKind._tk_short : outputStream.write_short(((Short) value).shortValue()); break;
View Full Code Here

Examples of org.omg.CORBA.TCKind

                break;
        }
    }

    protected Object read(DataType dataType, InputStream inputStream) {
        TCKind kind = dataType.getTypeCode().kind();
        Object ret = null;
        switch(kind.value()) {
            case TCKind._tk_long: ret = new Integer(inputStream.read_long()); break;
            case TCKind._tk_ulong: ret = new Integer(inputStream.read_ulong()); break;
            case TCKind._tk_longlong: ret = new Long(inputStream.read_longlong()); break;
            case TCKind._tk_ulonglong: ret = new Long(inputStream.read_ulonglong()); break;
            case TCKind._tk_short: ret = new Short(inputStream.read_short()); break;
View Full Code Here

Examples of org.omg.CORBA.TCKind

        ValueMember[] valueMembers = new ValueMember[members.size()];
        String id = getId();
        for (int i = 0; i < members.size(); i++) {
            Member member = (Member) members.get(i);
            TypeCode typeCode = member.getDataType().getTypeCode();
            TCKind kind = typeCode.kind();
            switch(kind.value()) {
                case TCKind._tk_value :
                    String memberTypeId = "";
                    try {
                        memberTypeId = typeCode.id();
                    } catch (BadKind badKind) {
View Full Code Here

Examples of org.omg.CORBA.TCKind

    * Test accessing the discriminator of a DynUnion object.
    */
   public void testAccessUnionDisc ()
   {
      String msg;
      TCKind discKind = null;
      org.omg.CORBA.TypeCode tc = null;
      org.omg.DynamicAny.DynUnion dynAny = null;
      org.omg.DynamicAny.DynEnum disc = null;
      org.omg.DynamicAny.DynAny invalidDisc = null;

      tc = UnionDefaultTypeHelper.type ();
      dynAny = createDynAnyFromTypeCode (tc);

      // test setting the discriminator
      try
      {
         disc = (org.omg.DynamicAny.DynEnum)
            factory.create_dyn_any_from_type_code (EnumTypeHelper.type ());
      }
      catch (Throwable ex)
      {
         fail ("Failed to create DynAny with correct TypeCode: " + ex);
      }

      try
      {
         disc.set_as_string ("second"); // specific to IDL
      }
      catch (Throwable ex)
      {
         fail ("Failed to set value of discriminator: " + ex);
      }

      try
      {
         dynAny.set_discriminator (disc);
      }
      catch (Throwable ex)
      {
         msg = "Failed to set the value of the discriminator using the ";
         msg += "DynUnion::set_discriminator operation";
         fail (msg + ": " + ex);
      }

      // test getting the discriminator
      msg = "Failed to get the correct value of the discriminator using the ";
      msg += "DynUnion::get_discriminator operation";
      disc = (org.omg.DynamicAny.DynEnum) dynAny.get_discriminator ();

      // specific to IDL
      assertEquals (msg, EnumType.second.value (), disc.get_as_ulong ());

      // test getting the kind of the discriminator
      msg = "Failed to get the correct kind of the discriminator using ";
      msg += "DynUnion::discriminator_kind operation";
      discKind = dynAny.discriminator_kind ();

      // specific to IDL
      assertEquals (msg, TCKind._tk_enum, discKind.value ());

      // test setting an invalid discriminator
      tc = orb.get_primitive_tc (TCKind.tk_long);
      try
      {
View Full Code Here

Examples of org.omg.CORBA.TCKind

   public void testAccessNamedUnionMember ()
   {
      String msg;
      int testVal = 10;
      UnionDefaultType type;
      TCKind memberKind = null;
      String memberName = null;
      int memberVal = -1;
      org.omg.CORBA.Any any = null;
      org.omg.DynamicAny.DynUnion dynAny = null;
      org.omg.DynamicAny.DynAny member = null; // specific to IDL

      type = new UnionDefaultType ();
      type.win (testVal);
      any = orb.create_any ();
      UnionDefaultTypeHelper.insert (any, type);
      dynAny = createDynAnyFromAny (any);

      // test getting the kind of the active member
      msg = "Failed to get the correct kind of the active member using ";
      msg += "DynUnion::member_kind operation";
      try
      {
         memberKind = dynAny.member_kind ();
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // specific to IDL
      assertEquals (msg, TCKind._tk_long, memberKind.value ());

      // test getting the name of the active member
      msg = "Failed to get the correct name of the active member using ";
      msg += "DynUnion::member_name operation";
      try
View Full Code Here

Examples of org.omg.CORBA.TCKind

    */
   public void testAccessStructMembers ()
   {
      String msg;
      String memberName = null;
      TCKind memberKind = null;
      org.omg.CORBA.Any any = null;
      EmptyException exception = null;
      org.omg.DynamicAny.DynStruct dynAny = null;

      exception = new EmptyException ();
View Full Code Here

Examples of org.omg.CORBA.TCKind

    */
   public void testAccessStructMembers ()
   {
      String msg;
      String memberName = null;
      TCKind memberKind = null;
      org.omg.CORBA.TypeCode tc = null;
      org.omg.DynamicAny.DynStruct dynAny = null;

      tc = StructTypeHelper.type ();
      dynAny = createDynAnyFromTypeCode (tc);

      // test getting the name of the current member
      msg = "Failed to get the correct name of the first member using ";
      msg += "DynStruct::current_member_name operation";
      try
      {
         memberName = dynAny.current_member_name ();

         assertEquals (msg, "field1", memberName); // specific to IDL
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // test getting the kind of the current member
      msg = "Failed to get the correct kind of the first member using ";
      msg += "DynStruct::current_member_kind operation";
      try
      {
         memberKind = dynAny.current_member_kind ();

         // specific to IDL
         assertEquals (msg, TCKind._tk_long, memberKind.value ());
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // move to the next position
      dynAny.next ();

      // test getting the name of the current member
      msg = "Failed to get the correct name of the second member using ";
      msg += "DynStruct::current_member_name operation";
      try
      {
         memberName = dynAny.current_member_name ();

         assertEquals (msg, "field2", memberName); // specific to IDL
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // test getting the kind of the current member
      msg = "Failed to get the correct kind of the second member using ";
      msg += "DynStruct::current_member_kind operation";
      try
      {
         memberKind = dynAny.current_member_kind ();

         // specific to IDL
         assertEquals (msg, TCKind._tk_string, memberKind.value ());
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
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.