Module: scepter-tests
Author: Jason Trenouth
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

define test corba-services-idl-Naming ()
  check("", test-idl-file, *corba-services-files*, "Naming");
end test;

add-idl-file!(
  *corba-services-files*,
  "Naming",
"// CosNaming Module, p 3-6 CORBAservices, Naming Service V1.0, 3/94\n"
"\n"
"#ifndef COSNAMING\n"
"#define COSNAMING\n"
"module CosNaming\n"
"{\n"
"\ttypedef string Istring;\n"
"\tstruct NameComponent {\n"
"\t\tIstring id;\n"
"\t\tIstring kind;\n"
"\t};\n"
"\n"
"\ttypedef sequence <NameComponent> Name;\n"
"\n"
"\tenum BindingType {nobject, ncontext};\n"
"\n"
"\tstruct Binding {\n"
"\t\tName \tbinding_name;\n"
"\t\tBindingType\t\t binding_type; \n"
"\t};\n"
"\n"
"\ttypedef sequence <Binding> BindingList;\n"
"\n"
"\n"
"\tinterface BindingIterator;\n"
"\n"
"\tinterface NamingContext {\n"
"\n"
"\t\tenum NotFoundReason { missing_node, not_context, not_object};\n"
"\n"
"\t\texception NotFound { \n"
"\t\t\t\tNotFoundReason why;\n"
"\t\t\t\tName rest_of_name;\n"
"\t\t};\n"
"\n"
"\t\texception CannotProceed {\n"
"\t\t\t\tNamingContext cxt;\n"
"\t\t\t\tName rest_of_name;\n"
"\t\t};\n"
"\t\t\t\t\t \n"
"\t\texception InvalidName{};\t \n"
"\t\texception AlreadyBound {};\n"
"\t\texception NotEmpty{};\n"
"\n"
"\t\tvoid bind(in Name n, in Object obj)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName, AlreadyBound);\n"
"\t\tvoid rebind(in Name n, in Object obj)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName);\n"
"\t\tvoid bind_context(in Name n, in NamingContext nc)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName, AlreadyBound);\n"
"\t\tvoid rebind_context(in Name n, in NamingContext nc)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName);\n"
"\t\tObject resolve (in Name n)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName);\n"
"\t\tvoid unbind(in Name n)\n"
"\t\t\t raises(NotFound, CannotProceed, InvalidName);\n"
"\t\tNamingContext new_context();\n"
"\t\tNamingContext bind_new_context(in Name n)\n"
"\t\t \t raises(NotFound, AlreadyBound, CannotProceed, InvalidName);\n"
"\t\tvoid destroy( )\n"
"\t\t \t raises(NotEmpty);\n"
"\t\tvoid list (in unsigned long how_many, \n"
"\t\t\t\t\tout BindingList bl, out BindingIterator bi);\n"
"\t};\n"
"\n"
"\tinterface BindingIterator {\n"
"\t\tboolean next_one(out Binding b);\n"
"\t\tboolean next_n(in unsigned long how_many, \n"
"\t\t\t\t\tout BindingList bl);\n"
"\t\tvoid destroy();\n"
"\t};\n"
"\n"
"};\n"
"\n"
"// Names Library interface in PIDL,   CORBAservices p 3- 14, Naming Service V1.0 3/94 \n"
"\n"
"interface LNameComponent {\t\t\t\t\t\t\t\t// PIDL\n"
"\texception NotSet{};\n"
"\tstring get_id() \n"
"\t\traises(NotSet);\n"
"\tvoid set_id(in string i);\n"
"\tstring get_kind() \n"
"\t\traises(NotSet);\n"
"\tvoid set_kind(in string k);\n"
"\tvoid destroy();\n"
"};\n"
"\n"
"interface LName { \t\t\t\t\t\t\t\t\t\t\t\t// PIDL\n"
"\texception NoComponent{};\n"
"\texception OverFlow{};\n"
"\texception InvalidName{};\n"
"\tLName insert_component(in unsigned long i, \n"
"\t\t\t\t\tin LNameComponent n) \n"
"\t\t\traises(NoComponent, OverFlow);\n"
"\tLNameComponent get_component(in unsigned long i)\n"
"\t\t raises(NoComponent);\n"
"\tLNameComponent delete_component(in unsigned long i)\n"
"\t\t raises(NoComponent);\n"
"\tunsigned long num_components();\n"
"\tboolean equal(in LName ln);\n"
"\tboolean less_than(in LName ln);\n"
"\tCosNaming::Name to_idl_form()\t\t// Jason: add prefix\n"
"\t\t\traises(InvalidName); \t\t\t\t \n"
"\tvoid from_idl_form(in CosNaming::Name n);\n"
"\tvoid destroy();\n"
"};\n"
"\n"
"// Jason: cannot have operations outside of interfaces so comment out\n"
"//\n"
"// LName create_lname();\t\t\t\t// C/C++\n"
"// LNameComponent create_lname_component();\t\t// C/C++\n"
"#endif\n"
"\n"
"\n");
