Package org.omg.DynamicAny

Examples of org.omg.DynamicAny.DynAny


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

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

      dynAny.insert_float (700.0F);
      assertEquals (msg, 700.0F, dynAny.get_float(), 0.0);
   }
View Full Code Here


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

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

    * Test retrieving a basic value from a DynAny that has a different typecode.
    */
   public void testRetrieveMismatch_float () 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_float();
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

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

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

      dynAny.insert_double (700.0);
      assertEquals (msg, 700.0, dynAny.get_double(), 0.0);
   }
View Full Code Here

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

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

    * Test retrieving a basic value from a DynAny that has a different typecode.
    */
   public void testRetrieveMismatch_double () 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_double();
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

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

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

      dynAny.insert_char ('a');
      assertEquals (msg, 'a', dynAny.get_char());
   }
View Full Code Here

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

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

    * Test retrieving a basic value from a DynAny that has a different typecode.
    */
   public void testRetrieveMismatch_char () 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_char();
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
View Full Code Here

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

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

      dynAny.insert_wchar (EURO_SIGN);
      assertEquals (msg, EURO_SIGN, dynAny.get_wchar());
   }
View Full Code Here

TOP

Related Classes of org.omg.DynamicAny.DynAny

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.