Ejemplo n.º 1
0
 @Test
 public void testAddLocale() throws Exception {
   Project project = initializeJavaProject();
   Shell shell = getShell();
   shell.execute("i18n setup");
   shell.execute("i18n put --key mykey --value myvalue");
   shell.execute("i18n add-locale --locale pt_BR");
   shell.execute("i18n put --key mykey --value meuvalor");
   ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
   PropertiesFileResource resource =
       (PropertiesFileResource) resourceFacet.getResource("messages.properties");
   PropertiesFileResource resource_ptBR =
       (PropertiesFileResource) resourceFacet.getResource("messages_pt_BR.properties");
   assertTrue(resource.exists());
   assertTrue(resource_ptBR.exists());
   assertEquals("myvalue", resource.getProperty("mykey"));
   assertEquals("meuvalor", resource_ptBR.getProperty("mykey"));
 }
Ejemplo n.º 2
0
 @Test
 public void testSetup() throws Exception {
   Project project = initializeJavaProject();
   Shell shell = getShell();
   shell.execute("i18n setup");
   PropertiesFileResource resource =
       (PropertiesFileResource)
           project.getFacet(ResourceFacet.class).getResource("messages.properties");
   assertTrue(resource.exists());
 }