

module org
{
   module jacorb
   {
      module test
      {
         module idl
         {
            module Recursive
            {
               interface recstruct
               {
                  struct RecursiveStruct;
                  typedef sequence <RecursiveStruct> RecursiveStructSeq;

                  struct RecursiveStruct {
                     octet align;
                     RecursiveStructSeq chain;
                  };

               };
            };

            module Recursive {
               interface recunion
               {
                  union RecursiveUnion;
                  typedef sequence <RecursiveUnion> RecursiveUnionSeq;

                  union RecursiveUnion switch(long) {
                     case 0:
                     long l_mem;
                     default:
                     struct Nested1 {
                        octet align;
                        RecursiveUnionSeq chain_mem;
                     } s_mem;
                  };
               };
            };

            module StructureUnion
            {
               // IDL
               struct S
               {
                  union U switch(boolean)
                  {
                     case FALSE: string name;
                  } the_U;
               };

               interface Dummy
               {
                  struct MyInnerUnionStruct
                  {
                     octet align;
                  };
               };

               interface MiscTester
               {
                  struct OuterStruct
                  {
                     octet align;
                     struct InnerStruct
                     {
                        string s_mem;
                     }
                     struct_mem;
                     union InnerStructUnion switch (long)
                     {
                        case 0:
                        string mem;
                     }
                     union_mem;
                  };


                  struct TestOut
                  {
                     octet align;
                  };


                  union OuterUnion switch (long)
                  {
                     case 0:
                     struct MyInnerUnionStruct
                     {
                        octet align;
                     }
                     s_mem;
                     case 1:
                     long l_mem;
                     case 2:
                     struct TheInnerUnion
                     {
                        octet align;
                     }
                     u_mem;
                     default:
                     TestOut mymember;
                  };

               };
            };



            module TestStructType
            {
               struct MyStruct
               {
                  long myLong;
               };
               typedef sequence<MyStruct> MyStructSeq;
            };

            module TestStructReturnType
            {
               interface Bar
               {
                  TestStructType::MyStructSeq barOp();
               };
            };
         };
      };
   };
};
