/** * Verify the correct getLocale() behavior for the given service. * @param requestedLocale the locale to request. This MUST BE * FAKE. In other words, it should be something like * en_US_FAKEVARIANT so this method can verify correct fallback * behavior. * @param svc a factory object that can create the object to be * tested. * @param sub an object that can be used to retrieve a subobject * which should also be tested. May be null. * @param reg an object that supplies the registration and * unregistration functionality to be tested. May be null. */ internal void CheckService(String requestedLocale, IServiceFacade svc, ISubobject sub, IRegistrar reg) { UCultureInfo req = new UCultureInfo(requestedLocale); Object obj = svc.Create(req); CheckObject(requestedLocale, obj, "gt", "ge"); if (sub != null) { Object subobj = sub.Get(obj); CheckObject(requestedLocale, subobj, "gt", "ge"); } if (reg != null) { Logln("Info: Registering service"); Object key = reg.Register(req, obj); Object objReg = svc.Create(req); CheckObject(requestedLocale, objReg, "eq", "eq"); if (sub != null) { Object subobj = sub.Get(obj); // Assume subobjects don't come from services, so // their metadata should be structured normally. CheckObject(requestedLocale, subobj, "gt", "ge"); } Logln("Info: Unregistering service"); if (!reg.Unregister(key)) { Errln("FAIL: unregister failed"); } Object objUnreg = svc.Create(req); CheckObject(requestedLocale, objUnreg, "gt", "ge"); } }