Examples of DynAny


Examples of org.omg.DynamicAny.DynAny

    * Test inserting a basic value into a DynAny that has a different typecode.
    */
   public void testInsertMismatch_ulong () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

      try
      {
          dynAny.insert_ulong (700);
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    * Test retrieving a basic value from a DynAny that has a different typecode.
    */
   public void testRetrieveMismatch_ulong () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);
      dynAny.insert_boolean(true);

      try
      {
          dynAny.get_ulong();
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    * Test accessing a value of some basic type in a DynAny object.
    */
   public void testAccessBasicValue_longlong () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

      String msg = "Value inserted into DynAny object is not equal to value ";
      msg += "extracted from same DynAny object";

      dynAny.insert_longlong (700700L);
      assertEquals (msg, 700700L, dynAny.get_longlong());
   }
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    {
        final int _length;

        switch (value.type().kind().value()) {
        case TCKind._tk_array:
            DynAny _dynAny = toDynAny(value);
            _length = _dynAny.component_count();
            break;

        case TCKind._tk_sequence:
            DynSequence _dynSequence = toDynSequence(value);
            _length = _dynSequence.get_length();
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    * Test inserting a basic value into a DynAny that has a different typecode.
    */
   public void testInsertMismatch_longlong () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

      try
      {
          dynAny.insert_longlong (700700L);
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

            if (logger_.isDebugEnabled())
            {
                logger_.debug("evaluateNamedValueList(" + any + ", " + name + ")");
            }

            final DynAny _dynAny = toDynAny(any);
            final int _count = _dynAny.component_count();

            DynAny _cursor;
            Any _ret = null;

            _dynAny.rewind();

            if (logger_.isDebugEnabled())
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

            if (logger_.isDebugEnabled())
            {
                logger_.debug("evaluate array idx " + index + " on a Any of type: " + any.type());
            }

            DynAny _dynAny = toDynAny(any);
            DynAny _cursor;

            _dynAny.rewind();
            _dynAny.seek(index);
            _cursor = _dynAny.current_component();

            if (logger_.isDebugEnabled())
            {
                logger_.debug("evaluation result is of type: " + _cursor.type());
            }

            return _cursor.to_any();
        } catch (TypeMismatch e)
        {
            throw newEvaluationException(e);
        }
    }
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    * Test retrieving a basic value from a DynAny that has a different typecode.
    */
   public void testRetrieveMismatch_longlong () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);
      dynAny.insert_long(700);

      try
      {
          dynAny.get_longlong();
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    {
        final NVList _expectedParams = getORB().create_list(operation.parameters.length);

        for (int x = 0; x < operation.parameters.length; ++x)
        {
            final DynAny _dynAny = dynAnyFactory_
                    .create_dyn_any_from_type_code(operation.parameters[x].type);

            _expectedParams
                    .add_value(operation.parameters[x].name, _dynAny.to_any(), ARG_OUT.value);
        }

        map.put(operation.name, _expectedParams);
    }
View Full Code Here

Examples of org.omg.DynamicAny.DynAny

    private Any evaluateIdentifier(DynAny any, int position) throws EvaluationException
    {
        try
        {
            final DynAny _result;

            switch (any.type().kind().value()) {

            case TCKind._tk_struct:
                any.seek(position);
                _result = any.current_component();
                break;

            default:
                throw new EvaluationException("attempt to access member on non-struct");
            }

            return _result.to_any();
        } catch (TypeMismatch e)
        {
            throw newEvaluationException(e);
        }
    }
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.