[rfc][icedtea-web] immutbale transaltor
Omair Majid
omajid at redhat.com
Thu Sep 18 14:30:32 UTC 2014
* Jiri Vanek <jvanek at redhat.com> [2014-09-18 10:03]:
> Is it clarified?
Yes. I was missing quite a bit of background information. So, if I
understand you correctly, you want to be able to unit test Translator
(using another resource bundle), you dont want to mutate Translator by
supplying another resource. That basically forces us down to the path of
subclassing (which means ditching the enum-singleton approach).
In that case, your approach seems perfectly fine.
FWIW, if you want to test other code to see if it's using Translator
correctly (and don't want to pass Translator around), you will probably
need to replace the global shared instance of Translator with a testable
instance during unit tests.
Thanks,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
More information about the distro-pkg-dev
mailing list