diff options
author | Bernard Normier <bernard@zeroc.com> | 2018-10-18 12:01:54 -0400 |
---|---|---|
committer | Jose <pepone@users.noreply.github.com> | 2018-10-18 18:01:53 +0200 |
commit | 456001e3e4dbb3f15396c0598b6ddb5436ac3a2a (patch) | |
tree | facb9db494f91b066a1c0b5e29c371ec523a82e7 | |
parent | Update Xamarin test instructions (diff) | |
download | ice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.tar.bz2 ice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.tar.xz ice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.zip |
Rework cs:namespace implementation (fix issue #239) (#249)
* Rework the cs:namespace implementation
No longer rely on Ice.Packages. Fixes #239.
* Renamed Ice/packagemd to Ice/namespacemd (C#)
* Removed Ice.Package property from C# tests
* Switched to get-only attribute, fixed Xamarin test
148 files changed, 988 insertions, 1049 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index e1be83afdc4..ada7e2070f1 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -6679,7 +6679,7 @@ Slice::Unit::addTypeId(int compactId, const std::string& typeId) } std::string -Slice::Unit::getTypeId(int compactId) +Slice::Unit::getTypeId(int compactId) const { map<int, string>::const_iterator p = _typeIds.find(compactId); if(p != _typeIds.end()) @@ -6690,6 +6690,12 @@ Slice::Unit::getTypeId(int compactId) } bool +Slice::Unit::hasCompactTypeId() const +{ + return _typeIds.size() > 0; +} + +bool Slice::Unit::usesNonLocals() const { for(map<string, ContainedList>::const_iterator p = _contentMap.begin(); p != _contentMap.end(); ++p) diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h index 219c14ae151..81c01077a31 100644 --- a/cpp/src/Slice/Parser.h +++ b/cpp/src/Slice/Parser.h @@ -1092,7 +1092,8 @@ public: ContainedList findUsedBy(const ContainedPtr&) const; void addTypeId(int, const std::string&); - std::string getTypeId(int); + std::string getTypeId(int) const; + bool hasCompactTypeId() const; bool usesNonLocals() const; bool usesConsts() const; diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp index 27e0c974d31..24e518b5a79 100644 --- a/cpp/src/slice2cs/CsUtil.cpp +++ b/cpp/src/slice2cs/CsUtil.cpp @@ -100,7 +100,7 @@ splitScopedName(const string& scoped) } string -Slice::CsGenerator::getPackagePrefix(const ContainedPtr& cont) +Slice::CsGenerator::getNamespacePrefix(const ContainedPtr& cont) { // // Traverse to the top-level module. @@ -124,41 +124,40 @@ Slice::CsGenerator::getPackagePrefix(const ContainedPtr& cont) assert(m); - // - // The cs:namespace metadata can be defined as global metadata or applied to a top-level module. - // We check for the metadata at the top-level module first and then fall back to the global scope. - // static const string prefix = "cs:namespace:"; string q; - if(!m->findMetaData(prefix, q)) + if(m->findMetaData(prefix, q)) { - UnitPtr unit = cont->unit(); - string file = cont->file(); - assert(!file.empty()); - - DefinitionContextPtr dc = unit->findDefinitionContext(file); - assert(dc); - q = dc->findMetaData(prefix); + q = q.substr(prefix.size()); } + return q; +} - if(!q.empty()) +string +Slice::CsGenerator::getCustomTypeIdNamespace(const UnitPtr& unit) +{ + DefinitionContextPtr dc = unit->findDefinitionContext(unit->topLevelFile()); + assert(dc); + + static const string typeIdNsPrefix = "cs:typeid-namespace:"; + string result = dc->findMetaData(typeIdNsPrefix); + if(!result.empty()) { - q = q.substr(prefix.size()); + result = result.substr(typeIdNsPrefix.size()); } - - return q; + return result; } string -Slice::CsGenerator::getPackage(const ContainedPtr& cont) +Slice::CsGenerator::getNamespace(const ContainedPtr& cont) { string scope = fixId(cont->scope()); if(scope.rfind(".") == scope.size() - 1) { scope = scope.substr(0, scope.size() - 1); } - string prefix = getPackagePrefix(cont); + string prefix = getNamespacePrefix(cont); if(!prefix.empty()) { if(!scope.empty()) @@ -196,7 +195,7 @@ Slice::CsGenerator::getUnqualified(const ContainedPtr& p, const string& package, const string& suffix) { string name = fixId(prefix + p->name() + suffix); - string contPkg = getPackage(p); + string contPkg = getNamespace(p); if(contPkg == package || contPkg.empty()) { return name; @@ -1303,7 +1302,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, assert(cont); if(useHelper) { - string helperName = getUnqualified(getPackage(seq) + "." + seq->name() + "Helper", scope); + string helperName = getUnqualified(getNamespace(seq) + "." + seq->name() + "Helper", scope); if(marshal) { out << nl << helperName << ".write(" << stream << ", " << param << ");"; @@ -2486,8 +2485,8 @@ Slice::CsGenerator::MetaDataVisitor::visitUnitStart(const UnitPtr& p) if(s.find(csPrefix) == 0) { static const string csAttributePrefix = csPrefix + "attribute:"; - static const string csNamespacePrefix = csPrefix + "namespace:"; - if(!(s.find(csNamespacePrefix) == 0 && s.size() > csNamespacePrefix.size()) && + static const string csTypeIdNsPrefix = csPrefix + "typeid-namespace:"; + if(!(s.find(csTypeIdNsPrefix) == 0 && s.size() > csTypeIdNsPrefix.size()) && !(s.find(csAttributePrefix) == 0 && s.size() > csAttributePrefix.size())) { dc->warning(InvalidMetaData, file, -1, "ignoring invalid global metadata `" + oldS + "'"); diff --git a/cpp/src/slice2cs/CsUtil.h b/cpp/src/slice2cs/CsUtil.h index 3c842d73f43..861ecedb9d8 100644 --- a/cpp/src/slice2cs/CsUtil.h +++ b/cpp/src/slice2cs/CsUtil.h @@ -35,7 +35,7 @@ public: // // Returns the namespace of a Contained entity. // - static std::string getPackage(const ContainedPtr&); + static std::string getNamespace(const ContainedPtr&); static std::string getUnqualified(const std::string&, const std::string&, bool builtin = false); static std::string getUnqualified(const ContainedPtr&, @@ -48,7 +48,8 @@ protected: // // Returns the namespace prefix of a Contained entity. // - static std::string getPackagePrefix(const ContainedPtr&); + static std::string getNamespacePrefix(const ContainedPtr&); + static std::string getCustomTypeIdNamespace(const UnitPtr&); static std::string resultStructName(const std::string&, const std::string&, bool = false); static std::string resultType(const OperationPtr&, const std::string&, bool = false); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index a6b09ad2030..b5ee171ea53 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -36,24 +36,24 @@ namespace { string -sliceModeToIceMode(Operation::Mode opMode, string package) +sliceModeToIceMode(Operation::Mode opMode, string ns) { string mode; switch(opMode) { case Operation::Normal: { - mode = CsGenerator::getUnqualified("Ice.OperationMode.Normal", package); + mode = CsGenerator::getUnqualified("Ice.OperationMode.Normal", ns); break; } case Operation::Nonmutating: { - mode = CsGenerator::getUnqualified("Ice.OperationMode.Nonmutating", package); + mode = CsGenerator::getUnqualified("Ice.OperationMode.Nonmutating", ns); break; } case Operation::Idempotent: { - mode = CsGenerator::getUnqualified("Ice.OperationMode.Idempotent", package); + mode = CsGenerator::getUnqualified("Ice.OperationMode.Idempotent", ns); break; } default: @@ -66,21 +66,21 @@ sliceModeToIceMode(Operation::Mode opMode, string package) } string -opFormatTypeToString(const OperationPtr& op, string package) +opFormatTypeToString(const OperationPtr& op, string ns) { switch (op->format()) { case DefaultFormat: { - return CsGenerator::getUnqualified("Ice.FormatType.DefaultFormat", package); + return CsGenerator::getUnqualified("Ice.FormatType.DefaultFormat", ns); } case CompactFormat: { - return CsGenerator::getUnqualified("Ice.FormatType.CompactFormat", package); + return CsGenerator::getUnqualified("Ice.FormatType.CompactFormat", ns); } case SlicedFormat: { - return CsGenerator::getUnqualified("Ice.FormatType.SlicedFormat", package); + return CsGenerator::getUnqualified("Ice.FormatType.SlicedFormat", ns); } default: { @@ -172,7 +172,7 @@ Slice::CsVisitor::~CsVisitor() void Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const OperationPtr& op, bool marshal, - const string& package, bool resultStruct, bool publicNames, + const string& ns, bool resultStruct, bool publicNames, const string& customStream) { ParamDeclList optionals; @@ -196,7 +196,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!marshal && isClassType(type)) { ostringstream os; - os << '(' << typeToString(type, package) << " v) => {" << paramPrefix << param << " = v; }"; + os << '(' << typeToString(type, ns) << " v) => {" << paramPrefix << param << " = v; }"; param = os.str(); } else @@ -210,7 +210,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const } else { - writeMarshalUnmarshalCode(_out, type, package, param, marshal, customStream); + writeMarshalUnmarshalCode(_out, type, ns, param, marshal, customStream); } } @@ -223,7 +223,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!marshal && isClassType(ret)) { ostringstream os; - os << '(' << typeToString(ret, package) << " v) => {" << paramPrefix << returnValueS << " = v; }"; + os << '(' << typeToString(ret, ns) << " v) => {" << paramPrefix << returnValueS << " = v; }"; param = os.str(); } else @@ -233,7 +233,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!op->returnIsOptional()) { - writeMarshalUnmarshalCode(_out, ret, package, param, marshal, customStream); + writeMarshalUnmarshalCode(_out, ret, ns, param, marshal, customStream); } } @@ -262,14 +262,14 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!marshal && isClassType(ret)) { ostringstream os; - os << '(' << typeToString(ret, package) << " v) => {" << paramPrefix << returnValueS << " = v; }"; + os << '(' << typeToString(ret, ns) << " v) => {" << paramPrefix << returnValueS << " = v; }"; param = os.str(); } else { param = paramPrefix + returnValueS; } - writeOptionalMarshalUnmarshalCode(_out, ret, package, param, op->returnTag(), marshal, customStream); + writeOptionalMarshalUnmarshalCode(_out, ret, ns, param, op->returnTag(), marshal, customStream); checkReturnType = false; } @@ -278,7 +278,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!marshal && isClassType(type)) { ostringstream os; - os << '(' << typeToString(type, package) << " v) => {" << paramPrefix << param << " = v; }"; + os << '(' << typeToString(type, ns) << " v) => {" << paramPrefix << param << " = v; }"; param = os.str(); } else @@ -286,7 +286,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const param = paramPrefix + param; } - writeOptionalMarshalUnmarshalCode(_out, type, package, param, (*pli)->tag(), marshal, customStream); + writeOptionalMarshalUnmarshalCode(_out, type, ns, param, (*pli)->tag(), marshal, customStream); } if(checkReturnType) @@ -295,25 +295,25 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!marshal && isClassType(ret)) { ostringstream os; - os << '(' << typeToString(ret, package) << " v) => {" << paramPrefix << returnValueS << " = v; }"; + os << '(' << typeToString(ret, ns) << " v) => {" << paramPrefix << returnValueS << " = v; }"; param = os.str(); } else { param = paramPrefix + returnValueS; } - writeOptionalMarshalUnmarshalCode(_out, ret, package, param, op->returnTag(), marshal, customStream); + writeOptionalMarshalUnmarshalCode(_out, ret, ns, param, op->returnTag(), marshal, customStream); } } void -Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name, const string& package, +Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name, const string& ns, bool forStruct) { if(member->optional()) { assert(!forStruct); - writeOptionalMarshalUnmarshalCode(_out, member->type(), package, name, member->tag(), true, "ostr_"); + writeOptionalMarshalUnmarshalCode(_out, member->type(), ns, name, member->tag(), true, "ostr_"); } else { @@ -324,19 +324,19 @@ Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const stri memberName = "this." + memberName; } - writeMarshalUnmarshalCode(_out, member->type(), package, memberName, true, stream); + writeMarshalUnmarshalCode(_out, member->type(), ns, memberName, true, stream); } } void -Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const string& name, const string& package, +Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const string& name, const string& ns, bool forStruct) { string param = name; if(isClassType(member->type())) { ostringstream os; - os << '(' << typeToString(member->type(), package) << " v) => { this." << name << " = v; }"; + os << '(' << typeToString(member->type(), ns) << " v) => { this." << name << " = v; }"; param = os.str(); } else if(forStruct) @@ -347,11 +347,11 @@ Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const st if(member->optional()) { assert(!forStruct); - writeOptionalMarshalUnmarshalCode(_out, member->type(), package, param, member->tag(), false, "istr_"); + writeOptionalMarshalUnmarshalCode(_out, member->type(), ns, param, member->tag(), false, "istr_"); } else { - writeMarshalUnmarshalCode(_out, member->type(), package, param, false, forStruct ? "" : "istr_"); + writeMarshalUnmarshalCode(_out, member->type(), ns, param, false, forStruct ? "" : "istr_"); } } @@ -379,8 +379,8 @@ Slice::CsVisitor::writeInheritedOperations(const ClassDefPtr& p) { string retS; vector<string> params, args; - string package = getPackage(p); - string name = getDispatchParams(*i, retS, params, args, package); + string ns = getNamespace(p); + string name = getDispatchParams(*i, retS, params, args, ns); _out << sp << nl << "public abstract " << retS << " " << name << spar << params << epar << ';'; } @@ -393,7 +393,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { string name = fixId(p->name()); string scoped = p->scoped(); - string package = getPackage(p); + string ns = getNamespace(p); ClassList allBases = p->allBases(); StringList ids; ClassList bases = p->bases(); @@ -439,7 +439,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override bool ice_isA(string s, " << getUnqualified("Ice.Current", package) << " current = null)"; + _out << nl << "public override bool ice_isA(string s, " << getUnqualified("Ice.Current", ns) << " current = null)"; _out << sb; _out << nl << "return global::System.Array.BinarySearch(_ids, s, IceUtilInternal.StringUtil.OrdinalStringComparer) >= 0;"; _out << eb; @@ -449,7 +449,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override string[] ice_ids(" << getUnqualified("Ice.Current", package) << " current = null)"; + _out << nl << "public override string[] ice_ids(" << getUnqualified("Ice.Current", ns) << " current = null)"; _out << sb; _out << nl << "return _ids;"; _out << eb; @@ -459,7 +459,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override string ice_id(" << getUnqualified("Ice.Current", package) << " current = null)"; + _out << nl << "public override string ice_id(" << getUnqualified("Ice.Current", ns) << " current = null)"; _out << sb; _out << nl << "return _ids[" << scopedPos << "];"; _out << eb; @@ -497,16 +497,16 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public static global::System.Threading.Tasks.Task<" << getUnqualified("Ice.OutputStream", package) << ">"; + _out << nl << "public static global::System.Threading.Tasks.Task<" << getUnqualified("Ice.OutputStream", ns) << ">"; _out << nl << "iceD_" << opName << "(" << name << (p->isInterface() ? "" : "Disp_") << " obj, " - << "global::IceInternal.Incoming inS, " << getUnqualified("Ice.Current", package) << " current)"; + << "global::IceInternal.Incoming inS, " << getUnqualified("Ice.Current", ns) << " current)"; _out << sb; TypePtr ret = op->returnType(); ParamDeclList inParams = op->inParameters(); ParamDeclList outParams = op->outParameters(); - _out << nl << getUnqualified("Ice.ObjectImpl", package) << ".iceCheckMode(" << sliceModeToIceMode(op->mode(), package) + _out << nl << getUnqualified("Ice.ObjectImpl", ns) << ".iceCheckMode(" << sliceModeToIceMode(op->mode(), ns) << ", current.mode);"; if(!inParams.empty()) { @@ -517,7 +517,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) for(ParamDeclList::const_iterator pli = inParams.begin(); pli != inParams.end(); ++pli) { string param = "iceP_" + (*pli)->name(); - string typeS = typeToString((*pli)->type(), package, (*pli)->optional()); + string typeS = typeToString((*pli)->type(), ns, (*pli)->optional()); const bool isClass = isClassType((*pli)->type()); if((*pli)->optional()) @@ -525,7 +525,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << nl << typeS << ' ' << param; if(isClass) { - _out << " = " << getUnqualified("Ice.Util", package) << ".None"; + _out << " = " << getUnqualified("Ice.Util", ns) << ".None"; } _out << ';'; } @@ -543,7 +543,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } } } - writeMarshalUnmarshalParams(inParams, 0, false, package); + writeMarshalUnmarshalParams(inParams, 0, false, ns); if(op->sendsClasses(false)) { _out << nl << "istr.readPendingValues();"; @@ -557,7 +557,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) if(op->format() != DefaultFormat) { - _out << nl << "inS.setFormat(" << opFormatTypeToString(op, package) << ");"; + _out << nl << "inS.setFormat(" << opFormatTypeToString(op, ns) << ");"; } vector<string> inArgs; @@ -575,7 +575,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } else if(amd) { - string retS = resultType(op, package); + string retS = resultType(op, ns); _out << nl << "return inS.setResultTask" << (retS.empty() ? "" : ('<' + retS + '>')); _out << "(obj." << opName << "Async" << spar << inArgs << "current" << epar; if(!retS.empty()) @@ -591,7 +591,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << nl << "(ostr, ret) =>"; } _out << sb; - writeMarshalUnmarshalParams(outParams, op, true, package, true); + writeMarshalUnmarshalParams(outParams, op, true, ns, true); if(op->returnsClasses(false)) { _out << nl << "ostr.writePendingValues();"; @@ -606,7 +606,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { for(ParamDeclList::const_iterator pli = outParams.begin(); pli != outParams.end(); ++pli) { - string typeS = typeToString((*pli)->type(), package, (*pli)->optional()); + string typeS = typeToString((*pli)->type(), ns, (*pli)->optional()); _out << nl << typeS << ' ' << "iceP_" + (*pli)->name() << ";"; } @@ -631,7 +631,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) if(!outParams.empty() || ret) { _out << nl << "var ostr = inS.startWriteParams();"; - writeMarshalUnmarshalParams(outParams, op, true, package); + writeMarshalUnmarshalParams(outParams, op, true, ns); if(op->returnsClasses(false)) { _out << nl << "ostr.writePendingValues();"; @@ -677,15 +677,15 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) emitGeneratedCodeAttribute(); } _out << nl << "public override global::System.Threading.Tasks.Task<" - << getUnqualified("Ice.OutputStream", package) << ">"; + << getUnqualified("Ice.OutputStream", ns) << ">"; _out << nl << "iceDispatch(global::IceInternal.Incoming inS, " - << getUnqualified("Ice.Current", package) << " current)"; + << getUnqualified("Ice.Current", ns) << " current)"; _out << sb; _out << nl << "int pos = global::System.Array.BinarySearch(_all, current.operation, " << "global::IceUtilInternal.StringUtil.OrdinalStringComparer);"; _out << nl << "if(pos < 0)"; _out << sb; - _out << nl << "throw new " << getUnqualified("Ice.OperationNotExistException", package) + _out << nl << "throw new " << getUnqualified("Ice.OperationNotExistException", ns) << "(current.id, current.facet, current.operation);"; _out << eb; _out << sp << nl << "switch(pos)"; @@ -699,22 +699,22 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sb; if(opName == "ice_id") { - _out << nl << "return " << getUnqualified("Ice.ObjectImpl", package) + _out << nl << "return " << getUnqualified("Ice.ObjectImpl", ns) << ".iceD_ice_id(this, inS, current);"; } else if(opName == "ice_ids") { - _out << nl << "return " << getUnqualified("Ice.ObjectImpl", package) + _out << nl << "return " << getUnqualified("Ice.ObjectImpl", ns) << ".iceD_ice_ids(this, inS, current);"; } else if(opName == "ice_isA") { - _out << nl << "return " << getUnqualified("Ice.ObjectImpl", package) + _out << nl << "return " << getUnqualified("Ice.ObjectImpl", ns) << ".iceD_ice_isA(this, inS, current);"; } else if(opName == "ice_ping") { - _out << nl << "return " << getUnqualified("Ice.ObjectImpl", package) + _out << nl << "return " << getUnqualified("Ice.ObjectImpl", ns) << ".iceD_ice_ping(this, inS, current);"; } else @@ -735,7 +735,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } else { - _out << nl << "return " << getUnqualified(cl, package, "", "Disp_") + _out << nl << "return " << getUnqualified(cl, ns, "", "Disp_") << ".iceD_" << opName << "(this, inS, current);"; } break; @@ -746,7 +746,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } _out << eb; _out << sp << nl << "global::System.Diagnostics.Debug.Assert(false);"; - _out << nl << "throw new " << getUnqualified("Ice.OperationNotExistException", package) + _out << nl << "throw new " << getUnqualified("Ice.OperationNotExistException", ns) << "(current.id, current.facet, current.operation);"; _out << eb; } @@ -762,7 +762,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { string name = fixId(p->name()); string scoped = p->scoped(); - string package = getPackage(p); + string ns = getNamespace(p); ClassList allBases = p->allBases(); StringList ids; ClassList bases = p->bases(); @@ -802,7 +802,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override " << getUnqualified("Ice.SlicedData", package) << " ice_getSlicedData()"; + _out << nl << "public override " << getUnqualified("Ice.SlicedData", ns) << " ice_getSlicedData()"; _out << sb; _out << nl << "return iceSlicedData_;"; _out << eb; @@ -812,7 +812,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void iceWrite(" << getUnqualified("Ice.OutputStream", package) << " ostr_)"; + _out << nl << "public override void iceWrite(" << getUnqualified("Ice.OutputStream", ns) << " ostr_)"; _out << sb; _out << nl << "ostr_.startValue(iceSlicedData_);"; _out << nl << "iceWriteImpl(ostr_);"; @@ -824,7 +824,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void iceRead(" << getUnqualified("Ice.InputStream", package) << " istr_)"; + _out << nl << "public override void iceRead(" << getUnqualified("Ice.InputStream", ns) << " istr_)"; _out << sb; _out << nl << "istr_.startValue();"; _out << nl << "iceReadImpl(istr_);"; @@ -837,19 +837,19 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "protected override void iceWriteImpl(" << getUnqualified("Ice.OutputStream", package) << " ostr_)"; + _out << nl << "protected override void iceWriteImpl(" << getUnqualified("Ice.OutputStream", ns) << " ostr_)"; _out << sb; _out << nl << "ostr_.startSlice(ice_staticId(), " << p->compactId() << (!base ? ", true" : ", false") << ");"; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) { if(!(*d)->optional()) { - writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), package); + writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), ns); } } for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d) { - writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), package); + writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), ns); } _out << nl << "ostr_.endSlice();"; if(base) @@ -863,19 +863,19 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "protected override void iceReadImpl(" << getUnqualified("Ice.InputStream", package) << " istr_)"; + _out << nl << "protected override void iceReadImpl(" << getUnqualified("Ice.InputStream", ns) << " istr_)"; _out << sb; _out << nl << "istr_.startSlice();"; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) { if(!(*d)->optional()) { - writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), package); + writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), ns); } } for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d) { - writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), package); + writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), ns); } _out << nl << "istr_.endSlice();"; if(base) @@ -886,7 +886,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) if(preserved && !basePreserved) { - _out << sp << nl << "protected " << getUnqualified("Ice.SlicedData", package) << " iceSlicedData_;"; + _out << sp << nl << "protected " << getUnqualified("Ice.SlicedData", ns) << " iceSlicedData_;"; } _out << sp << nl << "#endregion"; // Marshalling support @@ -909,7 +909,7 @@ Slice::CsVisitor::getParamAttributes(const ParamDeclPtr& p) } vector<string> -Slice::CsVisitor::getParams(const OperationPtr& op, const string& package) +Slice::CsVisitor::getParams(const OperationPtr& op, const string& ns) { vector<string> params; ParamDeclList paramList = op->parameters(); @@ -921,14 +921,14 @@ Slice::CsVisitor::getParams(const OperationPtr& op, const string& package) { param += "out "; } - param += typeToString((*q)->type(), package, (*q)->optional(), cl->isLocal()) + " " + fixId((*q)->name()); + param += typeToString((*q)->type(), ns, (*q)->optional(), cl->isLocal()) + " " + fixId((*q)->name()); params.push_back(param); } return params; } vector<string> -Slice::CsVisitor::getInParams(const OperationPtr& op, const string& package, bool internal) +Slice::CsVisitor::getInParams(const OperationPtr& op, const string& ns, bool internal) { vector<string> params; @@ -937,14 +937,14 @@ Slice::CsVisitor::getInParams(const OperationPtr& op, const string& package, boo ParamDeclList paramList = op->inParameters(); for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) { - params.push_back(getParamAttributes(*q) + typeToString((*q)->type(), package, (*q)->optional(), cl->isLocal()) + params.push_back(getParamAttributes(*q) + typeToString((*q)->type(), ns, (*q)->optional(), cl->isLocal()) + " " + (internal ? "iceP_" + (*q)->name() : fixId((*q)->name()))); } return params; } vector<string> -Slice::CsVisitor::getOutParams(const OperationPtr& op, const string& package, bool returnParam, bool outKeyword) +Slice::CsVisitor::getOutParams(const OperationPtr& op, const string& ns, bool returnParam, bool outKeyword) { vector<string> params; if(returnParam) @@ -952,7 +952,7 @@ Slice::CsVisitor::getOutParams(const OperationPtr& op, const string& package, bo TypePtr ret = op->returnType(); if(ret) { - params.push_back(typeToString(ret, package, op->returnIsOptional()) + " ret"); + params.push_back(typeToString(ret, ns, op->returnIsOptional()) + " ret"); } } @@ -964,7 +964,7 @@ Slice::CsVisitor::getOutParams(const OperationPtr& op, const string& package, bo { s += "out "; } - s += typeToString((*q)->type(), package, (*q)->optional()) + ' ' + fixId((*q)->name()); + s += typeToString((*q)->type(), ns, (*q)->optional()) + ' ' + fixId((*q)->name()); params.push_back(s); } @@ -1005,7 +1005,7 @@ Slice::CsVisitor::getInArgs(const OperationPtr& op, bool internal) string Slice::CsVisitor::getDispatchParams(const OperationPtr& op, string& retS, vector<string>& params, vector<string>& args, - const string& package) + const string& ns) { string name; ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container()); // Get the class containing the op. @@ -1014,30 +1014,30 @@ Slice::CsVisitor::getDispatchParams(const OperationPtr& op, string& retS, vector if(cl->hasMetaData("amd") || op->hasMetaData("amd")) { name = op->name() + "Async"; - params = getInParams(op, package); + params = getInParams(op, ns); args = getInArgs(op); paramDecls = op->inParameters(); - retS = taskResultType(op, package, true); + retS = taskResultType(op, ns, true); } else if(op->hasMarshaledResult()) { name = fixId(op->name(), DotNet::ICloneable, true); - params = getInParams(op, package); + params = getInParams(op, ns); args = getInArgs(op); paramDecls = op->inParameters(); - retS = resultType(op, package, true); + retS = resultType(op, ns, true); } else { name = fixId(op->name(), DotNet::ICloneable, true); - params = getParams(op, package); + params = getParams(op, ns); args = getArgs(op); paramDecls = op->parameters(); - retS = typeToString(op->returnType(), package, op->returnIsOptional()); + retS = typeToString(op->returnType(), ns, op->returnIsOptional()); } string currentParamName = getEscapedParamName(op, "current"); - params.push_back(getUnqualified("Ice.Current", package) + " " + currentParamName + " = null"); + params.push_back(getUnqualified("Ice.Current", ns) + " " + currentParamName + " = null"); args.push_back(currentParamName); return name; } @@ -1089,7 +1089,7 @@ Slice::CsVisitor::emitPartialTypeAttributes() } string -Slice::CsVisitor::writeValue(const TypePtr& type, const string& package) +Slice::CsVisitor::writeValue(const TypePtr& type, const string& ns) { assert(type); @@ -1132,7 +1132,7 @@ Slice::CsVisitor::writeValue(const TypePtr& type, const string& package) EnumPtr en = EnumPtr::dynamicCast(type); if(en) { - return typeToString(type, package) + "." + fixId((*en->enumerators().begin())->name()); + return typeToString(type, ns) + "." + fixId((*en->enumerators().begin())->name()); } StructPtr st = StructPtr::dynamicCast(type); @@ -1144,7 +1144,7 @@ Slice::CsVisitor::writeValue(const TypePtr& type, const string& package) } else { - return "new " + typeToString(type, package) + "()"; + return "new " + typeToString(type, ns) + "()"; } } @@ -1209,7 +1209,7 @@ Slice::CsVisitor::requiresDataMemberInitializers(const DataMemberList& members) } void -Slice::CsVisitor::writeDataMemberInitializers(const DataMemberList& members, const string& package, int baseTypes, +Slice::CsVisitor::writeDataMemberInitializers(const DataMemberList& members, const string& ns, int baseTypes, bool propertyMapping) { for(DataMemberList::const_iterator p = members.begin(); p != members.end(); ++p) @@ -1232,7 +1232,7 @@ Slice::CsVisitor::writeDataMemberInitializers(const DataMemberList& members, con else if((*p)->optional()) { _out << nl << "this." << fixId((*p)->name(), baseTypes) << " = new " - << typeToString((*p)->type(), package, true) << "();"; + << typeToString((*p)->type(), ns, true) << "();"; } else { @@ -1245,7 +1245,7 @@ Slice::CsVisitor::writeDataMemberInitializers(const DataMemberList& members, con StructPtr st = StructPtr::dynamicCast((*p)->type()); if(st) { - _out << nl << "this." << fixId((*p)->name(), baseTypes) << " = new " << typeToString(st, package, false) + _out << nl << "this." << fixId((*p)->name(), baseTypes) << " = new " << typeToString(st, ns, false) << "();"; } } @@ -1907,43 +1907,30 @@ Slice::CsVisitor::writeDocCommentParam(const OperationPtr& p, ParamDir paramType } } -bool -Slice::CsVisitor::visitModuleStart(const ModulePtr& p) +void +Slice::CsVisitor::moduleStart(const ModulePtr& p) { if(!ContainedPtr::dynamicCast(p->container())) { - string package = getPackage(p); + string ns = getNamespacePrefix(p); string name = fixId(p->name()); - if(package != name) + if(!ns.empty()) { - vector<string> tokens; - IceUtilInternal::splitString(package, ".", tokens); - for(vector<string>::const_iterator p = tokens.begin(); p != tokens.end(); ++p) - { - _out << sp; - _out << nl << "namespace " << *p; - _out << sb; - } + _out << sp; + _out << nl << "namespace " << ns; + _out << sb; } } - return true; } void -Slice::CsVisitor::visitModuleEnd(const ModulePtr& p) +Slice::CsVisitor::moduleEnd(const ModulePtr& p) { if(!ContainedPtr::dynamicCast(p->container())) { - string package = getPackage(p); - string name = fixId(p->name()); - if(package != name) + if(!getNamespacePrefix(p).empty()) { - vector<string> tokens; - IceUtilInternal::splitString(package, ".", tokens); - for(vector<string>::const_iterator p = tokens.begin(); p != tokens.end(); ++p) - { - _out << eb; - } + _out << eb; } } } @@ -2032,6 +2019,9 @@ Slice::Gen::generate(const UnitPtr& p) TypesVisitor typesVisitor(_out); p->visit(&typesVisitor, false); + TypeIdVisitor typeIdVisitor(_out); + p->visit(&typeIdVisitor, false); + // // The async delegates are emitted before the proxy definition // because the proxy methods need to know the type. @@ -2181,28 +2171,33 @@ Slice::Gen::CompactIdVisitor::CompactIdVisitor(IceUtilInternal::Output& out) : } bool -Slice::Gen::CompactIdVisitor::visitUnitStart(const UnitPtr&) +Slice::Gen::CompactIdVisitor::visitUnitStart(const UnitPtr& p) { - _out << sp << nl << "namespace IceCompactId"; - _out << sb; - return true; -} + if(p->hasCompactTypeId()) + { + string typeIdNs = getCustomTypeIdNamespace(p); -void -Slice::Gen::CompactIdVisitor::visitUnitEnd(const UnitPtr&) -{ - _out << eb; -} + if(typeIdNs.empty()) + { + // TODO: replace by namespace Ice.TypeId, see issue #239 + // + _out << sp << nl << "namespace IceCompactId"; + } + else + { + _out << sp << nl << "namespace " << typeIdNs; + } -bool -Slice::Gen::CompactIdVisitor::visitModuleStart(const ModulePtr& p) -{ - return true; + _out << sb; + return true; + } + return false; } void -Slice::Gen::CompactIdVisitor::visitModuleEnd(const ModulePtr& p) +Slice::Gen::CompactIdVisitor::visitUnitEnd(const UnitPtr& p) { + _out << eb; } bool @@ -2212,6 +2207,9 @@ Slice::Gen::CompactIdVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << sp; emitGeneratedCodeAttribute(); + + // TODO: rename to class Compact_Xxx, see issue #239 + // _out << nl << "public sealed class TypeId_" << p->compactId(); _out << sb; _out << nl << "public const string typeId = \"" << p->scoped() << "\";"; @@ -2220,6 +2218,76 @@ Slice::Gen::CompactIdVisitor::visitClassDefStart(const ClassDefPtr& p) return false; } +Slice::Gen::TypeIdVisitor::TypeIdVisitor(IceUtilInternal::Output& out) : + CsVisitor(out) +{ +} + +bool +Slice::Gen::TypeIdVisitor::visitModuleStart(const ModulePtr& p) +{ + string ns = getNamespacePrefix(p); + + if(!ns.empty() && (p->hasValueDefs() || p->hasNonLocalExceptions())) + { + string name = fixId(p->name()); + if(!ContainedPtr::dynamicCast(p->container())) + { + // Top-level module + // + string typeIdNs = getCustomTypeIdNamespace(p->unit()); + if(typeIdNs.empty()) + { + typeIdNs = "Ice.TypeId"; + } + + name = typeIdNs + "." + name; + } + _out << sp << nl << "namespace " << name; + _out << sb; + return true; + } + return false; +} + +void +Slice::Gen::TypeIdVisitor::visitModuleEnd(const ModulePtr&) +{ + _out << eb; +} + +bool +Slice::Gen::TypeIdVisitor::visitClassDefStart(const ClassDefPtr& p) +{ + if(!p->isInterface() && !p->isLocal()) + { + generateHelperClass(p); + } + return false; +} + +bool +Slice::Gen::TypeIdVisitor::visitExceptionStart(const ExceptionPtr& p) +{ + if(!p->isLocal()) + { + generateHelperClass(p); + } + return false; +} + +void +Slice::Gen::TypeIdVisitor::generateHelperClass(const ContainedPtr& p) +{ + string name = fixId(p->name()); + _out << sp; + emitGeneratedCodeAttribute(); + _out << nl << "public sealed class " << name; + _out << sb; + _out << nl << "public global::" << getNamespace(p) << "." << name << " targetClass { get; }"; + _out << eb; +} + Slice::Gen::TypesVisitor::TypesVisitor(IceUtilInternal::Output& out) : CsVisitor(out) { @@ -2240,7 +2308,7 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); string name = fixId(p->name()); _out << sp; emitAttributes(p); @@ -2254,8 +2322,8 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -2263,7 +2331,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { string name = p->name(); string scoped = fixId(p->scoped()); - string package = getPackage(p); + string ns = getNamespace(p); ClassList bases = p->bases(); bool hasBaseClass = !bases.empty() && !bases.front()->isInterface(); @@ -2276,8 +2344,8 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { emitComVisibleAttribute(); OperationPtr o = p->allOperations().front(); - _out << nl << "public delegate " << typeToString(o->returnType(), package, o->returnIsOptional()) << " "; - _out << fixId(name) << spar << getParams(o, package) << epar << ";"; + _out << nl << "public delegate " << typeToString(o->returnType(), ns, o->returnIsOptional()) << " "; + _out << fixId(name) << spar << getParams(o, ns) << epar << ";"; return false; } @@ -2288,12 +2356,12 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "public partial interface " << fixId(name); if(!p->isLocal()) { - baseNames.push_back(getUnqualified("Ice.Object", package)); + baseNames.push_back(getUnqualified("Ice.Object", ns)); baseNames.push_back(name + "Operations_"); } for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q) { - baseNames.push_back(getUnqualified(*q, package)); + baseNames.push_back(getUnqualified(*q, ns)); } } else @@ -2316,12 +2384,12 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { if(!p->isLocal()) { - baseNames.push_back(getUnqualified("Ice.Value", package)); + baseNames.push_back(getUnqualified("Ice.Value", ns)); } } else { - baseNames.push_back(getUnqualified(bases.front(), package)); + baseNames.push_back(getUnqualified(bases.front(), ns)); bases.pop_front(); } @@ -2331,7 +2399,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { if((*q)->isAbstract()) { - baseNames.push_back(getUnqualified(*q, package)); + baseNames.push_back(getUnqualified(*q, ns)); } } } @@ -2395,7 +2463,7 @@ void Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) { string name = fixId(p->name()); - string package = getPackage(p); + string ns = getNamespace(p); DataMemberList classMembers = p->classDataMembers(); DataMemberList allClassMembers = p->allClassDataMembers(); DataMemberList dataMembers = p->dataMembers(); @@ -2437,7 +2505,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out << " : base()"; } _out << sb; - writeDataMemberInitializers(dataMembers, package, DotNet::ICloneable, propertyMapping); + writeDataMemberInitializers(dataMembers, ns, DotNet::ICloneable, propertyMapping); _out << nl << "ice_initialize();"; _out << eb; @@ -2448,7 +2516,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) for(DataMemberList::const_iterator d = allDataMembers.begin(); d != allDataMembers.end(); ++d) { string memberName = fixId((*d)->name(), DotNet::ICloneable); - string memberType = typeToString((*d)->type(), package, (*d)->optional(), p->isLocal(), (*d)->getMetaData()); + string memberType = typeToString((*d)->type(), ns, (*d)->optional(), p->isLocal(), (*d)->getMetaData()); paramDecl.push_back(memberType + " " + memberName); } _out << paramDecl << epar; @@ -2526,13 +2594,13 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container()); bool isLocal = cl->isLocal(); bool isInterface = cl->isInterface(); - string package = getPackage(cl); + string ns = getNamespace(cl); if(isLocal) { string name = fixId(p->name(), DotNet::ICloneable, true); TypePtr ret = p->returnType(); - string retS = typeToString(ret, package, p->returnIsOptional(), true); + string retS = typeToString(ret, ns, p->returnIsOptional(), true); _out << sp; if(isInterface) @@ -2550,11 +2618,11 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) { _out << "public abstract "; } - _out << retS << " " << name << spar << getParams(p, package) << epar << ";"; + _out << retS << " " << name << spar << getParams(p, ns) << epar << ";"; if(cl->hasMetaData("async-oneway") || p->hasMetaData("async-oneway")) { - vector<string> inParams = getInParams(p, package); + vector<string> inParams = getInParams(p, ns); ParamDeclList inParamDecls = p->inParameters(); // @@ -2568,7 +2636,7 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) { _out << "public abstract "; } - _out << taskResultType(p, package); + _out << taskResultType(p, ns); string progress = getEscapedParamName(p, "progress"); string cancel = getEscapedParamName(p, "cancel"); @@ -2589,8 +2657,8 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) { _out << "public abstract "; } - _out << getUnqualified("Ice.AsyncResult", package) << " begin_" << name << spar << inParams - << getUnqualified("Ice.AsyncCallback", package) + " " + getEscapedParamName(p, "callback") + " = null" + _out << getUnqualified("Ice.AsyncResult", ns) << " begin_" << name << spar << inParams + << getUnqualified("Ice.AsyncCallback", ns) + " " + getEscapedParamName(p, "callback") + " = null" << "object " + getEscapedParamName(p, "cookie") + " = null" << epar << ';'; _out << sp; @@ -2601,8 +2669,8 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) { _out << "public abstract "; } - _out << retS << " end_" << name << spar << getOutParams(p, package, false, true) - << (getUnqualified("Ice.AsyncResult", package) + " " + getEscapedParamName(p, "asyncResult")) << epar << ';'; + _out << retS << " end_" << name << spar << getOutParams(p, ns, false, true) + << (getUnqualified("Ice.AsyncResult", ns) + " " + getEscapedParamName(p, "asyncResult")) << epar << ';'; } } } @@ -2619,7 +2687,7 @@ bool Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) { string name = fixId(p->name()); - string package = getPackage(p); + string ns = getNamespace(p); ExceptionPtr base = p->base(); _out << sp; @@ -2637,11 +2705,11 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) _out << nl << "public partial class " << name << " : "; if(base) { - _out << getUnqualified(base, package); + _out << getUnqualified(base, ns); } else { - _out << getUnqualified(p->isLocal() ? "Ice.LocalException" : "Ice.UserException", package); + _out << getUnqualified(p->isLocal() ? "Ice.LocalException" : "Ice.UserException", ns); } _out << sb; @@ -2657,7 +2725,7 @@ void Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { string name = fixId(p->name()); - string package = getPackage(p); + string ns = getNamespace(p); DataMemberList allDataMembers = p->allDataMembers(); DataMemberList dataMembers = p->dataMembers(); DataMemberList allClassMembers = p->allClassDataMembers(); @@ -2668,7 +2736,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) for(DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q) { string memberName = fixId((*q)->name()); - string memberType = typeToString((*q)->type(), package, (*q)->optional()); + string memberType = typeToString((*q)->type(), ns, (*q)->optional()); allParamDecl.push_back(memberType + " " + memberName); } @@ -2682,7 +2750,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name()); - string memberType = typeToString((*q)->type(), package, (*q)->optional()); + string memberType = typeToString((*q)->type(), ns, (*q)->optional()); paramDecl.push_back(memberType + " " + memberName); } @@ -2712,7 +2780,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) emitGeneratedCodeAttribute(); _out << nl << "private void _initDM()"; _out << sb; - writeDataMemberInitializers(dataMembers, package, DotNet::Exception); + writeDataMemberInitializers(dataMembers, ns, DotNet::Exception); _out << eb; } @@ -2743,7 +2811,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string name = fixId((*q)->name(), DotNet::Exception, false); - writeSerializeDeserializeCode(_out, (*q)->type(), package, name, (*q)->optional(), (*q)->tag(), false); + writeSerializeDeserializeCode(_out, (*q)->type(), ns, name, (*q)->optional(), (*q)->tag(), false); } _out << eb; @@ -2864,7 +2932,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string name = fixId((*q)->name(), DotNet::Exception, false); - writeSerializeDeserializeCode(_out, (*q)->type(), package, name, (*q)->optional(), (*q)->tag(), true); + writeSerializeDeserializeCode(_out, (*q)->type(), ns, name, (*q)->optional(), (*q)->tag(), true); } _out << sp << nl << "base.GetObjectData(info, context);"; _out << eb; @@ -2904,14 +2972,14 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override " << getUnqualified("Ice.SlicedData", package) << " ice_getSlicedData()"; + _out << nl << "public override " << getUnqualified("Ice.SlicedData", ns) << " ice_getSlicedData()"; _out << sb; _out << nl << "return slicedData_;"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void iceWrite(" << getUnqualified("Ice.OutputStream", package) << " ostr_)"; + _out << nl << "public override void iceWrite(" << getUnqualified("Ice.OutputStream", ns) << " ostr_)"; _out << sb; _out << nl << "ostr_.startException(slicedData_);"; _out << nl << "iceWriteImpl(ostr_);"; @@ -2920,7 +2988,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void iceRead(" << getUnqualified("Ice.InputStream", package) << " istr_)"; + _out << nl << "public override void iceRead(" << getUnqualified("Ice.InputStream", ns) << " istr_)"; _out << sb; _out << nl << "istr_.startException();"; _out << nl << "iceReadImpl(istr_);"; @@ -2930,12 +2998,12 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "protected override void iceWriteImpl(" << getUnqualified("Ice.OutputStream", package) << " ostr_)"; + _out << nl << "protected override void iceWriteImpl(" << getUnqualified("Ice.OutputStream", ns) << " ostr_)"; _out << sb; _out << nl << "ostr_.startSlice(\"" << scoped << "\", -1, " << (!base ? "true" : "false") << ");"; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - writeMarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), package); + writeMarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), ns); } _out << nl << "ostr_.endSlice();"; if(base) @@ -2946,13 +3014,13 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "protected override void iceReadImpl(" << getUnqualified("Ice.InputStream", package) << " istr_)"; + _out << nl << "protected override void iceReadImpl(" << getUnqualified("Ice.InputStream", ns) << " istr_)"; _out << sb; _out << nl << "istr_.startSlice();"; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - writeUnmarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), package); + writeUnmarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), ns); } _out << nl << "istr_.endSlice();"; if(base) @@ -2973,7 +3041,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(preserved && !basePreserved) { - _out << sp << nl << "protected " << getUnqualified("Ice.SlicedData", package) << " slicedData_;"; + _out << sp << nl << "protected " << getUnqualified("Ice.SlicedData", ns) << " slicedData_;"; } _out << sp << nl << "#endregion"; // Marshalling support @@ -2986,7 +3054,7 @@ bool Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p) { string name = fixId(p->name()); - string package = getPackage(p); + string ns = getNamespace(p); _out << sp; emitDeprecate(p, 0, _out, "type"); @@ -3024,7 +3092,7 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p) { _out << ", "; } - _out << getUnqualified(*q, package); + _out << getUnqualified(*q, ns); } } @@ -3040,7 +3108,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) { string name = fixId(p->name()); string scope = fixId(p->scope()); - string package = getPackage(p); + string ns = getNamespace(p); DataMemberList classMembers = p->classDataMembers(); DataMemberList dataMembers = p->dataMembers(); @@ -3064,7 +3132,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) emitGeneratedCodeAttribute(); _out << nl << "public " << name << "()"; _out << sb; - writeDataMemberInitializers(dataMembers, package, DotNet::ICloneable, propertyMapping); + writeDataMemberInitializers(dataMembers, ns, DotNet::ICloneable, propertyMapping); _out << nl << "ice_initialize();"; _out << eb; } @@ -3076,7 +3144,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); - string memberType = typeToString((*q)->type(), package, false, p->isLocal()); + string memberType = typeToString((*q)->type(), ns, false, p->isLocal()); paramDecl.push_back(memberType + " " + memberName); } _out << paramDecl << epar; @@ -3186,27 +3254,27 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public void ice_writeMembers(" << getUnqualified("Ice.OutputStream", package) << " ostr)"; + _out << nl << "public void ice_writeMembers(" << getUnqualified("Ice.OutputStream", ns) << " ostr)"; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), package, true); + writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), ns, true); } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public void ice_readMembers(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << nl << "public void ice_readMembers(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - writeUnmarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), package, true); + writeUnmarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), ns, true); } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static void ice_write(" << getUnqualified("Ice.OutputStream", package) << " ostr, " << name + _out << nl << "public static void ice_write(" << getUnqualified("Ice.OutputStream", ns) << " ostr, " << name << " v)"; _out << sb; if(isClass) @@ -3228,7 +3296,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static " << name << " ice_read(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << nl << "public static " << name << " ice_read(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; _out << nl << "var v = new " << name << "();"; _out << nl << "v.ice_readMembers(istr);"; @@ -3254,7 +3322,7 @@ void Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { string name = fixId(p->name()); - string package = getPackage(p); + string ns = getNamespace(p); string scoped = fixId(p->scoped()); EnumeratorList enumerators = p->enumerators(); const bool explicitValue = p->explicitValue(); @@ -3286,18 +3354,18 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << nl << "public sealed class " << p->name() << "Helper"; _out << sb; _out << sp; - _out << nl << "public static void write(" << getUnqualified("Ice.OutputStream", package) << " ostr, " << name + _out << nl << "public static void write(" << getUnqualified("Ice.OutputStream", ns) << " ostr, " << name << " v)"; _out << sb; - writeMarshalUnmarshalCode(_out, p, package, "v", true); + writeMarshalUnmarshalCode(_out, p, ns, "v", true); _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static " << name << " read(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << nl << "public static " << name << " read(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; _out << nl << name << " v;"; - writeMarshalUnmarshalCode(_out, p, package, "v", false); + writeMarshalUnmarshalCode(_out, p, ns, "v", false); _out << nl << "return v;"; _out << eb; @@ -3336,7 +3404,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) StructPtr st = StructPtr::dynamicCast(cont); ExceptionPtr ex = ExceptionPtr::dynamicCast(cont); ClassDefPtr cl = ClassDefPtr::dynamicCast(cont); - string package = getPackage(cont); + string ns = getNamespace(cont); if(st) { isLocal = st->isLocal(); @@ -3372,7 +3440,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) emitDeprecate(p, cont, _out, "member"); - string type = typeToString(p->type(), package, isOptional, isLocal, p->getMetaData()); + string type = typeToString(p->type(), ns, isOptional, isLocal, p->getMetaData()); string propertyName = fixId(p->name(), baseTypes, isClass); string dataMemberName; if(isProperty) @@ -3569,7 +3637,7 @@ Slice::Gen::ResultVisitor::visitModuleStart(const ModulePtr& p) { if(hasResultType(p)) { - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -3580,8 +3648,8 @@ Slice::Gen::ResultVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ResultVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -3599,7 +3667,7 @@ void Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) { ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container()); - string package = getPackage(cl); + string ns = getNamespace(cl); if(cl->isLocal()) { return; @@ -3615,7 +3683,7 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) string retSName; if(ret) { - retS = typeToString(ret, package, p->returnIsOptional()); + retS = typeToString(ret, ns, p->returnIsOptional()); retSName = resultStructReturnValueName(outParams); } @@ -3633,7 +3701,7 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) } for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { - _out << (typeToString((*i)->type(), package, (*i)->optional()) + " " + fixId((*i)->name())); + _out << (typeToString((*i)->type(), ns, (*i)->optional()) + " " + fixId((*i)->name())); } _out << epar; @@ -3662,7 +3730,7 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { - _out << nl << "public " << typeToString((*i)->type(), package, (*i)->optional()) << " " << fixId((*i)->name()) + _out << nl << "public " << typeToString((*i)->type(), ns, (*i)->optional()) << " " << fixId((*i)->name()) << ";"; } _out << eb; @@ -3674,18 +3742,18 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public struct " << name << " : " << getUnqualified("Ice.MarshaledResult", package); + _out << nl << "public struct " << name << " : " << getUnqualified("Ice.MarshaledResult", ns); _out << sb; // // One shot constructor // - _out << nl << "public " << name << spar << getOutParams(p, package, true, false) - << getUnqualified("Ice.Current", package) + " current" << epar; + _out << nl << "public " << name << spar << getOutParams(p, ns, true, false) + << getUnqualified("Ice.Current", ns) + " current" << epar; _out << sb; _out << nl << "_ostr = global::IceInternal.Incoming.createResponseOutputStream(current);"; - _out << nl << "_ostr.startEncapsulation(current.encoding, " << opFormatTypeToString(p, package) << ");"; - writeMarshalUnmarshalParams(outParams, p, true, package, false, true, "_ostr"); + _out << nl << "_ostr.startEncapsulation(current.encoding, " << opFormatTypeToString(p, ns) << ");"; + writeMarshalUnmarshalParams(outParams, p, true, ns, false, true, "_ostr"); if(p->returnsClasses(false)) { _out << nl << "_ostr.writePendingValues();"; @@ -3693,26 +3761,26 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) _out << nl << "_ostr.endEncapsulation();"; _out << eb; _out << sp; - _out << nl << "public " << getUnqualified("Ice.OutputStream", package) << " getOutputStream(" - << getUnqualified("Ice.Current", package) << " current)"; + _out << nl << "public " << getUnqualified("Ice.OutputStream", ns) << " getOutputStream(" + << getUnqualified("Ice.Current", ns) << " current)"; _out << sb; _out << nl << "if(_ostr == null)"; _out << sb; _out << nl << "return new " << name << spar; if(ret) { - _out << writeValue(ret, package); + _out << writeValue(ret, ns); } for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { - _out << writeValue((*i)->type(), package); + _out << writeValue((*i)->type(), ns); } _out << "current" << epar << ".getOutputStream(current);"; _out << eb; _out << nl << "return _ostr;"; _out << eb; _out << sp; - _out << nl << "private " << getUnqualified("Ice.OutputStream", package) << " _ostr;"; + _out << nl << "private " << getUnqualified("Ice.OutputStream", ns) << " _ostr;"; _out << eb; } } @@ -3730,7 +3798,7 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -3739,8 +3807,8 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -3752,7 +3820,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) } string name = p->name(); - string package = getPackage(p); + string ns = getNamespace(p); ClassList bases = p->bases(); _out << sp; @@ -3766,13 +3834,13 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) ClassDefPtr def = *q; if(def->isInterface() || def->allOperations().size() > 0) { - baseInterfaces.push_back(getUnqualified(*q, package, "", "Prx")); + baseInterfaces.push_back(getUnqualified(*q, ns, "", "Prx")); } } if(baseInterfaces.empty()) { - baseInterfaces.push_back(getUnqualified("Ice.ObjectPrx", package)); + baseInterfaces.push_back(getUnqualified("Ice.ObjectPrx", ns)); } for(vector<string>::const_iterator q = baseInterfaces.begin(); q != baseInterfaces.end();) @@ -3798,11 +3866,11 @@ void Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container()); - string package = getPackage(cl); + string ns = getNamespace(cl); string name = fixId(p->name(), DotNet::ICloneable, true); - vector<string> inParams = getInParams(p, package); + vector<string> inParams = getInParams(p, ns); ParamDeclList inParamDecls = p->inParameters(); - string retS = typeToString(p->returnType(), package, p->returnIsOptional()); + string retS = typeToString(p->returnType(), ns, p->returnIsOptional()); string deprecateReason = getDeprecateReason(p, cl, "operation"); { @@ -3817,9 +3885,9 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << retS << " " << name << spar << getParams(p, package) - << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") << epar << ';'; + _out << nl << retS << " " << name << spar << getParams(p, ns) + << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << epar << ';'; } { @@ -3839,10 +3907,10 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << taskResultType(p, package); + _out << nl << taskResultType(p, ns); _out << " " << p->name() << "Async" << spar << inParams - << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") + << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << ("global::System.IProgress<bool> " + progress + " = null") << ("global::System.Threading.CancellationToken " + cancel + " = new global::System.Threading.CancellationToken()") << epar << ";"; @@ -3866,10 +3934,10 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << getUnqualified("Ice.AsyncResult", package) << "<" << delType << "> begin_" << p->name() << spar + _out << nl << getUnqualified("Ice.AsyncResult", ns) << "<" << delType << "> begin_" << p->name() << spar << inParams - << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") << epar << ';'; + << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << epar << ';'; // // Type-unsafe begin_ methods. @@ -3882,8 +3950,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << getUnqualified("Ice.AsyncResult", package) << " begin_" << p->name() << spar << inParams - << getUnqualified("Ice.AsyncCallback", package) + " " + callback << "object " + cookie << epar << ';'; + _out << nl << getUnqualified("Ice.AsyncResult", ns) << " begin_" << p->name() << spar << inParams + << getUnqualified("Ice.AsyncCallback", ns) + " " + callback << "object " + cookie << epar << ';'; _out << sp; writeDocCommentAMI(p, InParam, deprecateReason, @@ -3894,9 +3962,9 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << getUnqualified("Ice.AsyncResult", package) << " begin_" << p->name() << spar << inParams - << getUnqualified("Ice.OptionalContext", package) + " " + context - << getUnqualified("Ice.AsyncCallback", package) + " " + callback + _out << nl << getUnqualified("Ice.AsyncResult", ns) << " begin_" << p->name() << spar << inParams + << getUnqualified("Ice.OptionalContext", ns) + " " + context + << getUnqualified("Ice.AsyncCallback", ns) + " " + callback << "object " + cookie << epar << ';'; // @@ -3909,8 +3977,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { _out << nl << "[global::System.Obsolete(\"" << deprecateReason << "\")]"; } - _out << nl << retS << " end_" << p->name() << spar << getOutParams(p, package, false, true) - << getUnqualified("Ice.AsyncResult", package) + " " + asyncResult << epar << ';'; + _out << nl << retS << " end_" << p->name() << spar << getOutParams(p, ns, false, true) + << getUnqualified("Ice.AsyncResult", ns) + " " + asyncResult << epar << ';'; } } @@ -3922,7 +3990,7 @@ Slice::Gen::AsyncDelegateVisitor::AsyncDelegateVisitor(IceUtilInternal::Output& bool Slice::Gen::AsyncDelegateVisitor::visitModuleStart(const ModulePtr& p) { - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -3931,8 +3999,8 @@ Slice::Gen::AsyncDelegateVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::AsyncDelegateVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -3959,9 +4027,9 @@ Slice::Gen::AsyncDelegateVisitor::visitOperation(const OperationPtr& p) return; } - string package = getPackage(cl); - vector<string> paramDeclAMI = getOutParams(p, package, false, false); - string retS = typeToString(p->returnType(), package, p->returnIsOptional()); + string ns = getNamespace(cl); + vector<string> paramDeclAMI = getOutParams(p, ns, false, false); + string retS = typeToString(p->returnType(), ns, p->returnIsOptional()); string delName = "Callback_" + cl->name() + "_" + p->name(); _out << sp; @@ -3986,7 +4054,7 @@ Slice::Gen::OpsVisitor::visitModuleStart(const ModulePtr& p) { return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -3995,8 +4063,8 @@ Slice::Gen::OpsVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::OpsVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -4010,7 +4078,7 @@ Slice::Gen::OpsVisitor::visitClassDefStart(const ClassDefPtr& p) return false; } string name = p->name(); - string package = getPackage(p); + string ns = getNamespace(p); string scoped = fixId(p->scoped()); ClassList bases = p->bases(); string opIntfName = "Operations"; @@ -4036,7 +4104,7 @@ Slice::Gen::OpsVisitor::visitClassDefStart(const ClassDefPtr& p) { first = false; } - _out << getUnqualified(*q, package, "", "Operations_"); + _out << getUnqualified(*q, ns, "", "Operations_"); } ++q; } @@ -4050,7 +4118,7 @@ Slice::Gen::OpsVisitor::visitClassDefStart(const ClassDefPtr& p) bool amd = !p->isLocal() && (p->hasMetaData("amd") || op->hasMetaData("amd")); string retS; vector<string> params, args; - string name = getDispatchParams(op, retS, params, args, package); + string name = getDispatchParams(op, retS, params, args, ns); _out << sp; if(amd) { @@ -4085,7 +4153,7 @@ Slice::Gen::HelperVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -4094,8 +4162,8 @@ Slice::Gen::HelperVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -4107,14 +4175,14 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } string name = p->name(); - string package = getPackage(p); + string ns = getNamespace(p); ClassList bases = p->bases(); _out << sp; emitComVisibleAttribute(); emitGeneratedCodeAttribute(); _out << nl << "[global::System.Serializable]"; - _out << nl << "public sealed class " << name << "PrxHelper : " << getUnqualified("Ice.ObjectPrxHelperBase", package) + _out << nl << "public sealed class " << name << "PrxHelper : " << getUnqualified("Ice.ObjectPrxHelperBase", ns) << ", " << name << "Prx"; _out << sb; @@ -4142,9 +4210,9 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container()); string opName = fixId(op->name(), DotNet::ICloneable, true); TypePtr ret = op->returnType(); - string retS = typeToString(ret, package, op->returnIsOptional()); + string retS = typeToString(ret, ns, op->returnIsOptional()); - vector<string> params = getParams(op, package); + vector<string> params = getParams(op, ns); vector<string> args = getArgs(op); vector<string> argsAMI = getInArgs(op); @@ -4173,8 +4241,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp; _out << nl << "public " << retS << " " << opName << spar << params - << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") << epar; + << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << epar; _out << sb; _out << nl << "try"; _out << sb; @@ -4243,7 +4311,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) OperationPtr op = *r; ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container()); - vector<string> paramsAMI = getInParams(op, package); + vector<string> paramsAMI = getInParams(op, ns); vector<string> argsAMI = getInArgs(op); string opName = op->name(); @@ -4257,9 +4325,9 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) TypePtr ret = op->returnType(); - string retS = typeToString(ret, package, op->returnIsOptional()); + string retS = typeToString(ret, ns, op->returnIsOptional()); - string returnTypeS = resultType(op, package); + string returnTypeS = resultType(op, ns); ExceptionList throws = op->throws(); throws.sort(); @@ -4287,8 +4355,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << "<" << returnTypeS << ">"; } _out << " " << opName << "Async" << spar << paramsAMI - << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") + << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << ("global::System.IProgress<bool> " + progress + " = null") << ("global::System.Threading.CancellationToken " + cancel + " = new global::System.Threading.CancellationToken()") << epar; @@ -4307,8 +4375,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "<" << returnTypeS << ">"; } - _out << " _iceI_" << opName << "Async" << spar << getInParams(op, package, true) - << getUnqualified("Ice.OptionalContext", package) + " context" + _out << " _iceI_" << opName << "Async" << spar << getInParams(op, ns, true) + << getUnqualified("Ice.OptionalContext", ns) + " context" << "global::System.IProgress<bool> progress" << "global::System.Threading.CancellationToken cancel" << "bool synchronous" << epar; @@ -4342,7 +4410,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) // Write the common invoke method // _out << sp << nl; - _out << "private void _iceI_" << op->name() << spar << getInParams(op, package, true) + _out << "private void _iceI_" << op->name() << spar << getInParams(op, ns, true) << "global::System.Collections.Generic.Dictionary<string, string> context" << "bool synchronous" << "global::IceInternal.OutgoingAsyncCompletionCallback completed" << epar; @@ -4360,16 +4428,16 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "outAsync.invoke("; _out.inc(); _out << nl << flatName << ","; - _out << nl << sliceModeToIceMode(op->sendMode(), package) << ","; - _out << nl << opFormatTypeToString(op, package) << ","; + _out << nl << sliceModeToIceMode(op->sendMode(), ns) << ","; + _out << nl << opFormatTypeToString(op, ns) << ","; _out << nl << "context,"; _out << nl << "synchronous"; if(!inParams.empty()) { _out << ","; - _out << nl << "write: (" << getUnqualified("Ice.OutputStream", package) << " ostr) =>"; + _out << nl << "write: (" << getUnqualified("Ice.OutputStream", ns) << " ostr) =>"; _out << sb; - writeMarshalUnmarshalParams(inParams, 0, true, package); + writeMarshalUnmarshalParams(inParams, 0, true, ns); if(op->sendsClasses(false)) { _out << nl << "ostr.writePendingValues();"; @@ -4380,7 +4448,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(!throws.empty()) { _out << ","; - _out << nl << "userException: (" << getUnqualified("Ice.UserException", package) << " ex) =>"; + _out << nl << "userException: (" << getUnqualified("Ice.UserException", ns) << " ex) =>"; _out << sb; _out << nl << "try"; _out << sb; @@ -4392,13 +4460,13 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) // for(ExceptionList::const_iterator i = throws.begin(); i != throws.end(); ++i) { - _out << nl << "catch(" << getUnqualified(*i, package) << ")"; + _out << nl << "catch(" << getUnqualified(*i, ns) << ")"; _out << sb; _out << nl << "throw;"; _out << eb; } - _out << nl << "catch(" << getUnqualified("Ice.UserException", package) << ")"; + _out << nl << "catch(" << getUnqualified("Ice.UserException", ns) << ")"; _out << sb; _out << eb; @@ -4408,7 +4476,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(ret || !outParams.empty()) { _out << ","; - _out << nl << "read: (" << getUnqualified("Ice.InputStream", package) << " istr) =>"; + _out << nl << "read: (" << getUnqualified("Ice.InputStream", ns) << " istr) =>"; _out << sb; if(outParams.empty()) { @@ -4427,7 +4495,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } else if(isClassType(ret)) { - _out << " = " << getUnqualified("Ice.Util", package) << ".None"; + _out << " = " << getUnqualified("Ice.Util", ns) << ".None"; } _out << ";"; } @@ -4438,14 +4506,14 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) else { TypePtr t = outParams.front()->type(); - _out << nl << typeToString(t, package, (outParams.front()->optional())) << " iceP_" + _out << nl << typeToString(t, ns, (outParams.front()->optional())) << " iceP_" << outParams.front()->name(); if(!outParams.front()->optional()) { StructPtr st = StructPtr::dynamicCast(t); if(st && isValueType(st)) { - _out << " = " << "new " << typeToString(t, package) << "()"; + _out << " = " << "new " << typeToString(t, ns) << "()"; } else if(isClassType(t) || st) { @@ -4454,12 +4522,12 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } else if(isClassType(t)) { - _out << " = " << getUnqualified("Ice.Util", package) << ".None"; + _out << " = " << getUnqualified("Ice.Util", ns) << ".None"; } _out << ";"; } - writeMarshalUnmarshalParams(outParams, op, false, package, true); + writeMarshalUnmarshalParams(outParams, op, false, ns, true); if(op->returnsClasses(false)) { _out << nl << "istr.readPendingValues();"; @@ -4491,48 +4559,48 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) OperationPtr op = *r; ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container()); - vector<string> paramsAMI = getInParams(op, package); + vector<string> paramsAMI = getInParams(op, ns); vector<string> argsAMI = getInArgs(op); string opName = op->name(); ParamDeclList inParams = op->inParameters(); ParamDeclList outParams = op->outParameters(); TypePtr ret = op->returnType(); - string retS = typeToString(ret, package, op->returnIsOptional()); + string retS = typeToString(ret, ns, op->returnIsOptional()); - string returnTypeS = resultType(op, package); + string returnTypeS = resultType(op, ns); // // Write the begin_ methods. // - string clScope = getPackage(cl); - string delType = getUnqualified(clScope + ".Callback_" + cl->name() + "_" + op->name(), package); + string clScope = getNamespace(cl); + string delType = getUnqualified(clScope + ".Callback_" + cl->name() + "_" + op->name(), ns); string context = getEscapedParamName(op, "context"); string callback = getEscapedParamName(op, "callback"); string cookie = getEscapedParamName(op, "cookie"); _out << sp; - _out << nl << "public " << getUnqualified("Ice.AsyncResult", package) << "<" << delType << "> begin_" << opName - << spar << paramsAMI << (getUnqualified("Ice.OptionalContext", package) + " " + context + " = new " + - getUnqualified("Ice.OptionalContext", package) + "()") << epar; + _out << nl << "public " << getUnqualified("Ice.AsyncResult", ns) << "<" << delType << "> begin_" << opName + << spar << paramsAMI << (getUnqualified("Ice.OptionalContext", ns) + " " + context + " = new " + + getUnqualified("Ice.OptionalContext", ns) + "()") << epar; _out << sb; _out << nl << "return begin_" << opName << spar << argsAMI << context << "null" << "null" << "false" << epar << ';'; _out << eb; _out << sp; - _out << nl << "public " << getUnqualified("Ice.AsyncResult", package) << " begin_" << opName << spar << paramsAMI - << getUnqualified("Ice.AsyncCallback", package) + " " + callback << "object " + cookie << epar; + _out << nl << "public " << getUnqualified("Ice.AsyncResult", ns) << " begin_" << opName << spar << paramsAMI + << getUnqualified("Ice.AsyncCallback", ns) + " " + callback << "object " + cookie << epar; _out << sb; _out << nl << "return begin_" << opName << spar << argsAMI - << "new " + getUnqualified("Ice.OptionalContext", package) + "()" << callback << cookie << "false" << epar << ';'; + << "new " + getUnqualified("Ice.OptionalContext", ns) + "()" << callback << cookie << "false" << epar << ';'; _out << eb; _out << sp; - _out << nl << "public " << getUnqualified("Ice.AsyncResult", package) + " begin_" << opName << spar << paramsAMI - << getUnqualified("Ice.OptionalContext", package) + " " + context - << getUnqualified("Ice.AsyncCallback", package) + " " + callback + _out << nl << "public " << getUnqualified("Ice.AsyncResult", ns) + " begin_" << opName << spar << paramsAMI + << getUnqualified("Ice.OptionalContext", ns) + " " + context + << getUnqualified("Ice.AsyncCallback", ns) + " " + callback << "object " + cookie << epar; _out << sb; _out << nl << "return begin_" << opName << spar << argsAMI << context << callback @@ -4545,8 +4613,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) string flatName = "_" + opName + "_name"; string asyncResult = getEscapedParamName(op, "asyncResult"); - _out << sp << nl << "public " << retS << " end_" << opName << spar << getOutParams(op, package, false, true) - << getUnqualified("Ice.AsyncResult", package) + " " + asyncResult << epar; + _out << sp << nl << "public " << retS << " end_" << opName << spar << getOutParams(op, ns, false, true) + << getUnqualified("Ice.AsyncResult", ns) + " " + asyncResult << epar; _out << sb; _out << nl << "var resultI_ = global::IceInternal.AsyncResultI.check(" + asyncResult + ", this, " << flatName << ");"; @@ -4586,10 +4654,10 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) // Write the common begin_ implementation. // _out << sp; - _out << nl << "private " << getUnqualified("Ice.AsyncResult", package) << "<" << delType << "> begin_" << opName << spar - << getInParams(op, package, true) + _out << nl << "private " << getUnqualified("Ice.AsyncResult", ns) << "<" << delType << "> begin_" << opName << spar + << getInParams(op, ns, true) << "global::System.Collections.Generic.Dictionary<string, string> context" - << getUnqualified("Ice.AsyncCallback", package) + " completedCallback" << "object cookie" << "bool synchronous" + << getUnqualified("Ice.AsyncCallback", ns) + " completedCallback" << "object cookie" << "bool synchronous" << epar; _out << sb; @@ -4643,7 +4711,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "#endregion"; // Asynchronous operations _out << sp << nl << "#region Checked and unchecked cast operations"; - _out << sp << nl << "public static " << name << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", package) << " b)"; + _out << sp << nl << "public static " << name << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b)"; _out << sb; _out << nl << "if(b == null)"; _out << sb; @@ -4660,7 +4728,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << eb; _out << sp << nl << "public static " << name - << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", package) + << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b, global::System.Collections.Generic.Dictionary<string, string> ctx)"; _out << sb; _out << nl << "if(b == null)"; @@ -4677,14 +4745,14 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "return r;"; _out << eb; - _out << sp << nl << "public static " << name << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", package) + _out << sp << nl << "public static " << name << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b, string f)"; _out << sb; _out << nl << "if(b == null)"; _out << sb; _out << nl << "return null;"; _out << eb; - _out << nl << getUnqualified("Ice.ObjectPrx", package) << " bb = b.ice_facet(f);"; + _out << nl << getUnqualified("Ice.ObjectPrx", ns) << " bb = b.ice_facet(f);"; _out << nl << "try"; _out << sb; _out << nl << "if(bb.ice_isA(ice_staticId()))"; @@ -4694,21 +4762,21 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "return h;"; _out << eb; _out << eb; - _out << nl << "catch(" << getUnqualified("Ice.FacetNotExistException", package) << ")"; + _out << nl << "catch(" << getUnqualified("Ice.FacetNotExistException", ns) << ")"; _out << sb; _out << eb; _out << nl << "return null;"; _out << eb; _out << sp << nl << "public static " << name - << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", package) << " b, string f, " + << "Prx checkedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b, string f, " << "global::System.Collections.Generic.Dictionary<string, string> ctx)"; _out << sb; _out << nl << "if(b == null)"; _out << sb; _out << nl << "return null;"; _out << eb; - _out << nl << getUnqualified("Ice.ObjectPrx", package) << " bb = b.ice_facet(f);"; + _out << nl << getUnqualified("Ice.ObjectPrx", ns) << " bb = b.ice_facet(f);"; _out << nl << "try"; _out << sb; _out << nl << "if(bb.ice_isA(ice_staticId(), ctx))"; @@ -4718,13 +4786,13 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "return h;"; _out << eb; _out << eb; - _out << nl << "catch(" << getUnqualified("Ice.FacetNotExistException", package) << ")"; + _out << nl << "catch(" << getUnqualified("Ice.FacetNotExistException", ns) << ")"; _out << sb; _out << eb; _out << nl << "return null;"; _out << eb; - _out << sp << nl << "public static " << name << "Prx uncheckedCast(" << getUnqualified("Ice.ObjectPrx", package) << " b)"; + _out << sp << nl << "public static " << name << "Prx uncheckedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b)"; _out << sb; _out << nl << "if(b == null)"; _out << sb; @@ -4740,14 +4808,14 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "return r;"; _out << eb; - _out << sp << nl << "public static " << name << "Prx uncheckedCast(" << getUnqualified("Ice.ObjectPrx", package) + _out << sp << nl << "public static " << name << "Prx uncheckedCast(" << getUnqualified("Ice.ObjectPrx", ns) << " b, string f)"; _out << sb; _out << nl << "if(b == null)"; _out << sb; _out << nl << "return null;"; _out << eb; - _out << nl << getUnqualified("Ice.ObjectPrx", package) << " bb = b.ice_facet(f);"; + _out << nl << getUnqualified("Ice.ObjectPrx", ns) << " bb = b.ice_facet(f);"; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; _out << nl << "h.iceCopyFrom(bb);"; _out << nl << "return h;"; @@ -4797,15 +4865,15 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "#region Marshaling support"; - _out << sp << nl << "public static void write(" << getUnqualified("Ice.OutputStream", package) << " ostr, " << name + _out << sp << nl << "public static void write(" << getUnqualified("Ice.OutputStream", ns) << " ostr, " << name << "Prx v)"; _out << sb; _out << nl << "ostr.writeProxy(v);"; _out << eb; - _out << sp << nl << "public static " << name << "Prx read(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << sp << nl << "public static " << name << "Prx read(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; - _out << nl << getUnqualified("Ice.ObjectPrx", package) << " proxy = istr.readProxy();"; + _out << nl << getUnqualified("Ice.ObjectPrx", ns) << " proxy = istr.readProxy();"; _out << nl << "if(proxy != null)"; _out << sb; _out << nl << name << "PrxHelper result = new " << name << "PrxHelper();"; @@ -4837,23 +4905,23 @@ Slice::Gen::HelperVisitor::visitSequence(const SequencePtr& p) return; } - string package = getPackage(p); - string typeS = typeToString(p, package); + string ns = getNamespace(p); + string typeS = typeToString(p, ns); _out << sp; emitGeneratedCodeAttribute(); _out << nl << "public sealed class " << p->name() << "Helper"; _out << sb; - _out << sp << nl << "public static void write(" << getUnqualified("Ice.OutputStream", package) << " ostr, " << typeS + _out << sp << nl << "public static void write(" << getUnqualified("Ice.OutputStream", ns) << " ostr, " << typeS << " v)"; _out << sb; - writeSequenceMarshalUnmarshalCode(_out, p, package, "v", true, false); + writeSequenceMarshalUnmarshalCode(_out, p, ns, "v", true, false); _out << eb; - _out << sp << nl << "public static " << typeS << " read(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << sp << nl << "public static " << typeS << " read(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; _out << nl << typeS << " v;"; - writeSequenceMarshalUnmarshalCode(_out, p, package, "v", false, false); + writeSequenceMarshalUnmarshalCode(_out, p, ns, "v", false, false); _out << nl << "return v;"; _out << eb; _out << eb; @@ -4918,9 +4986,9 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) genericType = meta.substr(prefix.size()); } - string package = getPackage(p); - string keyS = typeToString(key, package); - string valueS = typeToString(value, package); + string ns = getNamespace(p); + string keyS = typeToString(key, ns); + string valueS = typeToString(value, ns); string name = "global::System.Collections.Generic." + genericType + "<" + keyS + ", " + valueS + ">"; _out << sp; @@ -4930,7 +4998,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "public static void write("; _out.useCurrentPosAsIndent(); - _out << getUnqualified("Ice.OutputStream", package) << " ostr,"; + _out << getUnqualified("Ice.OutputStream", ns) << " ostr,"; _out << nl << name << " v)"; _out.restoreIndent(); _out << sb; @@ -4945,13 +5013,13 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << "Generic.KeyValuePair<" << keyS << ", " << valueS << ">"; _out << " e in v)"; _out << sb; - writeMarshalUnmarshalCode(_out, key, package, "e.Key", true); - writeMarshalUnmarshalCode(_out, value, package, "e.Value", true); + writeMarshalUnmarshalCode(_out, key, ns, "e.Key", true); + writeMarshalUnmarshalCode(_out, value, ns, "e.Value", true); _out << eb; _out << eb; _out << eb; - _out << sp << nl << "public static " << name << " read(" << getUnqualified("Ice.InputStream", package) << " istr)"; + _out << sp << nl << "public static " << name << " read(" << getUnqualified("Ice.InputStream", ns) << " istr)"; _out << sb; _out << nl << "int sz = istr.readSize();"; _out << nl << name << " r = new " << name << "();"; @@ -4963,20 +5031,20 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) { if(isValueType(st)) { - _out << nl << "k = new " << typeToString(key, package) << "();"; + _out << nl << "k = new " << typeToString(key, ns) << "();"; } else { _out << nl << "k = null;"; } } - writeMarshalUnmarshalCode(_out, key, package, "k", false); + writeMarshalUnmarshalCode(_out, key, ns, "k", false); if(isClassType(value)) { ostringstream os; - os << '(' << typeToString(value, package) << " v) => { r[k] = v; }"; - writeMarshalUnmarshalCode(_out, value, package, os.str(), false); + os << '(' << typeToString(value, ns) << " v) => { r[k] = v; }"; + writeMarshalUnmarshalCode(_out, value, ns, os.str(), false); } else { @@ -4986,14 +5054,14 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) { if(isValueType(st)) { - _out << nl << "v = new " << typeToString(value, package) << "();"; + _out << nl << "v = new " << typeToString(value, ns) << "();"; } else { _out << nl << "v = null;"; } } - writeMarshalUnmarshalCode(_out, value, package, "v", false); + writeMarshalUnmarshalCode(_out, value, ns, "v", false); _out << nl << "r[k] = v;"; } _out << eb; @@ -5017,7 +5085,7 @@ Slice::Gen::DispatcherVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; return true; @@ -5026,8 +5094,8 @@ Slice::Gen::DispatcherVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::DispatcherVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -5041,11 +5109,11 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList bases = p->bases(); bool hasBaseClass = !bases.empty() && !bases.front()->isInterface(); string name = p->name(); - string package = getPackage(p); - string baseClass = getUnqualified("Ice.ObjectImpl", package); + string ns = getNamespace(p); + string baseClass = getUnqualified("Ice.ObjectImpl", ns); if(hasBaseClass && !bases.front()->allOperations().empty()) { - baseClass = getUnqualified(bases.front(), package, "", "Disp_"); + baseClass = getUnqualified(bases.front(), ns, "", "Disp_"); } _out << sp; @@ -5072,7 +5140,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) for(ClassList::const_iterator i = allBases.begin(); i != allBases.end(); ++i) { - _out << ", " << getUnqualified(*i, package); + _out << ", " << getUnqualified(*i, ns); } } @@ -5088,7 +5156,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) { string retS; vector<string> params, args; - string name = getDispatchParams(*i, retS, params, args, package); + string name = getDispatchParams(*i, retS, params, args, ns); _out << sp << nl << "public abstract " << retS << " " << name << spar << params << epar << ';'; } @@ -5112,7 +5180,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp; emitComVisibleAttribute(); emitGeneratedCodeAttribute(); - _out << nl << "public class " << name << "Tie_ : " << name << "Disp_, " << getUnqualified("Ice.TieBase", package); + _out << nl << "public class " << name << "Tie_ : " << name << "Disp_, " << getUnqualified("Ice.TieBase", ns); _out << sb; @@ -5173,14 +5241,14 @@ Slice::Gen::DispatcherVisitor::visitClassDefEnd(const ClassDefPtr&) void Slice::Gen::DispatcherVisitor::writeTieOperations(const ClassDefPtr& p, NameSet* opNames) { - string package = getPackage(p); + string ns = getNamespace(p); OperationList ops = p->operations(); for(OperationList::const_iterator r = ops.begin(); r != ops.end(); ++r) { string retS; vector<string> params; vector<string> args; - string opName = getDispatchParams(*r, retS, params, args, package); + string opName = getDispatchParams(*r, retS, params, args, ns); if(opNames) { if(opNames->find(opName) != opNames->end()) @@ -5229,7 +5297,7 @@ void Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment, bool forTie) { ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container()); - string package = getPackage(cl); + string ns = getNamespace(cl); string opName = op->name(); TypePtr ret = op->returnType(); ParamDeclList params = op->parameters(); @@ -5259,8 +5327,8 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment if(!cl->isLocal() && (cl->hasMetaData("amd") || op->hasMetaData("amd"))) { ParamDeclList::const_iterator i; - vector<string> pDecl = getInParams(op, package); - string resultType = CsGenerator::resultType(op, package, true); + vector<string> pDecl = getInParams(op, ns); + string resultType = CsGenerator::resultType(op, ns, true); _out << "public "; if(!forTie) @@ -5273,7 +5341,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { _out << "<" << resultType << ">"; } - _out << " " << opName << "Async" << spar << pDecl << getUnqualified("Ice.Current", package) + " current = null" + _out << " " << opName << "Async" << spar << pDecl << getUnqualified("Ice.Current", ns) + " current = null" << epar; if(comment) @@ -5285,7 +5353,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << sb; if(ret) { - _out << nl << typeToString(ret, package) << " ret = " << writeValue(ret, package) << ';'; + _out << nl << typeToString(ret, ns) << " ret = " << writeValue(ret, ns) << ';'; } for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i) { @@ -5293,7 +5361,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { string name = fixId((*i)->name()); TypePtr type = (*i)->type(); - _out << nl << typeToString(type, package) << ' ' << name << " = " << writeValue(type, package) << ';'; + _out << nl << typeToString(type, ns) << ' ' << name << " = " << writeValue(type, ns) << ';'; } } _out << nl << "return global::System.Threading.Tasks.Task.FromResult"; @@ -5343,9 +5411,9 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { string retS = op->hasMarshaledResult() ? fixId(cl->scope() + resultStructName(cl->name(), op->name(), true)) : - typeToString(ret, package); + typeToString(ret, ns); - vector<string> pDecls = op->hasMarshaledResult() ? getInParams(op, package) : getParams(op, package); + vector<string> pDecls = op->hasMarshaledResult() ? getInParams(op, ns) : getParams(op, ns); _out << "public "; if(!forTie && !cl->isLocal()) @@ -5355,7 +5423,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << retS << ' ' << fixId(opName, DotNet::ICloneable, true) << spar << pDecls; if(!cl->isLocal()) { - _out << getUnqualified("Ice.Current", package) + " current = null"; + _out << getUnqualified("Ice.Current", ns) + " current = null"; } _out << epar; if(comment) @@ -5370,7 +5438,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment << "("; if(ret) { - _out << writeValue(ret, package); + _out << writeValue(ret, ns); } for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { @@ -5378,7 +5446,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { _out << ", "; } - _out << writeValue((*i)->type(), package); + _out << writeValue((*i)->type(), ns); } _out << ", current);"; } @@ -5388,12 +5456,12 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { string name = fixId((*i)->name()); TypePtr type = (*i)->type(); - _out << nl << name << " = " << writeValue(type, package) << ';'; + _out << nl << name << " = " << writeValue(type, ns) << ';'; } if(ret) { - _out << nl << "return " << writeValue(ret, package) << ';'; + _out << nl << "return " << writeValue(ret, ns) << ';'; } } _out << eb; @@ -5413,7 +5481,7 @@ Slice::Gen::ImplVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; @@ -5423,8 +5491,8 @@ Slice::Gen::ImplVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool @@ -5483,7 +5551,7 @@ Slice::Gen::ImplTieVisitor::visitModuleStart(const ModulePtr& p) return false; } - CsVisitor::visitModuleStart(p); + moduleStart(p); _out << sp << nl << "namespace " << fixId(p->name()); _out << sb; @@ -5493,8 +5561,8 @@ Slice::Gen::ImplTieVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ImplTieVisitor::visitModuleEnd(const ModulePtr& p) { - CsVisitor::visitModuleEnd(p); _out << eb; + moduleEnd(p); } bool diff --git a/cpp/src/slice2cs/Gen.h b/cpp/src/slice2cs/Gen.h index 02f70c20549..2b8c168d1a6 100644 --- a/cpp/src/slice2cs/Gen.h +++ b/cpp/src/slice2cs/Gen.h @@ -74,8 +74,8 @@ protected: void writeDocCommentAMD(const OperationPtr&, const std::string&); void writeDocCommentParam(const OperationPtr&, ParamDir, bool); - virtual bool visitModuleStart(const ModulePtr&); - virtual void visitModuleEnd(const ModulePtr&); + void moduleStart(const ModulePtr&); + void moduleEnd(const ModulePtr&); ::IceUtilInternal::Output& _out; }; @@ -121,12 +121,23 @@ private: public: CompactIdVisitor(IceUtilInternal::Output&); - virtual bool visitUnitStart(const UnitPtr&); virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class TypeIdVisitor : public CsVisitor + { + public: + + TypeIdVisitor(IceUtilInternal::Output&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + + private: + void generateHelperClass(const ContainedPtr&); }; class TypesVisitor : public CsVisitor diff --git a/csharp/msbuild/ice.net45.test.sln b/csharp/msbuild/ice.net45.test.sln index e1389d8fb82..9744ae92ac2 100644 --- a/csharp/msbuild/ice.net45.test.sln +++ b/csharp/msbuild/ice.net45.test.sln @@ -405,11 +405,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "..\test\Ice\scope EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server", "..\test\Ice\scope\msbuild\server\net45\server.csproj", "{81A5EA86-74C3-45BD-B04E-FB21983302F2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packagemd", "packagemd", "{1B87FBB5-12E7-41D8-9135-9D00544508C8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "namespacemd", "namespacemd", "{1B87FBB5-12E7-41D8-9135-9D00544508C8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "..\test\Ice\packagemd\msbuild\client\net45\client.csproj", "{2BB1FE54-54EF-4974-9F5D-ABFEC740AE29}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "..\test\Ice\namespacemd\msbuild\client\net45\client.csproj", "{2BB1FE54-54EF-4974-9F5D-ABFEC740AE29}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server", "..\test\Ice\packagemd\msbuild\server\net45\server.csproj", "{D8F04A5C-9692-4A62-93BD-81483EBEA8F5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server", "..\test\Ice\namespacemd\msbuild\server\net45\server.csproj", "{D8F04A5C-9692-4A62-93BD-81483EBEA8F5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/csharp/msbuild/ice.netstandard2.0.test.sln b/csharp/msbuild/ice.netstandard2.0.test.sln index 7465c5b6d4d..c85b0351a5f 100644 --- a/csharp/msbuild/ice.netstandard2.0.test.sln +++ b/csharp/msbuild/ice.netstandard2.0.test.sln @@ -764,11 +764,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "client", "..\test\Ice\scope EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "server", "..\test\Ice\scope\msbuild\server\netstandard2.0\server.csproj", "{F67DF0EA-3830-4D17-B60B-0F6BAD76AEAA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packagemd", "packagemd", "{2988E030-1F8E-490B-B8A3-D1F02073500A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "namespacemd", "namespacemd", "{2988E030-1F8E-490B-B8A3-D1F02073500A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "client", "..\test\Ice\packagemd\msbuild\client\netstandard2.0\client.csproj", "{C56E9BC5-37E6-4001-A45C-D11E64C7385E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "client", "..\test\Ice\namespacemd\msbuild\client\netstandard2.0\client.csproj", "{C56E9BC5-37E6-4001-A45C-D11E64C7385E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "server", "..\test\Ice\packagemd\msbuild\server\netstandard2.0\server.csproj", "{33983EDC-CF67-4697-81D4-AA5337733FE0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "server", "..\test\Ice\namespacemd\msbuild\server\netstandard2.0\server.csproj", "{33983EDC-CF67-4697-81D4-AA5337733FE0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/csharp/msbuild/ice.xamarin.test.sln b/csharp/msbuild/ice.xamarin.test.sln index 337eb7d207d..4dcefe3f208 100644 --- a/csharp/msbuild/ice.xamarin.test.sln +++ b/csharp/msbuild/ice.xamarin.test.sln @@ -97,9 +97,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "optional", "optional", "{15 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "test", "..\test\Ice\optional\msbuild\test\netstandard2.0\test.csproj", "{FA714D0F-528A-49F5-A2A8-51AAD5CD4D79}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packagemd", "packagemd", "{76132143-9859-4F3C-9AB5-24E9905CAB77}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "namespacemd", "namespacemd", "{76132143-9859-4F3C-9AB5-24E9905CAB77}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "test", "..\test\Ice\packagemd\msbuild\test\netstandard2.0\test.csproj", "{3E6D14B4-FB21-45EF-9B04-1AEC4F9DD72F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "test", "..\test\Ice\namespacemd\msbuild\test\netstandard2.0\test.csproj", "{3E6D14B4-FB21-45EF-9B04-1AEC4F9DD72F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proxy", "proxy", "{1E33ACEE-1485-4452-B0FD-319E69AE0ACA}" EndProject diff --git a/csharp/src/Ice/Instance.cs b/csharp/src/Ice/Instance.cs index 136d5208889..f191a61415f 100644 --- a/csharp/src/Ice/Instance.cs +++ b/csharp/src/Ice/Instance.cs @@ -670,42 +670,41 @@ namespace IceInternal _initData.threadStop = threadStop; } + // + // Return the C# class associated with this Slice type-id + // Used for both non-local Slice classes and exceptions + // public Type resolveClass(string id) { + // First attempt corresponds to no cs:namespace metadata in the + // enclosing top-level module + // string className = typeToClass(id); - Type c = AssemblyUtil.findType(this, className); // - // See if the application defined an Ice.Package.MODULE property. + // If this fails, look for helper classes in the typeIdNamespaces namespace(s) // - if(c == null) + if(c == null && _initData.typeIdNamespaces != null) { - int pos = id.IndexOf(':', 2); - if(pos != -1) + foreach(var ns in _initData.typeIdNamespaces) { - String topLevelModule = id.Substring(2, pos - 2); - String pkg = _initData.properties.getProperty("Ice.Package." + topLevelModule); - if(pkg.Length > 0) + Type helper = AssemblyUtil.findType(this, ns + "." + className); + if(helper != null) { - c = AssemblyUtil.findType(this, pkg + "." + className); + try + { + c = helper.GetProperty("targetClass").PropertyType; + break; // foreach + } + catch(Exception) + { + } } } } // - // See if the application defined a default package. - // - if(c == null) - { - String pkg = _initData.properties.getProperty("Ice.Default.Package"); - if(pkg.Length > 0) - { - c = AssemblyUtil.findType(this, pkg + "." + className); - } - } - - // // Ensure the class is instantiable. // if(c != null && !c.IsAbstract && !c.IsInterface) @@ -718,19 +717,33 @@ namespace IceInternal public string resolveCompactId(int compactId) { - String className = "IceCompactId.TypeId_" + compactId; - try + string[] defaultVal = {"IceCompactId"}; + var compactIdNamespaces = new List<string>(defaultVal); + + if(_initData.typeIdNamespaces != null) { - Type c = AssemblyUtil.findType(this, className); - if(c != null) - { - return (string)c.GetField("typeId").GetValue(null); - } + compactIdNamespaces.AddRange(_initData.typeIdNamespaces); } - catch(Exception) + + string result = ""; + + foreach(var ns in compactIdNamespaces) { + string className = ns + ".TypeId_" + compactId; + try + { + Type c = AssemblyUtil.findType(this, className); + if(c != null) + { + result = (string)c.GetField("typeId").GetValue(null); + break; // foreach + } + } + catch(Exception) + { + } } - return ""; + return result; } private static string typeToClass(string id) diff --git a/csharp/src/Ice/Util.cs b/csharp/src/Ice/Util.cs index 32f8340a424..2833832e580 100644 --- a/csharp/src/Ice/Util.cs +++ b/csharp/src/Ice/Util.cs @@ -106,6 +106,11 @@ namespace Ice /// The value factory manager. /// </summary> public ValueFactoryManager valueFactoryManager; + + /// <summary> + /// The list of TypeId namespaces. Default is Ice.TypeId. + /// </summary> + public string[] typeIdNamespaces = { "Ice.TypeId" }; } /// <summary> diff --git a/csharp/test/Ice/acm/Client.cs b/csharp/test/Ice/acm/Client.cs index 14776a3a372..f0103fb79bf 100644 --- a/csharp/test/Ice/acm/Client.cs +++ b/csharp/test/Ice/acm/Client.cs @@ -18,7 +18,6 @@ namespace Ice override public void run(string[] args) { var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.acm"); properties.setProperty("Ice.Warn.Connections", "0"); using(var communicator = initialize(properties)) { diff --git a/csharp/test/Ice/acm/Server.cs b/csharp/test/Ice/acm/Server.cs index e66f1d70143..3ac6dcd514a 100644 --- a/csharp/test/Ice/acm/Server.cs +++ b/csharp/test/Ice/acm/Server.cs @@ -20,7 +20,6 @@ namespace Ice var properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.ACM.Timeout", "1"); - properties.setProperty("Ice.Package.Test", "Ice.acm"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/acm/Test.ice b/csharp/test/Ice/acm/Test.ice index 1f87b261e4f..ce87ab906f8 100644 --- a/csharp/test/Ice/acm/Test.ice +++ b/csharp/test/Ice/acm/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.acm"]] +["cs:namespace:Ice.acm"] module Test { diff --git a/csharp/test/Ice/adapterDeactivation/Client.cs b/csharp/test/Ice/adapterDeactivation/Client.cs index 5490d4a8f55..bdfb5be0ed7 100644 --- a/csharp/test/Ice/adapterDeactivation/Client.cs +++ b/csharp/test/Ice/adapterDeactivation/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.adapterDeactivation"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/adapterDeactivation/Collocated.cs b/csharp/test/Ice/adapterDeactivation/Collocated.cs index 3483c5b4187..3dd00450169 100644 --- a/csharp/test/Ice/adapterDeactivation/Collocated.cs +++ b/csharp/test/Ice/adapterDeactivation/Collocated.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.adapterDeactivation"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/adapterDeactivation/Server.cs b/csharp/test/Ice/adapterDeactivation/Server.cs index b5d336d569d..c466d1451df 100644 --- a/csharp/test/Ice/adapterDeactivation/Server.cs +++ b/csharp/test/Ice/adapterDeactivation/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.adapterDeactivation"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/adapterDeactivation/Test.ice b/csharp/test/Ice/adapterDeactivation/Test.ice index 538d3973ac3..3714101ee5c 100644 --- a/csharp/test/Ice/adapterDeactivation/Test.ice +++ b/csharp/test/Ice/adapterDeactivation/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.adapterDeactivation"]] +["cs:namespace:Ice.adapterDeactivation"] module Test { diff --git a/csharp/test/Ice/admin/Client.cs b/csharp/test/Ice/admin/Client.cs index 6bc31610895..e39a4774f4a 100644 --- a/csharp/test/Ice/admin/Client.cs +++ b/csharp/test/Ice/admin/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.admin"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/admin/Server.cs b/csharp/test/Ice/admin/Server.cs index a56e84507c6..c779ec971f1 100644 --- a/csharp/test/Ice/admin/Server.cs +++ b/csharp/test/Ice/admin/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.admin"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + " -t 10000"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/admin/Test.ice b/csharp/test/Ice/admin/Test.ice index 99e0120a395..a71dffc038a 100644 --- a/csharp/test/Ice/admin/Test.ice +++ b/csharp/test/Ice/admin/Test.ice @@ -12,7 +12,7 @@ #include <Ice/Properties.ice> -[["cs:namespace:Ice.admin"]] +["cs:namespace:Ice.admin"] module Test { diff --git a/csharp/test/Ice/ami/Client.cs b/csharp/test/Ice/ami/Client.cs index d77f2ad6cb5..e588d4e68d2 100644 --- a/csharp/test/Ice/ami/Client.cs +++ b/csharp/test/Ice/ami/Client.cs @@ -21,8 +21,6 @@ namespace Ice properties.setProperty("Ice.Warn.AMICallback", "0"); properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Package.Test", "Ice.ami"); - // // We use a client thread pool with more than one thread to test // that task inlining works. diff --git a/csharp/test/Ice/ami/Collocated.cs b/csharp/test/Ice/ami/Collocated.cs index dee6131c808..553926887a4 100644 --- a/csharp/test/Ice/ami/Collocated.cs +++ b/csharp/test/Ice/ami/Collocated.cs @@ -30,7 +30,6 @@ namespace Ice // that task inlining works. // properties.setProperty("Ice.ThreadPool.Client.Size", "5"); - properties.setProperty("Ice.Package.Test", "Ice.ami"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/ami/Server.cs b/csharp/test/Ice/ami/Server.cs index ff97f24ca3e..8707d1385b7 100644 --- a/csharp/test/Ice/ami/Server.cs +++ b/csharp/test/Ice/ami/Server.cs @@ -34,7 +34,6 @@ namespace Ice // send() blocking after sending a given amount of data. // properties.setProperty("Ice.TCP.RcvSize", "50000"); - properties.setProperty("Ice.Package.Test", "Ice.ami"); using(var communicator = initialize(properties)) { diff --git a/csharp/test/Ice/ami/Test.ice b/csharp/test/Ice/ami/Test.ice index 814015ecb22..3c36f84e5cc 100644 --- a/csharp/test/Ice/ami/Test.ice +++ b/csharp/test/Ice/ami/Test.ice @@ -12,7 +12,7 @@ #include <Ice/BuiltinSequences.ice> #include <Ice/Identity.ice> -[["cs:namespace:Ice.ami"]] +["cs:namespace:Ice.ami"] module Test { diff --git a/csharp/test/Ice/binding/Client.cs b/csharp/test/Ice/binding/Client.cs index 21544124074..3e1bcb8c5fb 100644 --- a/csharp/test/Ice/binding/Client.cs +++ b/csharp/test/Ice/binding/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.binding"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/binding/Server.cs b/csharp/test/Ice/binding/Server.cs index 940c7c81a8f..4046031b934 100644 --- a/csharp/test/Ice/binding/Server.cs +++ b/csharp/test/Ice/binding/Server.cs @@ -19,7 +19,6 @@ namespace Ice { Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.ServerIdleTime", "30"); - properties.setProperty("Ice.Package.Test", "Ice.binding"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/binding/Test.ice b/csharp/test/Ice/binding/Test.ice index a9843836d95..94b88fee36c 100644 --- a/csharp/test/Ice/binding/Test.ice +++ b/csharp/test/Ice/binding/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.binding"]] +["cs:namespace:Ice.binding"] module Test { diff --git a/csharp/test/Ice/checksum/Client.cs b/csharp/test/Ice/checksum/Client.cs index 2dce5e4bf07..3f002778309 100644 --- a/csharp/test/Ice/checksum/Client.cs +++ b/csharp/test/Ice/checksum/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.checksum"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var checksum = AllTests.allTests(this, false); checksum.shutdown(); diff --git a/csharp/test/Ice/checksum/Server.cs b/csharp/test/Ice/checksum/Server.cs index d9c08e7b1a2..525b8b12552 100644 --- a/csharp/test/Ice/checksum/Server.cs +++ b/csharp/test/Ice/checksum/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.checksum"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + " -t 2000"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/checksum/Test.ice b/csharp/test/Ice/checksum/Test.ice index 1f910936dc0..642bf769a13 100644 --- a/csharp/test/Ice/checksum/Test.ice +++ b/csharp/test/Ice/checksum/Test.ice @@ -11,7 +11,7 @@ #include <Ice/SliceChecksumDict.ice> -[["cs:namespace:Ice.checksum"]] +["cs:namespace:Ice.checksum"] module Test { diff --git a/csharp/test/Ice/defaultServant/Client.cs b/csharp/test/Ice/defaultServant/Client.cs index 980df00cc5c..53cf576a3fe 100644 --- a/csharp/test/Ice/defaultServant/Client.cs +++ b/csharp/test/Ice/defaultServant/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.defaultServant"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/defaultServant/Test.ice b/csharp/test/Ice/defaultServant/Test.ice index a941e0872d9..092e3c36246 100644 --- a/csharp/test/Ice/defaultServant/Test.ice +++ b/csharp/test/Ice/defaultServant/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.defaultServant"]] +["cs:namespace:Ice.defaultServant"] module Test { diff --git a/csharp/test/Ice/defaultValue/Test.ice b/csharp/test/Ice/defaultValue/Test.ice index 4ccbdfa0eeb..69e48d8af62 100644 --- a/csharp/test/Ice/defaultValue/Test.ice +++ b/csharp/test/Ice/defaultValue/Test.ice @@ -12,8 +12,8 @@ // // Suppress warnings // -[["suppress-warning:invalid-metadata, deprecated"]] -[["cs:namespace:Ice.defaultValue"]] +[["suppress-warning:invalid-metadata, deprecated", "cs:typeid-namespace:Ice.defaultValue.TypeId"]] +["cs:namespace:Ice.defaultValue"] module Test { diff --git a/csharp/test/Ice/dictMapping/Client.cs b/csharp/test/Ice/dictMapping/Client.cs index a5a2a1186a8..cd73921a928 100644 --- a/csharp/test/Ice/dictMapping/Client.cs +++ b/csharp/test/Ice/dictMapping/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.dictMapping"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var output = getWriter(); var myClass = AllTests.allTests(this, false); diff --git a/csharp/test/Ice/dictMapping/Collocated.cs b/csharp/test/Ice/dictMapping/Collocated.cs index 74071c5087c..a4e687b5954 100644 --- a/csharp/test/Ice/dictMapping/Collocated.cs +++ b/csharp/test/Ice/dictMapping/Collocated.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.dictMapping"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/dictMapping/Server.cs b/csharp/test/Ice/dictMapping/Server.cs index 36b7276c344..d599867dc2c 100644 --- a/csharp/test/Ice/dictMapping/Server.cs +++ b/csharp/test/Ice/dictMapping/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.dictMapping"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/dictMapping/ServerAMD.cs b/csharp/test/Ice/dictMapping/ServerAMD.cs index 6a1a8381e01..69e641caf66 100644 --- a/csharp/test/Ice/dictMapping/ServerAMD.cs +++ b/csharp/test/Ice/dictMapping/ServerAMD.cs @@ -19,9 +19,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.dictMapping.AMD"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/dictMapping/Test.ice b/csharp/test/Ice/dictMapping/Test.ice index 28458d1dd0f..142269273fd 100644 --- a/csharp/test/Ice/dictMapping/Test.ice +++ b/csharp/test/Ice/dictMapping/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.dictMapping"]] +["cs:namespace:Ice.dictMapping"] module Test { diff --git a/csharp/test/Ice/dictMapping/TestAMD.ice b/csharp/test/Ice/dictMapping/TestAMD.ice index c84d040dfb0..5e9644b02d4 100644 --- a/csharp/test/Ice/dictMapping/TestAMD.ice +++ b/csharp/test/Ice/dictMapping/TestAMD.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.dictMapping.AMD"]] +["cs:namespace:Ice.dictMapping.AMD"] module Test { diff --git a/csharp/test/Ice/enums/Client.cs b/csharp/test/Ice/enums/Client.cs index 238ffd41aed..b5116c866fc 100644 --- a/csharp/test/Ice/enums/Client.cs +++ b/csharp/test/Ice/enums/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.enums"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var proxy = AllTests.allTests(this); proxy.shutdown(); diff --git a/csharp/test/Ice/enums/Server.cs b/csharp/test/Ice/enums/Server.cs index 1b847db5611..eacb87d108e 100644 --- a/csharp/test/Ice/enums/Server.cs +++ b/csharp/test/Ice/enums/Server.cs @@ -19,7 +19,6 @@ namespace Ice { Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.ServerIdleTime", "30"); - properties.setProperty("Ice.Package.Test", "Ice.enums"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/enums/Test.ice b/csharp/test/Ice/enums/Test.ice index 0155e84bc4a..a343a030ac6 100644 --- a/csharp/test/Ice/enums/Test.ice +++ b/csharp/test/Ice/enums/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.enums"]] +["cs:namespace:Ice.enums"] module Test { diff --git a/csharp/test/Ice/exceptions/Client.cs b/csharp/test/Ice/exceptions/Client.cs index f08c2816bee..30d217346eb 100644 --- a/csharp/test/Ice/exceptions/Client.cs +++ b/csharp/test/Ice/exceptions/Client.cs @@ -17,11 +17,12 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max - properties.setProperty("Ice.Package.Test", "Ice.exceptions"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.exceptions.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.Warn.Connections", "0"); + initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var thrower = AllTests.allTests(this); diff --git a/csharp/test/Ice/exceptions/Collocated.cs b/csharp/test/Ice/exceptions/Collocated.cs index 1ad522e9b81..7c3a97684c6 100644 --- a/csharp/test/Ice/exceptions/Collocated.cs +++ b/csharp/test/Ice/exceptions/Collocated.cs @@ -17,12 +17,13 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max - properties.setProperty("Ice.Package.Test", "Ice.exceptions"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.exceptions.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.Warn.Connections", "0"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); + initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/exceptions/Server.cs b/csharp/test/Ice/exceptions/Server.cs index 53293f3fae9..b0c4be2d57f 100644 --- a/csharp/test/Ice/exceptions/Server.cs +++ b/csharp/test/Ice/exceptions/Server.cs @@ -46,11 +46,10 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); + var properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max - properties.setProperty("Ice.Package.Test", "Ice.exceptions"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/exceptions/ServerAMD.cs b/csharp/test/Ice/exceptions/ServerAMD.cs index 9266289fc4a..27d539da922 100644 --- a/csharp/test/Ice/exceptions/ServerAMD.cs +++ b/csharp/test/Ice/exceptions/ServerAMD.cs @@ -52,7 +52,6 @@ namespace Ice properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max - properties.setProperty("Ice.Package.Test", "Ice.exceptions.AMD"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/exceptions/Test.ice b/csharp/test/Ice/exceptions/Test.ice index b154e6293a0..b8f3f1011b6 100644 --- a/csharp/test/Ice/exceptions/Test.ice +++ b/csharp/test/Ice/exceptions/Test.ice @@ -11,7 +11,9 @@ #include <Ice/BuiltinSequences.ice> -[["cs:namespace:Ice.exceptions"]] +[["cs:typeid-namespace:Ice.exceptions.TypeId"]] + +["cs:namespace:Ice.exceptions"] module Test { diff --git a/csharp/test/Ice/exceptions/TestAMD.ice b/csharp/test/Ice/exceptions/TestAMD.ice index b5252ea12ce..b5dafe31e65 100644 --- a/csharp/test/Ice/exceptions/TestAMD.ice +++ b/csharp/test/Ice/exceptions/TestAMD.ice @@ -11,7 +11,9 @@ #include <Ice/BuiltinSequences.ice> -[["cs:namespace:Ice.exceptions.AMD"]] +[["cs:typeid-namespace:Ice.exceptions.AMD.TypeId"]] + +["cs:namespace:Ice.exceptions.AMD"] module Test { diff --git a/csharp/test/Ice/facets/Client.cs b/csharp/test/Ice/facets/Client.cs index aa66471522f..227af0be7ba 100644 --- a/csharp/test/Ice/facets/Client.cs +++ b/csharp/test/Ice/facets/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.facets"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var g = AllTests.allTests(this); g.shutdown(); diff --git a/csharp/test/Ice/facets/Collocated.cs b/csharp/test/Ice/facets/Collocated.cs index a0606b1a1f5..c4357d2417f 100644 --- a/csharp/test/Ice/facets/Collocated.cs +++ b/csharp/test/Ice/facets/Collocated.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.facets"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/facets/Server.cs b/csharp/test/Ice/facets/Server.cs index 5f87c388689..e42b3567c73 100644 --- a/csharp/test/Ice/facets/Server.cs +++ b/csharp/test/Ice/facets/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.facets"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/facets/Test.ice b/csharp/test/Ice/facets/Test.ice index 8453829883e..014fe58de40 100644 --- a/csharp/test/Ice/facets/Test.ice +++ b/csharp/test/Ice/facets/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.facets"]] +["cs:namespace:Ice.facets"] module Test { diff --git a/csharp/test/Ice/hold/Client.cs b/csharp/test/Ice/hold/Client.cs index 0fc4ab436c7..d9032f9b1a7 100644 --- a/csharp/test/Ice/hold/Client.cs +++ b/csharp/test/Ice/hold/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.hold"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/hold/Server.cs b/csharp/test/Ice/hold/Server.cs index f21ce59b9d7..5504dff6322 100644 --- a/csharp/test/Ice/hold/Server.cs +++ b/csharp/test/Ice/hold/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.hold"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { Timer timer = new Timer(); diff --git a/csharp/test/Ice/hold/Test.ice b/csharp/test/Ice/hold/Test.ice index 4a001bda241..12a86d9ff0e 100644 --- a/csharp/test/Ice/hold/Test.ice +++ b/csharp/test/Ice/hold/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.hold"]] +["cs:namespace:Ice.hold"] module Test { diff --git a/csharp/test/Ice/info/Client.cs b/csharp/test/Ice/info/Client.cs index 7a42e67febe..1a342e90988 100644 --- a/csharp/test/Ice/info/Client.cs +++ b/csharp/test/Ice/info/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.info"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/info/Server.cs b/csharp/test/Ice/info/Server.cs index 042d2f8e83a..12d7cfebf4f 100644 --- a/csharp/test/Ice/info/Server.cs +++ b/csharp/test/Ice/info/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.info"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + ":" + getTestEndpoint(0, "udp")); diff --git a/csharp/test/Ice/info/Test.ice b/csharp/test/Ice/info/Test.ice index b7e9d36608e..c1c8cebb81b 100644 --- a/csharp/test/Ice/info/Test.ice +++ b/csharp/test/Ice/info/Test.ice @@ -11,7 +11,7 @@ #include <Ice/Current.ice> -[["cs:namespace:Ice.info"]] +["cs:namespace:Ice.info"] module Test { diff --git a/csharp/test/Ice/inheritance/Client.cs b/csharp/test/Ice/inheritance/Client.cs index e130771d7b9..1e4ff663149 100644 --- a/csharp/test/Ice/inheritance/Client.cs +++ b/csharp/test/Ice/inheritance/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.inheritance"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var initial = AllTests.allTests(this); initial.shutdown(); diff --git a/csharp/test/Ice/inheritance/Collocated.cs b/csharp/test/Ice/inheritance/Collocated.cs index 86501fdac63..4136f3737e4 100644 --- a/csharp/test/Ice/inheritance/Collocated.cs +++ b/csharp/test/Ice/inheritance/Collocated.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.inheritance"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/inheritance/Server.cs b/csharp/test/Ice/inheritance/Server.cs index b421f26b0e9..9e48cdb7277 100644 --- a/csharp/test/Ice/inheritance/Server.cs +++ b/csharp/test/Ice/inheritance/Server.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.inheritance"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/inheritance/Test.ice b/csharp/test/Ice/inheritance/Test.ice index db7c6947f8c..f11c0867bf3 100644 --- a/csharp/test/Ice/inheritance/Test.ice +++ b/csharp/test/Ice/inheritance/Test.ice @@ -10,7 +10,7 @@ #pragma once [["suppress-warning:deprecated"]] // For classes with operations -[["cs:namespace:Ice.inheritance"]] +["cs:namespace:Ice.inheritance"] module Test { diff --git a/csharp/test/Ice/interceptor/Client.cs b/csharp/test/Ice/interceptor/Client.cs index 12bad466b72..09537470f63 100644 --- a/csharp/test/Ice/interceptor/Client.cs +++ b/csharp/test/Ice/interceptor/Client.cs @@ -172,9 +172,7 @@ namespace Ice public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.interceptor"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { // // Create OA and servants diff --git a/csharp/test/Ice/interceptor/Test.ice b/csharp/test/Ice/interceptor/Test.ice index efe54f1db49..0ef16a0fc5b 100644 --- a/csharp/test/Ice/interceptor/Test.ice +++ b/csharp/test/Ice/interceptor/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.interceptor"]] +["cs:namespace:Ice.interceptor"] module Test { diff --git a/csharp/test/Ice/invoke/Client.cs b/csharp/test/Ice/invoke/Client.cs index d62374833e9..5ce2aa75669 100644 --- a/csharp/test/Ice/invoke/Client.cs +++ b/csharp/test/Ice/invoke/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.invoke"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var myClass = AllTests.allTests(this); myClass.shutdown(); diff --git a/csharp/test/Ice/invoke/Server.cs b/csharp/test/Ice/invoke/Server.cs index df4ce64f989..46ee9dd13a4 100644 --- a/csharp/test/Ice/invoke/Server.cs +++ b/csharp/test/Ice/invoke/Server.cs @@ -53,9 +53,7 @@ namespace Ice public override void run(string[] args) { bool async = args.Any(v => v.Equals("--async")); - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.invoke"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/invoke/Test.ice b/csharp/test/Ice/invoke/Test.ice index 94338fa15e1..dd9c534c8e9 100644 --- a/csharp/test/Ice/invoke/Test.ice +++ b/csharp/test/Ice/invoke/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.invoke"]] +["cs:namespace:Ice.invoke"] module Test { diff --git a/csharp/test/Ice/location/Client.cs b/csharp/test/Ice/location/Client.cs index e379ffe932f..64670cbcb77 100644 --- a/csharp/test/Ice/location/Client.cs +++ b/csharp/test/Ice/location/Client.cs @@ -19,7 +19,6 @@ namespace Ice { Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.Default.Locator", "locator:" + getTestEndpoint(properties, 0)); - properties.setProperty("Ice.Package.Test", "Ice.location"); using(var communicator = initialize(properties)) { AllTests.allTests(this); diff --git a/csharp/test/Ice/location/Server.cs b/csharp/test/Ice/location/Server.cs index dc8540ec509..da40500bccd 100644 --- a/csharp/test/Ice/location/Server.cs +++ b/csharp/test/Ice/location/Server.cs @@ -24,7 +24,6 @@ namespace Ice // Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.ThreadPool.Server.Size", "2"); - properties.setProperty("Ice.Package.Test", "Ice.location"); using(var communicator = initialize(properties)) { diff --git a/csharp/test/Ice/location/Test.ice b/csharp/test/Ice/location/Test.ice index 75e04e83dc0..3fa46fe1106 100644 --- a/csharp/test/Ice/location/Test.ice +++ b/csharp/test/Ice/location/Test.ice @@ -11,7 +11,7 @@ #include <Ice/Locator.ice> -[["cs:namespace:Ice.location"]] +["cs:namespace:Ice.location"] module Test { diff --git a/csharp/test/Ice/packagemd/.gitignore b/csharp/test/Ice/namespacemd/.gitignore index 67872faa673..67872faa673 100644 --- a/csharp/test/Ice/packagemd/.gitignore +++ b/csharp/test/Ice/namespacemd/.gitignore diff --git a/csharp/test/Ice/namespacemd/AllTests.cs b/csharp/test/Ice/namespacemd/AllTests.cs new file mode 100644 index 00000000000..b1c31202fab --- /dev/null +++ b/csharp/test/Ice/namespacemd/AllTests.cs @@ -0,0 +1,108 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +using Test; + +namespace Ice +{ + namespace namespacemd + { + public class AllTests : global::Test.AllTests + { + public static Test.InitialPrx allTests(TestHelper helper) + { + var communicator = helper.communicator(); + var output = helper.getWriter(); + output.Write("testing stringToProxy... "); + output.Flush(); + var @base = communicator.stringToProxy("initial:" + helper.getTestEndpoint(0)); + test(@base != null); + output.WriteLine("ok"); + + output.Write("testing checked cast... "); + output.Flush(); + var initial = Test.InitialPrxHelper.checkedCast(@base); + test(initial != null); + test(initial.Equals(@base)); + output.WriteLine("ok"); + + { + output.Write("testing types without package... "); + output.Flush(); + NoNamespace.C1 c1 = initial.getNoNamespaceC2AsC1(); + test(c1 != null); + test(c1 is NoNamespace.C2); + NoNamespace.C2 c2 = initial.getNoNamespaceC2AsC2(); + test(c2 != null); + try + { + initial.throwNoNamespaceE2AsE1(); + test(false); + } + catch(NoNamespace.E1 ex) + { + test(ex is NoNamespace.E2); + } + try + { + initial.throwNoNamespaceE2AsE2(); + test(false); + } + catch(NoNamespace.E2) + { + // Expected + } + try + { + initial.throwNoNamespaceNotify(); + test(false); + } + catch(NoNamespace.@notify) + { + // Expected + } + output.WriteLine("ok"); + } + + { + output.Write("testing types with package... "); + output.Flush(); + + { + WithNamespace.C1 c1 = initial.getWithNamespaceC2AsC1(); + test(c1 != null); + test(c1 is WithNamespace.C2); + WithNamespace.C2 c2 = initial.getWithNamespaceC2AsC2(); + test(c2 != null); + try + { + initial.throwWithNamespaceE2AsE1(); + test(false); + } + catch(WithNamespace.E1 ex) + { + test(ex is WithNamespace.E2); + } + try + { + initial.throwWithNamespaceE2AsE2(); + test(false); + } + catch(WithNamespace.E2) + { + // Expected + } + output.WriteLine("ok"); + } + } + return initial; + } + } + } +} diff --git a/csharp/test/Ice/packagemd/Client.cs b/csharp/test/Ice/namespacemd/Client.cs index 1d7267e3b8d..397a2e261ec 100644 --- a/csharp/test/Ice/packagemd/Client.cs +++ b/csharp/test/Ice/namespacemd/Client.cs @@ -11,7 +11,7 @@ using Test; namespace Ice { - namespace packagemd + namespace namespacemd { public class Client : TestHelper { @@ -19,8 +19,6 @@ namespace Ice { var properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.packagemd"); - properties.setProperty("Ice.Package.Test1", "Ice.packagemd"); using(var communicator = initialize(properties)) { var initial = AllTests.allTests(this); diff --git a/csharp/test/Ice/namespacemd/InitialI.cs b/csharp/test/Ice/namespacemd/InitialI.cs new file mode 100644 index 00000000000..ad9ef6d21db --- /dev/null +++ b/csharp/test/Ice/namespacemd/InitialI.cs @@ -0,0 +1,67 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +namespace Ice +{ + namespace namespacemd + { + public class InitialI : Test.InitialDisp_ + { + public override NoNamespace.C1 getNoNamespaceC2AsC1(Current current = null) + { + return new NoNamespace.C2(); + } + + public override NoNamespace.C2 getNoNamespaceC2AsC2(Current current = null) + { + return new NoNamespace.C2(); + } + + public override WithNamespace.C1 getWithNamespaceC2AsC1(Current current = null) + { + return new WithNamespace.C2(); + } + + public override WithNamespace.C2 getWithNamespaceC2AsC2(Current current = null) + { + return new WithNamespace.C2(); + } + + public override void shutdown(Current current = null) + { + current.adapter.getCommunicator().shutdown(); + } + + public override void throwNoNamespaceE2AsE1(Current current = null) + { + throw new NoNamespace.E2(); + } + + public override void throwNoNamespaceE2AsE2(Current current = null) + { + throw new NoNamespace.E2(); + } + + public override void throwNoNamespaceNotify(Current current = null) + { + throw new NoNamespace.@notify(); + } + + public override void throwWithNamespaceE2AsE1(Current current = null) + { + throw new WithNamespace.E2(); + } + + public override void throwWithNamespaceE2AsE2(Current current = null) + { + throw new WithNamespace.E2(); + } + } + } +} diff --git a/csharp/test/Ice/packagemd/Package.ice b/csharp/test/Ice/namespacemd/Namespace.ice index 97bcebb2a51..71a7be612d7 100644 --- a/csharp/test/Ice/packagemd/Package.ice +++ b/csharp/test/Ice/namespacemd/Namespace.ice @@ -9,33 +9,8 @@ #pragma once -[["cs:namespace:Ice.packagemd.testpkg"]] - -module Test2 -{ -class C1 -{ - int i; -} - -class C2 extends C1 -{ - long l; -} - -exception E1 -{ - int i; -} - -exception E2 extends E1 -{ - long l; -} -} - -["cs:namespace:Ice.packagemd.modpkg"] -module Test3 +["cs:namespace:Ice.namespacemd"] +module WithNamespace { class C1 { diff --git a/csharp/test/Ice/packagemd/NoPackage.ice b/csharp/test/Ice/namespacemd/NoNamespace.ice index 8a26f5f1894..b523d825cc7 100644 --- a/csharp/test/Ice/packagemd/NoPackage.ice +++ b/csharp/test/Ice/namespacemd/NoNamespace.ice @@ -9,8 +9,7 @@ #pragma once -[["cs:namespace:Ice.packagemd"]] -module Test1 +module NoNamespace { class C1 { diff --git a/csharp/test/Ice/packagemd/Server.cs b/csharp/test/Ice/namespacemd/Server.cs index 5cb6e6a6f7c..ce7de2bf359 100644 --- a/csharp/test/Ice/packagemd/Server.cs +++ b/csharp/test/Ice/namespacemd/Server.cs @@ -11,18 +11,15 @@ using Test; namespace Ice { - namespace packagemd + namespace namespacemd { public class Server : TestHelper { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.packagemd"); - properties.setProperty("Ice.Package.Test1", "Ice.packagemd"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { - properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new InitialI(), Ice.Util.stringToIdentity("initial")); adapter.activate(); diff --git a/csharp/test/Ice/namespacemd/Test.ice b/csharp/test/Ice/namespacemd/Test.ice new file mode 100644 index 00000000000..a50f528d47c --- /dev/null +++ b/csharp/test/Ice/namespacemd/Test.ice @@ -0,0 +1,35 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#pragma once + +#include <Namespace.ice> +#include <NoNamespace.ice> + +["cs:namespace:Ice.namespacemd"] +module Test +{ + +interface Initial +{ + NoNamespace::C1 getNoNamespaceC2AsC1(); + NoNamespace::C2 getNoNamespaceC2AsC2(); + void throwNoNamespaceE2AsE1() throws NoNamespace::E1; + void throwNoNamespaceE2AsE2() throws NoNamespace::E2; + void throwNoNamespaceNotify() throws NoNamespace::notify; + + WithNamespace::C1 getWithNamespaceC2AsC1(); + WithNamespace::C2 getWithNamespaceC2AsC2(); + void throwWithNamespaceE2AsE1() throws WithNamespace::E1; + void throwWithNamespaceE2AsE2() throws WithNamespace::E2; + + void shutdown(); +} + +} diff --git a/csharp/test/Ice/packagemd/msbuild/client/net45/client.csproj b/csharp/test/Ice/namespacemd/msbuild/client/net45/client.csproj index dfb65a2dcc6..a62a68b2436 100644 --- a/csharp/test/Ice/packagemd/msbuild/client/net45/client.csproj +++ b/csharp/test/Ice/namespacemd/msbuild/client/net45/client.csproj @@ -69,11 +69,11 @@ <Compile Include="..\..\..\Client.cs"> <Link>Client.cs</Link> </Compile> - <Compile Include="generated\NoPackage.cs"> - <SliceCompileSource>..\..\..\NoPackage.ice</SliceCompileSource> + <Compile Include="generated\NoNamespace.cs"> + <SliceCompileSource>..\..\..\NoNamespace.ice</SliceCompileSource> </Compile> - <Compile Include="generated\Package.cs"> - <SliceCompileSource>..\..\..\Package.ice</SliceCompileSource> + <Compile Include="generated\Namespace.cs"> + <SliceCompileSource>..\..\..\Namespace.ice</SliceCompileSource> </Compile> <Compile Include="generated\Test.cs" /> </ItemGroup> @@ -87,11 +87,11 @@ </None> </ItemGroup> <ItemGroup> - <SliceCompile Include="..\..\..\NoPackage.ice"> - <Link>NoPackage.ice</Link> + <SliceCompile Include="..\..\..\NoNamespace.ice"> + <Link>NoNamespace.ice</Link> </SliceCompile> - <SliceCompile Include="..\..\..\Package.ice"> - <Link>Package.ice</Link> + <SliceCompile Include="..\..\..\Namespace.ice"> + <Link>Namespace.ice</Link> </SliceCompile> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> @@ -105,4 +105,4 @@ <Error Condition="!Exists('..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets'))" /> </Target> <Import Project="..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets" Condition="Exists('..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets')" /> -</Project>
\ No newline at end of file +</Project> diff --git a/csharp/test/Ice/packagemd/msbuild/client/net45/client.exe.config b/csharp/test/Ice/namespacemd/msbuild/client/net45/client.exe.config index 418bdc2f8b2..418bdc2f8b2 100644 --- a/csharp/test/Ice/packagemd/msbuild/client/net45/client.exe.config +++ b/csharp/test/Ice/namespacemd/msbuild/client/net45/client.exe.config diff --git a/csharp/test/Ice/packagemd/msbuild/client/net45/packages.config b/csharp/test/Ice/namespacemd/msbuild/client/net45/packages.config index 91f1d232e55..91f1d232e55 100644 --- a/csharp/test/Ice/packagemd/msbuild/client/net45/packages.config +++ b/csharp/test/Ice/namespacemd/msbuild/client/net45/packages.config diff --git a/csharp/test/Ice/packagemd/msbuild/client/netstandard2.0/client.csproj b/csharp/test/Ice/namespacemd/msbuild/client/netstandard2.0/client.csproj index 2335eaae90f..4dca623d3f9 100644 --- a/csharp/test/Ice/packagemd/msbuild/client/netstandard2.0/client.csproj +++ b/csharp/test/Ice/namespacemd/msbuild/client/netstandard2.0/client.csproj @@ -26,19 +26,19 @@ <Compile Include="../../../../../TestCommon/TestHelper.cs" /> <Compile Include="../../../AllTests.cs" /> <Compile Include="../../../Client.cs" /> - <Compile Include="generated\NoPackage.cs"> - <SliceCompileSource>../../../NoPackage.ice</SliceCompileSource> + <Compile Include="generated\NoNamespace.cs"> + <SliceCompileSource>../../../NoNamespace.ice</SliceCompileSource> </Compile> - <Compile Include="generated\Package.cs"> - <SliceCompileSource>../../../Package.ice</SliceCompileSource> + <Compile Include="generated\Namespace.cs"> + <SliceCompileSource>../../../Namespace.ice</SliceCompileSource> </Compile> <Compile Include="generated\Test.cs"> <SliceCompileSource>../../../Test.ice</SliceCompileSource> </Compile> <PackageReference Include="zeroc.icebuilder.msbuild" Version="5.0.4" /> <SliceCompile Include="../../../Test.ice" /> - <SliceCompile Include="../../../Package.ice" /> - <SliceCompile Include="../../../NoPackage.ice" /> + <SliceCompile Include="../../../Namespace.ice" /> + <SliceCompile Include="../../../NoNamespace.ice" /> </ItemGroup> <Choose> <When Condition="'$(ICE_BIN_DIST)' == 'all'"> diff --git a/csharp/test/Ice/packagemd/msbuild/server/net45/packages.config b/csharp/test/Ice/namespacemd/msbuild/server/net45/packages.config index 91f1d232e55..91f1d232e55 100644 --- a/csharp/test/Ice/packagemd/msbuild/server/net45/packages.config +++ b/csharp/test/Ice/namespacemd/msbuild/server/net45/packages.config diff --git a/csharp/test/Ice/packagemd/msbuild/server/net45/server.csproj b/csharp/test/Ice/namespacemd/msbuild/server/net45/server.csproj index 80b929a9c6e..7023e44b1f5 100644 --- a/csharp/test/Ice/packagemd/msbuild/server/net45/server.csproj +++ b/csharp/test/Ice/namespacemd/msbuild/server/net45/server.csproj @@ -69,11 +69,11 @@ <Compile Include="..\..\..\Server.cs"> <Link>Server.cs</Link> </Compile> - <Compile Include="generated\NoPackage.cs"> - <SliceCompileSource>..\..\..\NoPackage.ice</SliceCompileSource> + <Compile Include="generated\NoNamespace.cs"> + <SliceCompileSource>..\..\..\NoNamespace.ice</SliceCompileSource> </Compile> - <Compile Include="generated\Package.cs"> - <SliceCompileSource>..\..\..\Package.ice</SliceCompileSource> + <Compile Include="generated\Namespace.cs"> + <SliceCompileSource>..\..\..\Namespace.ice</SliceCompileSource> </Compile> <Compile Include="generated\Test.cs" /> </ItemGroup> @@ -85,11 +85,11 @@ </SliceCompile> </ItemGroup> <ItemGroup> - <SliceCompile Include="..\..\..\NoPackage.ice"> - <Link>NoPackage.ice</Link> + <SliceCompile Include="..\..\..\NoNamespace.ice"> + <Link>NoNamespace.ice</Link> </SliceCompile> - <SliceCompile Include="..\..\..\Package.ice"> - <Link>Package.ice</Link> + <SliceCompile Include="..\..\..\Namespace.ice"> + <Link>Namespace.ice</Link> </SliceCompile> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> @@ -103,4 +103,4 @@ <Error Condition="!Exists('..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets'))" /> </Target> <Import Project="..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets" Condition="Exists('..\..\..\..\..\..\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.targets')" /> -</Project>
\ No newline at end of file +</Project> diff --git a/csharp/test/Ice/packagemd/msbuild/server/net45/server.exe.config b/csharp/test/Ice/namespacemd/msbuild/server/net45/server.exe.config index 418bdc2f8b2..418bdc2f8b2 100644 --- a/csharp/test/Ice/packagemd/msbuild/server/net45/server.exe.config +++ b/csharp/test/Ice/namespacemd/msbuild/server/net45/server.exe.config diff --git a/csharp/test/Ice/packagemd/msbuild/server/netstandard2.0/server.csproj b/csharp/test/Ice/namespacemd/msbuild/server/netstandard2.0/server.csproj index 383e1d52829..8ff24a41326 100644 --- a/csharp/test/Ice/packagemd/msbuild/server/netstandard2.0/server.csproj +++ b/csharp/test/Ice/namespacemd/msbuild/server/netstandard2.0/server.csproj @@ -26,19 +26,19 @@ <Compile Include="../../../../../TestCommon/TestHelper.cs" /> <Compile Include="../../../InitialI.cs" /> <Compile Include="../../../Server.cs" /> - <Compile Include="generated\NoPackage.cs"> - <SliceCompileSource>../../../NoPackage.ice</SliceCompileSource> + <Compile Include="generated\NoNamespace.cs"> + <SliceCompileSource>../../../NoNamespace.ice</SliceCompileSource> </Compile> - <Compile Include="generated\Package.cs"> - <SliceCompileSource>../../../Package.ice</SliceCompileSource> + <Compile Include="generated\Namespace.cs"> + <SliceCompileSource>../../../Namespace.ice</SliceCompileSource> </Compile> <Compile Include="generated\Test.cs"> <SliceCompileSource>../../../Test.ice</SliceCompileSource> </Compile> <PackageReference Include="zeroc.icebuilder.msbuild" Version="5.0.4" /> <SliceCompile Include="../../../Test.ice" /> - <SliceCompile Include="../../../Package.ice" /> - <SliceCompile Include="../../../NoPackage.ice" /> + <SliceCompile Include="../../../Namespace.ice" /> + <SliceCompile Include="../../../NoNamespace.ice" /> </ItemGroup> <Choose> <When Condition="'$(ICE_BIN_DIST)' == 'all'"> diff --git a/csharp/test/Ice/packagemd/msbuild/test/netstandard2.0/test.csproj b/csharp/test/Ice/namespacemd/msbuild/test/netstandard2.0/test.csproj index dcefa3fff45..cf31b2e5388 100644 --- a/csharp/test/Ice/packagemd/msbuild/test/netstandard2.0/test.csproj +++ b/csharp/test/Ice/namespacemd/msbuild/test/netstandard2.0/test.csproj @@ -2,7 +2,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <Import Project="../../../../../../msbuild/ice.common.props" /> <PropertyGroup> - <AssemblyName>Ice.packagemd</AssemblyName> + <AssemblyName>Ice.namespacemd</AssemblyName> <TargetFramework>netstandard2.0</TargetFramework> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> @@ -21,20 +21,20 @@ <Compile Include="../../../Client.cs" /> <Compile Include="../../../InitialI.cs" /> <Compile Include="../../../Server.cs" /> - <Compile Include="generated/NoPackage.cs"> - <SliceCompileSource>../../../NoPackage.ice</SliceCompileSource> + <Compile Include="generated/NoNamespace.cs"> + <SliceCompileSource>../../../NoNamespace.ice</SliceCompileSource> </Compile> - <Compile Include="generated/Package.cs"> - <SliceCompileSource>../../../Package.ice</SliceCompileSource> + <Compile Include="generated/Namespace.cs"> + <SliceCompileSource>../../../Namespace.ice</SliceCompileSource> </Compile> <Compile Include="generated/Test.cs"> <SliceCompileSource>../../../Test.ice</SliceCompileSource> </Compile> - <SliceCompile Include="../../../NoPackage.ice" /> - <SliceCompile Include="../../../Package.ice" /> + <SliceCompile Include="../../../NoNamespace.ice" /> + <SliceCompile Include="../../../Namespace.ice" /> <SliceCompile Include="../../../Test.ice" /> <PackageReference Include="zeroc.icebuilder.msbuild" Version="5.0.4" /> diff --git a/csharp/test/Ice/objects/Client.cs b/csharp/test/Ice/objects/Client.cs index fba1ecb97cb..6b82de21a9c 100644 --- a/csharp/test/Ice/objects/Client.cs +++ b/csharp/test/Ice/objects/Client.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.objects"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.objects.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { var initial = Test.AllTests.allTests(this); initial.shutdown(); diff --git a/csharp/test/Ice/objects/Collocated.cs b/csharp/test/Ice/objects/Collocated.cs index e5a4575f172..816065c8ae9 100644 --- a/csharp/test/Ice/objects/Collocated.cs +++ b/csharp/test/Ice/objects/Collocated.cs @@ -17,10 +17,11 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.objects"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.objects.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/objects/Server.cs b/csharp/test/Ice/objects/Server.cs index 42b12ac461a..60ec8512fa7 100644 --- a/csharp/test/Ice/objects/Server.cs +++ b/csharp/test/Ice/objects/Server.cs @@ -36,10 +36,11 @@ namespace Ice public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.objects"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.objects.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); + using(var communicator = initialize(initData)) { communicator.getValueFactoryManager().add(MyValueFactory, "::Test::I"); communicator.getValueFactoryManager().add(MyValueFactory, "::Test::J"); diff --git a/csharp/test/Ice/objects/Test.ice b/csharp/test/Ice/objects/Test.ice index 3f505e409c8..215b9e2a262 100644 --- a/csharp/test/Ice/objects/Test.ice +++ b/csharp/test/Ice/objects/Test.ice @@ -9,8 +9,8 @@ #pragma once -[["suppress-warning:deprecated"]] // For classes with operations -[["cs:namespace:Ice.objects"]] +[["cs:typeid-namespace:Ice.objects.TypeId", "suppress-warning:deprecated"]] // For classes with operations +["cs:namespace:Ice.objects"] module Test { diff --git a/csharp/test/Ice/operations/Client.cs b/csharp/test/Ice/operations/Client.cs index 6bcb3ee8f8f..a3018af0c13 100644 --- a/csharp/test/Ice/operations/Client.cs +++ b/csharp/test/Ice/operations/Client.cs @@ -18,12 +18,13 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.ThreadPool.Client.Size", "2"); - properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); - properties.setProperty("Ice.BatchAutoFlushSize", "100"); - properties.setProperty("Ice.Package.Test", "Ice.operations"); - using (var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2"); + initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); + initData.properties.setProperty("Ice.BatchAutoFlushSize", "100"); + using(var communicator = initialize(initData)) { var myClass = AllTests.allTests(this); diff --git a/csharp/test/Ice/operations/Collocated.cs b/csharp/test/Ice/operations/Collocated.cs index 1015858d192..6d9a9900a08 100644 --- a/csharp/test/Ice/operations/Collocated.cs +++ b/csharp/test/Ice/operations/Collocated.cs @@ -18,12 +18,13 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.ThreadPool.Client.Size", "2"); - properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); - properties.setProperty("Ice.BatchAutoFlushSize", "100"); - properties.setProperty("Ice.Package.Test", "Ice.operations"); - using (var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.TypeId"}; + initData.properties = createTestProperties(ref args); + initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2"); + initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); + initData.properties.setProperty("Ice.BatchAutoFlushSize", "100"); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.AdapterId", "test"); communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); @@ -31,7 +32,7 @@ namespace Ice Ice.ObjectPrx prx = adapter.add(new MyDerivedClassI(), Ice.Util.stringToIdentity("test")); //adapter.activate(); // Don't activate OA to ensure collocation is used. - if (prx.ice_getConnection() != null) + if(prx.ice_getConnection() != null) { throw new System.Exception(); } diff --git a/csharp/test/Ice/operations/Server.cs b/csharp/test/Ice/operations/Server.cs index 305ec01d108..a318a7b277b 100644 --- a/csharp/test/Ice/operations/Server.cs +++ b/csharp/test/Ice/operations/Server.cs @@ -17,19 +17,20 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.TypeId"}; + initData.properties = createTestProperties(ref args); // // Its possible to have batch oneway requests dispatched // after the adapter is deactivated due to thread // scheduling so we supress this warning. // - properties.setProperty("Ice.Warn.Dispatch", "0"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); // // We don't want connection warnings because of the timeout test. // - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Package.Test", "Ice.operations"); - using (var communicator = initialize(properties)) + initData.properties.setProperty("Ice.Warn.Connections", "0"); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/operations/ServerAMD.cs b/csharp/test/Ice/operations/ServerAMD.cs index 23f79440da7..bdb55bf9d01 100644 --- a/csharp/test/Ice/operations/ServerAMD.cs +++ b/csharp/test/Ice/operations/ServerAMD.cs @@ -19,19 +19,21 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.AMD.TypeId"}; + initData.properties = createTestProperties(ref args); + // // Its possible to have batch oneway requests dispatched // after the adapter is deactivated due to thread // scheduling so we supress this warning. // - properties.setProperty("Ice.Warn.Dispatch", "0"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); // // We don't want connection warnings because of the timeout test. // - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Package.Test", "Ice.operations.AMD"); - using (var communicator = initialize(properties)) + initData.properties.setProperty("Ice.Warn.Connections", "0"); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/operations/ServerAMDTie.cs b/csharp/test/Ice/operations/ServerAMDTie.cs index 4fa6ac835c0..b32991e27ea 100644 --- a/csharp/test/Ice/operations/ServerAMDTie.cs +++ b/csharp/test/Ice/operations/ServerAMDTie.cs @@ -21,19 +21,21 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.AMD.TypeId"}; + + initData.properties = createTestProperties(ref args); // // Its possible to have batch oneway requests dispatched // after the adapter is deactivated due to thread // scheduling so we supress this warning. // - properties.setProperty("Ice.Warn.Dispatch", "0"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); // // We don't want connection warnings because of the timeout test. // - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Package.Test", "Ice.operations.AMD"); - using (var communicator = initialize(properties)) + initData.properties.setProperty("Ice.Warn.Connections", "0"); + using (var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/operations/ServerTie.cs b/csharp/test/Ice/operations/ServerTie.cs index 84d17a3cfb1..2d189e30f1d 100644 --- a/csharp/test/Ice/operations/ServerTie.cs +++ b/csharp/test/Ice/operations/ServerTie.cs @@ -19,19 +19,20 @@ namespace Ice { public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.operations.TypeId"}; + initData.properties = createTestProperties(ref args); // // Its possible to have batch oneway requests dispatched // after the adapter is deactivated due to thread // scheduling so we supress this warning. // - properties.setProperty("Ice.Warn.Dispatch", "0"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); // // We don't want connection warnings because of the timeout test. // - properties.setProperty("Ice.Warn.Connections", "0"); - properties.setProperty("Ice.Package.Test", "Ice.operations"); - using (var communicator = initialize(properties)) + initData.properties.setProperty("Ice.Warn.Connections", "0"); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/operations/Test.ice b/csharp/test/Ice/operations/Test.ice index 292c9ccf621..e9d2c9d7697 100644 --- a/csharp/test/Ice/operations/Test.ice +++ b/csharp/test/Ice/operations/Test.ice @@ -11,7 +11,9 @@ #include <Ice/Current.ice> -[["cs:namespace:Ice.operations"]] +[["cs:typeid-namespace:Ice.operations.TypeId"]] + +["cs:namespace:Ice.operations"] module Test { diff --git a/csharp/test/Ice/operations/TestAMD.ice b/csharp/test/Ice/operations/TestAMD.ice index f5b8a8c82c7..41741eec639 100644 --- a/csharp/test/Ice/operations/TestAMD.ice +++ b/csharp/test/Ice/operations/TestAMD.ice @@ -11,7 +11,9 @@ #include <Ice/Current.ice> -[["cs:namespace:Ice.operations.AMD"]] +[["cs:typeid-namespace:Ice.operations.AMD.TypeId"]] + +["cs:namespace:Ice.operations.AMD"] module Test { diff --git a/csharp/test/Ice/optional/Client.cs b/csharp/test/Ice/optional/Client.cs index 5fa604b35ab..4c1828233ff 100644 --- a/csharp/test/Ice/optional/Client.cs +++ b/csharp/test/Ice/optional/Client.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.optional"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.optional.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { var initial = AllTests.allTests(this); initial.shutdown(); diff --git a/csharp/test/Ice/optional/Server.cs b/csharp/test/Ice/optional/Server.cs index 7d98f2c8822..c8cdef5a470 100644 --- a/csharp/test/Ice/optional/Server.cs +++ b/csharp/test/Ice/optional/Server.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.optional"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.optional.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/optional/ServerAMD.cs b/csharp/test/Ice/optional/ServerAMD.cs index 19efc461a95..eebfae4adf3 100644 --- a/csharp/test/Ice/optional/ServerAMD.cs +++ b/csharp/test/Ice/optional/ServerAMD.cs @@ -19,9 +19,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.optional.AMD"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.optional.AMD.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/optional/Test.ice b/csharp/test/Ice/optional/Test.ice index 076844b0531..479387e0e52 100644 --- a/csharp/test/Ice/optional/Test.ice +++ b/csharp/test/Ice/optional/Test.ice @@ -9,8 +9,8 @@ #pragma once -[["suppress-warning:deprecated"]] -[["cs:namespace:Ice.optional"]] +[["cs:typeid-namespace:Ice.optional.TypeId", "suppress-warning:deprecated"]] +["cs:namespace:Ice.optional"] module Test { diff --git a/csharp/test/Ice/optional/TestAMD.ice b/csharp/test/Ice/optional/TestAMD.ice index 53df2a33815..d2f92b90fd1 100644 --- a/csharp/test/Ice/optional/TestAMD.ice +++ b/csharp/test/Ice/optional/TestAMD.ice @@ -9,8 +9,8 @@ #pragma once -[["suppress-warning:deprecated"]] -[["cs:namespace:Ice.optional.AMD"]] +[["cs:typeid-namespace:Ice.optional.AMD.TypeId", "suppress-warning:deprecated"]] +["cs:namespace:Ice.optional.AMD"] module Test { diff --git a/csharp/test/Ice/packagemd/AllTests.cs b/csharp/test/Ice/packagemd/AllTests.cs deleted file mode 100644 index bf44bb8dfd9..00000000000 --- a/csharp/test/Ice/packagemd/AllTests.cs +++ /dev/null @@ -1,182 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -using Test; - -namespace Ice -{ - namespace packagemd - { - public class AllTests : global::Test.AllTests - { - public static Test.InitialPrx allTests(TestHelper helper) - { - var communicator = helper.communicator(); - var output = helper.getWriter(); - output.Write("testing stringToProxy... "); - output.Flush(); - var @base = communicator.stringToProxy("initial:" + helper.getTestEndpoint(0)); - test(@base != null); - output.WriteLine("ok"); - - output.Write("testing checked cast... "); - output.Flush(); - var initial = Test.InitialPrxHelper.checkedCast(@base); - test(initial != null); - test(initial.Equals(@base)); - output.WriteLine("ok"); - - { - output.Write("testing types without package... "); - output.Flush(); - Test1.C1 c1 = initial.getTest1C2AsC1(); - test(c1 != null); - test(c1 is Test1.C2); - Test1.C2 c2 = initial.getTest1C2AsC2(); - test(c2 != null); - try - { - initial.throwTest1E2AsE1(); - test(false); - } - catch(Test1.E1 ex) - { - test(ex is Test1.E2); - } - try - { - initial.throwTest1E2AsE2(); - test(false); - } - catch(Test1.E2) - { - // Expected - } - try - { - initial.throwTest1Notify(); - test(false); - } - catch(Test1.@notify) - { - // Expected - } - output.WriteLine("ok"); - } - - { - output.Write("testing types with package... "); - output.Flush(); - - { - try - { - initial.throwTest2E2AsE1(); - test(false); - } - catch(Ice.UnknownUserException) - { - // Expected - } - catch(Ice.MarshalException) - { - // Expected - } - catch(Ice.packagemd.testpkg.Test2.E1) - { - test(false); - } - try - { - initial.throwTest2E2AsE2(); - test(false); - } - catch(Ice.UnknownUserException) - { - // Expected - } - catch(Ice.MarshalException) - { - // Expected - } - catch(testpkg.Test2.E1) - { - test(false); - } - } - - { - // - // Define Ice.Package.Test2=testpkg and try again. - // - communicator.getProperties().setProperty("Ice.Package.Test2", "Ice.packagemd.testpkg"); - testpkg.Test2.C1 c1 = initial.getTest2C2AsC1(); - test(c1 != null); - test(c1 is testpkg.Test2.C2); - testpkg.Test2.C2 c2 = initial.getTest2C2AsC2(); - test(c2 != null); - try - { - initial.throwTest2E2AsE1(); - test(false); - } - catch(testpkg.Test2.E1 ex) - { - test(ex is testpkg.Test2.E2); - } - try - { - initial.throwTest2E2AsE2(); - test(false); - } - catch(testpkg.Test2.E2) - { - // Expected - } - } - - { - // - // Define Ice.Default.Package=testpkg and try again. We can't retrieve - // the Test2.* types again(with this communicator) because factories - // have already been cached for them, so now we use the Test3.* types. - // - communicator.getProperties().setProperty("Ice.Default.Package", "Ice.packagemd.modpkg"); - modpkg.Test3.C1 c1 = initial.getTest3C2AsC1(); - test(c1 != null); - test(c1 is modpkg.Test3.C2); - modpkg.Test3.C2 c2 = initial.getTest3C2AsC2(); - test(c2 != null); - try - { - initial.throwTest3E2AsE1(); - test(false); - } - catch(modpkg.Test3.E1 ex) - { - test(ex is modpkg.Test3.E2); - } - try - { - initial.throwTest3E2AsE2(); - test(false); - } - catch(modpkg.Test3.E2) - { - // Expected - } - } - - output.WriteLine("ok"); - } - return initial; - } - } - } -} diff --git a/csharp/test/Ice/packagemd/InitialI.cs b/csharp/test/Ice/packagemd/InitialI.cs deleted file mode 100644 index 785b6e5da17..00000000000 --- a/csharp/test/Ice/packagemd/InitialI.cs +++ /dev/null @@ -1,87 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -namespace Ice -{ - namespace packagemd - { - public class InitialI : Test.InitialDisp_ - { - public override Test1.C1 getTest1C2AsC1(Current current = null) - { - return new Test1.C2(); - } - - public override Test1.C2 getTest1C2AsC2(Current current = null) - { - return new Test1.C2(); - } - - public override testpkg.Test2.C1 getTest2C2AsC1(Current current = null) - { - return new testpkg.Test2.C2(); - } - - public override testpkg.Test2.C2 getTest2C2AsC2(Current current = null) - { - return new testpkg.Test2.C2(); - } - - public override modpkg.Test3.C1 getTest3C2AsC1(Current current = null) - { - return new modpkg.Test3.C2(); - } - - public override modpkg.Test3.C2 getTest3C2AsC2(Current current = null) - { - return new modpkg.Test3.C2(); - } - - public override void shutdown(Current current = null) - { - current.adapter.getCommunicator().shutdown(); - } - - public override void throwTest1E2AsE1(Current current = null) - { - throw new Test1.E2(); - } - - public override void throwTest1E2AsE2(Current current = null) - { - throw new Test1.E2(); - } - - public override void throwTest1Notify(Current current = null) - { - throw new Test1.@notify(); - } - - public override void throwTest2E2AsE1(Current current = null) - { - throw new testpkg.Test2.E2(); - } - - public override void throwTest2E2AsE2(Current current = null) - { - throw new testpkg.Test2.E2(); - } - - public override void throwTest3E2AsE1(Current current = null) - { - throw new modpkg.Test3.E2(); - } - - public override void throwTest3E2AsE2(Current current = null) - { - throw new modpkg.Test3.E2(); - } - } - } -} diff --git a/csharp/test/Ice/packagemd/Test.ice b/csharp/test/Ice/packagemd/Test.ice deleted file mode 100644 index 7d273f904a8..00000000000 --- a/csharp/test/Ice/packagemd/Test.ice +++ /dev/null @@ -1,40 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#pragma once - -#include <Package.ice> -#include <NoPackage.ice> - -[["cs:namespace:Ice.packagemd"]] -module Test -{ - -interface Initial -{ - Test1::C1 getTest1C2AsC1(); - Test1::C2 getTest1C2AsC2(); - void throwTest1E2AsE1() throws Test1::E1; - void throwTest1E2AsE2() throws Test1::E2; - void throwTest1Notify() throws Test1::notify; - - Test2::C1 getTest2C2AsC1(); - Test2::C2 getTest2C2AsC2(); - void throwTest2E2AsE1() throws Test2::E1; - void throwTest2E2AsE2() throws Test2::E2; - - Test3::C1 getTest3C2AsC1(); - Test3::C2 getTest3C2AsC2(); - void throwTest3E2AsE1() throws Test3::E1; - void throwTest3E2AsE2() throws Test3::E2; - - void shutdown(); -} - -} diff --git a/csharp/test/Ice/proxy/Client.cs b/csharp/test/Ice/proxy/Client.cs index 3a34ae485d4..bc9d6462131 100644 --- a/csharp/test/Ice/proxy/Client.cs +++ b/csharp/test/Ice/proxy/Client.cs @@ -17,9 +17,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.proxy"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var myClass = AllTests.allTests(this); myClass.shutdown(); diff --git a/csharp/test/Ice/proxy/Collocated.cs b/csharp/test/Ice/proxy/Collocated.cs index 616219c0fe3..5e388ad36b2 100644 --- a/csharp/test/Ice/proxy/Collocated.cs +++ b/csharp/test/Ice/proxy/Collocated.cs @@ -22,7 +22,6 @@ namespace Ice properties.setProperty("Ice.ThreadPool.Client.Size", "2"); // For nested AMI. properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.proxy"); using(var communicator = initialize(properties)) { diff --git a/csharp/test/Ice/proxy/Server.cs b/csharp/test/Ice/proxy/Server.cs index fbde39fc50a..10be79ebc08 100644 --- a/csharp/test/Ice/proxy/Server.cs +++ b/csharp/test/Ice/proxy/Server.cs @@ -23,7 +23,6 @@ namespace Ice // properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.proxy"); using(var communicator = initialize(properties)) { diff --git a/csharp/test/Ice/proxy/ServerAMD.cs b/csharp/test/Ice/proxy/ServerAMD.cs index 5bda4da4baa..d061ca372d6 100644 --- a/csharp/test/Ice/proxy/ServerAMD.cs +++ b/csharp/test/Ice/proxy/ServerAMD.cs @@ -23,7 +23,6 @@ namespace Ice // properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.proxy"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/proxy/Test.ice b/csharp/test/Ice/proxy/Test.ice index a49110e4fcc..9026c9174b9 100644 --- a/csharp/test/Ice/proxy/Test.ice +++ b/csharp/test/Ice/proxy/Test.ice @@ -11,7 +11,7 @@ #include <Ice/Current.ice> -[["cs:namespace:Ice.proxy"]] +["cs:namespace:Ice.proxy"] module Test { diff --git a/csharp/test/Ice/proxy/TestAMD.ice b/csharp/test/Ice/proxy/TestAMD.ice index 2d1dcdf815a..c55ab9bd863 100644 --- a/csharp/test/Ice/proxy/TestAMD.ice +++ b/csharp/test/Ice/proxy/TestAMD.ice @@ -11,7 +11,7 @@ #include <Ice/Current.ice> -[["cs:namespace:Ice.proxy.AMD"]] +["cs:namespace:Ice.proxy.AMD"] module Test { diff --git a/csharp/test/Ice/retry/Client.cs b/csharp/test/Ice/retry/Client.cs index 796faaf98a9..49cf5bc0151 100644 --- a/csharp/test/Ice/retry/Client.cs +++ b/csharp/test/Ice/retry/Client.cs @@ -27,7 +27,6 @@ namespace Ice // This test kills connections, so we don't want warnings. // initData.properties.setProperty("Ice.Warn.Connections", "0"); - initData.properties.setProperty("Ice.Package.Test", "Ice.retry"); using(var communicator = initialize(initData)) { // diff --git a/csharp/test/Ice/retry/Collocated.cs b/csharp/test/Ice/retry/Collocated.cs index 0f68acb7b74..0b601e3fbdd 100644 --- a/csharp/test/Ice/retry/Collocated.cs +++ b/csharp/test/Ice/retry/Collocated.cs @@ -28,7 +28,6 @@ namespace Ice // This test kills connections, so we don't want warnings. // initData.properties.setProperty("Ice.Warn.Connections", "0"); - initData.properties.setProperty("Ice.Package.Test", "Ice.retry"); using(var communicator = initialize(initData)) { // diff --git a/csharp/test/Ice/retry/Server.cs b/csharp/test/Ice/retry/Server.cs index 22413bd18d7..359b89ea045 100644 --- a/csharp/test/Ice/retry/Server.cs +++ b/csharp/test/Ice/retry/Server.cs @@ -19,7 +19,6 @@ namespace Ice { var properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("Ice.Package.Test", "Ice.retry"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/retry/Test.ice b/csharp/test/Ice/retry/Test.ice index 50ebd5b20a5..5fc86952026 100644 --- a/csharp/test/Ice/retry/Test.ice +++ b/csharp/test/Ice/retry/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.retry"]] +["cs:namespace:Ice.retry"] module Test { diff --git a/csharp/test/Ice/scope/Client.cs b/csharp/test/Ice/scope/Client.cs index 77afc462eee..164ed236bea 100644 --- a/csharp/test/Ice/scope/Client.cs +++ b/csharp/test/Ice/scope/Client.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.scope"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.scope.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { var output = getWriter(); output.Write("test same Slice type name in different scopes... "); diff --git a/csharp/test/Ice/scope/Server.cs b/csharp/test/Ice/scope/Server.cs index 32824923b80..edeb767cf55 100644 --- a/csharp/test/Ice/scope/Server.cs +++ b/csharp/test/Ice/scope/Server.cs @@ -228,9 +228,10 @@ namespace Ice public override void run(string[] args) { - Ice.Properties properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.scope"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.scope.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/scope/Test.ice b/csharp/test/Ice/scope/Test.ice index ac08ce5db18..4506df48c31 100644 --- a/csharp/test/Ice/scope/Test.ice +++ b/csharp/test/Ice/scope/Test.ice @@ -9,7 +9,8 @@ #pragma once -[["cs:namespace:Ice.scope"]] +[["cs:typeid-namespace:Ice.scope.TypeId"]] +["cs:namespace:Ice.scope"] module Test { struct S diff --git a/csharp/test/Ice/seqMapping/Client.cs b/csharp/test/Ice/seqMapping/Client.cs index 046b85cdb3b..ad1902d006d 100644 --- a/csharp/test/Ice/seqMapping/Client.cs +++ b/csharp/test/Ice/seqMapping/Client.cs @@ -18,9 +18,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.seqMapping"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.seqMapping.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { var myClass = AllTests.allTests(this, false); Console.Out.Write("shutting down server... "); diff --git a/csharp/test/Ice/seqMapping/Collocated.cs b/csharp/test/Ice/seqMapping/Collocated.cs index 4e56d98cd2d..37598e82143 100644 --- a/csharp/test/Ice/seqMapping/Collocated.cs +++ b/csharp/test/Ice/seqMapping/Collocated.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.seqMapping"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.seqMapping.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/seqMapping/Server.cs b/csharp/test/Ice/seqMapping/Server.cs index fd20e050b0c..4487cd66fab 100644 --- a/csharp/test/Ice/seqMapping/Server.cs +++ b/csharp/test/Ice/seqMapping/Server.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.seqMapping"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.seqMapping.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/seqMapping/ServerAMD.cs b/csharp/test/Ice/seqMapping/ServerAMD.cs index 821a6d6db9d..23155db6e8b 100644 --- a/csharp/test/Ice/seqMapping/ServerAMD.cs +++ b/csharp/test/Ice/seqMapping/ServerAMD.cs @@ -19,9 +19,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.seqMapping.AMD"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.seqMapping.AMD.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); var adapter = communicator.createObjectAdapter("TestAdapter"); diff --git a/csharp/test/Ice/seqMapping/Test.ice b/csharp/test/Ice/seqMapping/Test.ice index 5d1f43b2b16..36919996e33 100644 --- a/csharp/test/Ice/seqMapping/Test.ice +++ b/csharp/test/Ice/seqMapping/Test.ice @@ -9,7 +9,9 @@ #pragma once -[["cs:namespace:Ice.seqMapping"]] +[["cs:typeid-namespace:Ice.seqMapping.TypeId"]] + +["cs:namespace:Ice.seqMapping"] module Test { diff --git a/csharp/test/Ice/seqMapping/TestAMD.ice b/csharp/test/Ice/seqMapping/TestAMD.ice index 0aefd6693fd..f80a0e1f6a7 100644 --- a/csharp/test/Ice/seqMapping/TestAMD.ice +++ b/csharp/test/Ice/seqMapping/TestAMD.ice @@ -9,7 +9,9 @@ #pragma once -[["cs:namespace:Ice.seqMapping.AMD"]] +[["cs:typeid-namespace:Ice.seqMapping.AMD.TypeId"]] + +["cs:namespace:Ice.seqMapping.AMD"] module Test { diff --git a/csharp/test/Ice/serialize/Client.cs b/csharp/test/Ice/serialize/Client.cs index e12e8e0db37..0efb4797989 100644 --- a/csharp/test/Ice/serialize/Client.cs +++ b/csharp/test/Ice/serialize/Client.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.serialize"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.serialize.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/serialize/Test.ice b/csharp/test/Ice/serialize/Test.ice index 296b1ba4897..7ac6fee7d08 100644 --- a/csharp/test/Ice/serialize/Test.ice +++ b/csharp/test/Ice/serialize/Test.ice @@ -11,7 +11,9 @@ #include <Ice/BuiltinSequences.ice> -[["cs:namespace:Ice.serialize"]] +[["cs:typeid-namespace:Ice.serialize.TypeId"]] + +["cs:namespace:Ice.serialize"] module Test { diff --git a/csharp/test/Ice/servantLocator/Client.cs b/csharp/test/Ice/servantLocator/Client.cs index 012a703cf71..905523bd0e4 100644 --- a/csharp/test/Ice/servantLocator/Client.cs +++ b/csharp/test/Ice/servantLocator/Client.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.servantLocator"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.servantLocator.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { var obj = AllTests.allTests(this); obj.shutdown(); diff --git a/csharp/test/Ice/servantLocator/Collocated.cs b/csharp/test/Ice/servantLocator/Collocated.cs index e68caa7f50b..fc6da1dd04c 100644 --- a/csharp/test/Ice/servantLocator/Collocated.cs +++ b/csharp/test/Ice/servantLocator/Collocated.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.servantLocator"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.servantLocator.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); communicator.getProperties().setProperty("Ice.Warn.Dispatch", "0"); diff --git a/csharp/test/Ice/servantLocator/Server.cs b/csharp/test/Ice/servantLocator/Server.cs index 7a1de5ad03e..badace3a3af 100644 --- a/csharp/test/Ice/servantLocator/Server.cs +++ b/csharp/test/Ice/servantLocator/Server.cs @@ -17,9 +17,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.servantLocator"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.servantLocator.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); communicator.getProperties().setProperty("Ice.Warn.Dispatch", "0"); diff --git a/csharp/test/Ice/servantLocator/ServerAMD.cs b/csharp/test/Ice/servantLocator/ServerAMD.cs index 02af2037637..3614fdf3020 100644 --- a/csharp/test/Ice/servantLocator/ServerAMD.cs +++ b/csharp/test/Ice/servantLocator/ServerAMD.cs @@ -19,9 +19,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.servantLocator.AMD"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.servantLocator.AMD.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); communicator.getProperties().setProperty("Ice.Warn.Dispatch", "0"); diff --git a/csharp/test/Ice/servantLocator/Test.ice b/csharp/test/Ice/servantLocator/Test.ice index aacbe376dd4..3d6f2c25856 100644 --- a/csharp/test/Ice/servantLocator/Test.ice +++ b/csharp/test/Ice/servantLocator/Test.ice @@ -9,7 +9,9 @@ #pragma once -[["cs:namespace:Ice.servantLocator"]] +[["cs:typeid-namespace:Ice.servantLocator.TypeId"]] + +["cs:namespace:Ice.servantLocator"] module Test { diff --git a/csharp/test/Ice/servantLocator/TestAMD.ice b/csharp/test/Ice/servantLocator/TestAMD.ice index fb7409e0108..3e9d924c485 100644 --- a/csharp/test/Ice/servantLocator/TestAMD.ice +++ b/csharp/test/Ice/servantLocator/TestAMD.ice @@ -9,7 +9,9 @@ #pragma once -[["cs:namespace:Ice.servantLocator.AMD"]] +[["cs:typeid-namespace:Ice.servantLocator.AMD.TypeId"]] + +["cs:namespace:Ice.servantLocator.AMD"] module Test { diff --git a/csharp/test/Ice/stream/Client.cs b/csharp/test/Ice/stream/Client.cs index e2a7837781b..8c5f5c846fa 100644 --- a/csharp/test/Ice/stream/Client.cs +++ b/csharp/test/Ice/stream/Client.cs @@ -15,9 +15,10 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.stream"); - using(var communicator = initialize(properties)) + var initData = new InitializationData(); + initData.typeIdNamespaces = new string[]{"Ice.stream.TypeId"}; + initData.properties = createTestProperties(ref args); + using(var communicator = initialize(initData)) { AllTests.allTests(this); } diff --git a/csharp/test/Ice/stream/Test.ice b/csharp/test/Ice/stream/Test.ice index f1e191ca631..752efa16fd4 100644 --- a/csharp/test/Ice/stream/Test.ice +++ b/csharp/test/Ice/stream/Test.ice @@ -12,12 +12,11 @@ // // Suppress invalid metadata warnings // -[["suppress-warning:invalid-metadata, deprecated"]] - -[["cs:namespace:Ice.stream"]] +[["cs:typeid-namespace:Ice.stream.TypeId", "suppress-warning:invalid-metadata, deprecated"]] #include <Ice/BuiltinSequences.ice> +["cs:namespace:Ice.stream"] module Test { diff --git a/csharp/test/Ice/threadPoolPriority/Client.cs b/csharp/test/Ice/threadPoolPriority/Client.cs index e0b54ac4939..695fe7fe715 100644 --- a/csharp/test/Ice/threadPoolPriority/Client.cs +++ b/csharp/test/Ice/threadPoolPriority/Client.cs @@ -15,9 +15,7 @@ namespace Ice { public override void run(string[] args) { - var properties = createTestProperties(ref args); - properties.setProperty("Ice.Package.Test", "Ice.threadPoolPriority"); - using(var communicator = initialize(properties)) + using(var communicator = initialize(ref args)) { var output = getWriter(); output.Write("testing server priority... "); diff --git a/csharp/test/Ice/threadPoolPriority/Server.cs b/csharp/test/Ice/threadPoolPriority/Server.cs index 866eaf1ca9a..0324d2e930a 100644 --- a/csharp/test/Ice/threadPoolPriority/Server.cs +++ b/csharp/test/Ice/threadPoolPriority/Server.cs @@ -17,7 +17,6 @@ namespace Ice { var properties = createTestProperties(ref args); properties.setProperty("Ice.ThreadPool.Server.ThreadPriority", "AboveNormal"); - properties.setProperty("Ice.Package.Test", "Ice.threadPoolPriority"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/threadPoolPriority/Test.ice b/csharp/test/Ice/threadPoolPriority/Test.ice index 651adc19877..3551059a4ee 100644 --- a/csharp/test/Ice/threadPoolPriority/Test.ice +++ b/csharp/test/Ice/threadPoolPriority/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.threadPoolPriority"]] +["cs:namespace:Ice.threadPoolPriority"] module Test { diff --git a/csharp/test/Ice/timeout/Client.cs b/csharp/test/Ice/timeout/Client.cs index 4e635fbd1ba..accea863f65 100644 --- a/csharp/test/Ice/timeout/Client.cs +++ b/csharp/test/Ice/timeout/Client.cs @@ -32,7 +32,6 @@ namespace Ice // send() blocking after sending a given amount of data. // properties.setProperty("Ice.TCP.SndSize", "50000"); - properties.setProperty("Ice.Package.Test", "Ice.timeout"); using(var communicator = initialize(properties)) { AllTests.allTests(this); diff --git a/csharp/test/Ice/timeout/Server.cs b/csharp/test/Ice/timeout/Server.cs index e787c0dfbc8..5119dfe0395 100644 --- a/csharp/test/Ice/timeout/Server.cs +++ b/csharp/test/Ice/timeout/Server.cs @@ -32,7 +32,6 @@ namespace Ice // send() blocking after sending a given amount of data. // properties.setProperty("Ice.TCP.RcvSize", "50000"); - properties.setProperty("Ice.Package.Test", "Ice.timeout"); using(var communicator = initialize(properties)) { communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); diff --git a/csharp/test/Ice/timeout/Test.ice b/csharp/test/Ice/timeout/Test.ice index 4efc3f10943..5a829b019ac 100644 --- a/csharp/test/Ice/timeout/Test.ice +++ b/csharp/test/Ice/timeout/Test.ice @@ -9,7 +9,7 @@ #pragma once -[["cs:namespace:Ice.timeout"]] +["cs:namespace:Ice.timeout"] module Test { diff --git a/csharp/test/Ice/udp/Client.cs b/csharp/test/Ice/udp/Client.cs index fe80ee8e2fd..26f75f2bacc 100644 --- a/csharp/test/Ice/udp/Client.cs +++ b/csharp/test/Ice/udp/Client.cs @@ -20,7 +20,6 @@ namespace Ice var properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.UDP.SndSize", "16384"); - properties.setProperty("Ice.Package.Test", "Ice.udp"); using(var communicator = initialize(properties)) { AllTests.allTests(this); diff --git a/csharp/test/Ice/udp/Server.cs b/csharp/test/Ice/udp/Server.cs index 8f7b5bb6f93..3ba45ca2b9f 100644 --- a/csharp/test/Ice/udp/Server.cs +++ b/csharp/test/Ice/udp/Server.cs @@ -21,7 +21,6 @@ namespace Ice Ice.Properties properties = createTestProperties(ref args); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.UDP.RcvSize", "16384"); - properties.setProperty("Ice.Package.Test", "Ice.udp"); if(IceInternal.AssemblyUtil.isMacOS && properties.getPropertyAsInt("Ice.IPv6") > 0) { // Disable dual mode sockets on macOS, see https://github.com/dotnet/corefx/issues/31182 diff --git a/csharp/test/Ice/udp/Test.ice b/csharp/test/Ice/udp/Test.ice index 8607eb6a677..c7399739865 100644 --- a/csharp/test/Ice/udp/Test.ice +++ b/csharp/test/Ice/udp/Test.ice @@ -11,7 +11,7 @@ #include <Ice/Identity.ice> -[["cs:namespace:Ice.udp"]] +["cs:namespace:Ice.udp"] module Test { diff --git a/csharp/test/xamarin/controller/MainPage.xaml.cs b/csharp/test/xamarin/controller/MainPage.xaml.cs index bb34df2be02..279c01a98f8 100644 --- a/csharp/test/xamarin/controller/MainPage.xaml.cs +++ b/csharp/test/xamarin/controller/MainPage.xaml.cs @@ -263,13 +263,13 @@ namespace controller return new Ice.optional.AMD.Server(); } - else if(type.Equals("Ice.packagemd.Client")) + else if(type.Equals("Ice.namespacemd.Client")) { - return new Ice.packagemd.Client(); + return new Ice.namespacemd.Client(); } - else if(type.Equals("Ice.packagemd.Server")) + else if(type.Equals("Ice.namespacemd.Server")) { - return new Ice.packagemd.Server(); + return new Ice.namespacemd.Server(); } else if(type.Equals("Ice.proxy.Client")) diff --git a/csharp/test/xamarin/controller/controller.csproj b/csharp/test/xamarin/controller/controller.csproj index 2a4684d6e5c..ffbd80f6f3e 100644 --- a/csharp/test/xamarin/controller/controller.csproj +++ b/csharp/test/xamarin/controller/controller.csproj @@ -76,7 +76,7 @@ <ProjectReference Include="..\..\Ice\objects\msbuild\test\netstandard2.0\test.csproj" /> <ProjectReference Include="..\..\Ice\operations\msbuild\test\netstandard2.0\test.csproj" /> <ProjectReference Include="..\..\Ice\optional\msbuild\test\netstandard2.0\test.csproj" /> - <ProjectReference Include="..\..\Ice\packagemd\msbuild\test\netstandard2.0\test.csproj" /> + <ProjectReference Include="..\..\Ice\namespacemd\msbuild\test\netstandard2.0\test.csproj" /> <ProjectReference Include="..\..\Ice\proxy\msbuild\test\netstandard2.0\test.csproj" /> <ProjectReference Include="..\..\Ice\retry\msbuild\test\netstandard2.0\test.csproj" /> <ProjectReference Include="..\..\Ice\scope\msbuild\test\netstandard2.0\test.csproj" /> |