Monday, August 30, 2010

Re: Handling too many locales in a large scale real life app

just in case...

after trying the EPFE plugin that Dolber posted (btw, thanks for the
tip) I found out that the project was "put on ice"
(source: http://epfe.sourceforge.net/index.php?option=com_content&view=section&layout=blog&id=1&Itemid=3)

their own authors point out to another plugin, Eclipse ResourceBundle
Editor, which can be found here:
http://sourceforge.net/projects/eclipse-rbe/
this plugin is more complete than EPFE, and we're considering using
it, even tho it has been incorporated by Eclipse Babel project
http://www.eclipse.org/babel/

Babel promised an editor, but so far has not delivered it

On 29 ago, 19:48, Joe Cole <profilercorporat...@gmail.com> wrote:
> What we do is have a test case that ensures that our interface and
> properties files are completely defined:
>
> // call this method for each properties file
> public void checkMessagesDefinedProperlyInBothInterfaceAndFile(String
> file) {
>                 Properties f2 = new Properties();
>                 FileInputStream in = null;
>                 try {
>                         in = new FileInputStream(file);
>                         f2.load(in);
>                 } catch (Exception e) {
>                         e.printStackTrace();
>                         Assert.fail(e.getMessage());
>                 } finally {
>                         IO.safelyClose(in);
>                 }
>                 Assert.assertNotNull(f2);
>                 // check methods -> properties
>                 for (Method m : YouMessagesClass.class.getDeclaredMethods()) {
>                         Assert.assertTrue(m.getName() + " shoud not be empty",
> Is.entered(f2.getProperty(m.getName())));
>                         if (m.getParameterTypes().length > 0) {
>                                 Assert.assertTrue(m.getName() + " should contain {",
> f2.getProperty(m.getName()).indexOf('{') > -1);
>                                 Assert.assertTrue(m.getName() + " should contain {",
> f2.getProperty(m.getName()).indexOf('}') > -1);
>                         }
>                 }
>                 // check properties -> methods
>                 for (Object key : f2.keySet()) {
>                         String property = f2.getProperty((String) key);
>                         if (property.indexOf('}') == -1)
>                                 continue;
>                         for (Method m : YourMessagesClass.class.getDeclaredMethods()) {
>                                 if (m.getName().equals(key)) {
>                                         Assert.assertTrue(key + " should have at least 1 parameter",
> m.getParameterTypes().length > 0);
>                                         break;
>                                 }
>                         }
>                 }
>         }
>
> What we do is have critical tests like this run on save, in
> our .project file we have :
>
> <buildCommand>
>         <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
>         <triggers>auto,full,incremental,</triggers>
>         <arguments>
>                 <dictionary>
>                         <key>LaunchConfigHandle</key>
>                         <value>&lt;project&gt;/Autobuild.launch</value>
>                 </dictionary>
>         </arguments>
> </buildCommand>
>
> This ensures that we don't have to remember to add keys, servlet
> definitions in web.xml etc - all the critical things that can go
> wrong, but are easy to forget.
>
> Joe

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment