Package org.omg.DynamicAny

Examples of org.omg.DynamicAny.DynAny


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

      try
      {
          dynAny.insert_wchar (EURO_SIGN);
          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_wchar () 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_wchar();
          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_string () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_string);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

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

      dynAny.insert_string ("foobar");
      assertEquals (msg, "foobar", dynAny.get_string());
   }
View Full Code Here

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

      try
      {
          dynAny.insert_string ("foobar");
          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_string () 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_string();
          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_wstring () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_wstring);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

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

      dynAny.insert_wstring ("foobar");
      assertEquals (msg, "foobar", dynAny.get_wstring());
   }
View Full Code Here

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

      try
      {
          dynAny.insert_wstring ("foobarx");
          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_wstring () 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_wstring();
          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_any () throws Exception
   {
      TypeCode tc     = orb.get_primitive_tc (org.omg.CORBA.TCKind.tk_any);
      DynAny   dynAny = createDynAnyFromTypeCode (tc);

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

      Any inAny = orb.create_any();
      inAny.insert_long (777);

      dynAny.insert_any (inAny);
      Any outAny = dynAny.get_any();

      assertTrue (msg, inAny.equal(outAny));
      assertEquals (msg, inAny.extract_long(), outAny.extract_long());
   }
View Full Code Here

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

      try
      {
          dynAny.insert_any (inAny);
          fail ("should have thrown TypeMismatch");
      }
      catch (TypeMismatch ex)
      {
          // ok
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.