Author: andrei_exadel
Date: 2008-12-11 11:49:08 -0500 (Thu, 11 Dec 2008)
New Revision: 11722
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/calendar/
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/calendar/resource_ru.properties
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_en_US.properties
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
Internationalization refactoring
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_en_US.properties
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_en_US.properties 2008-12-11
16:43:19 UTC (rev 11721)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_en_US.properties 2008-12-11
16:49:08 UTC (rev 11722)
@@ -2,9 +2,4 @@
error=Error was occured.
RICH_LIST_SHUTTLE_COPY_ALL_LABEL=Copy All Items
RICH_SHUTTLES_TOP_LABEL=Move to top
-RICH_CALENDAR_APPLY_LABEL = Apply_en_US
-RICH_CALENDAR_TODAY_LABEL = Today_en_US
-RICH_CALENDAR_CLOSE_LABEL = Close_en_US
-RICH_CALENDAR_OK_LABEL = OK_en_US
-RICH_CALENDAR_CLEAN_LABEL = Clean_en_US
-RICH_CALENDAR_CANCEL_LABEL = Cancel_en_US
+
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/calendar/resource_ru.properties
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/calendar/resource_ru.properties
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/richfaces/renderkit/calendar/resource_ru.properties 2008-12-11
16:49:08 UTC (rev 11722)
@@ -0,0 +1,6 @@
+RICH_CALENDAR_APPLY_LABEL = Apply_ru
+RICH_CALENDAR_TODAY_LABEL = Today_ru
+RICH_CALENDAR_CLOSE_LABEL = Close_ru
+RICH_CALENDAR_OK_LABEL = OK_ru
+RICH_CALENDAR_CLEAN_LABEL = Clean_ru
+RICH_CALENDAR_CANCEL_LABEL =Cancel_ru
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-11
16:43:19 UTC (rev 11721)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-11
16:49:08 UTC (rev 11722)
@@ -23,13 +23,16 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
+import java.util.List;
import java.util.Locale;
import org.ajax4jsf.bean.CalendarTestBean;
import org.ajax4jsf.template.Template;
import org.ajax4jsf.util.DateUtils;
+import org.apache.tools.ant.util.StringUtils;
import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -56,6 +59,18 @@
static final String availableDayCellClass = "rich-calendar-cell-size
rich-calendar-cell rich-calendar-btn";
static final String disabledDayCellClass = "rich-calendar-cell-size
rich-calendar-cell rich-calendar-boundary-dates";
+
+ static final List<String> WEEK_DAYS_RU = new ArrayList<String>();
+ static {
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+ WEEK_DAYS_RU.add("��");
+
+ }
String calendarId;
@@ -314,18 +329,36 @@
}
+ // Checks months label with ru locale
+ private void testWeekDays() {
+ String weekDaysLabelsId = calendarId + "WeekDay";
+ int l =
selenium.getXpathCount("//tr[(a)id='"+weekDaysLabelsId+"']/td").intValue();
+ List<String> weekDays = new ArrayList<String>();
+ for (int i = 1; i <= l; i++) {
+
weekDays.add(selenium.getText("//tr[@id='"+weekDaysLabelsId+"']/td["+i+"]"));
+ }
+
+ for (String weekday : WEEK_DAYS_RU) {
+ if (!weekDays.contains(weekday)) {
+ Assert.fail("Internationalization failed. Weekdays should contain
["+weekday+"] in case of RU locale. But was: " + weekDays.toArray());
+ }
+ }
+ }
+
@Test
public void testInternationalization(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
setPopup(true);
- setup();
+ String changeLocaleButtonId = getParentId() + CONTROLS_FORM_ID +
"testLocale";
+ clickCommandAndWait(changeLocaleButtonId);
showPopup();
showTimeSelectionWindow();
- testInternatialization("_en_US");
+ testInternatialization("_ru");
+ testWeekDays();
}
Show replies by date