Author: dmaliarevich
Date: 2010-01-25 10:14:10 -0500 (Mon, 25 Jan 2010)
New Revision: 19908
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.xhtml
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.jsp
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/JavaSource/demo/Messages.properties
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5218, JUnits were updated.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/JavaSource/demo/Messages.properties
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/JavaSource/demo/Messages.properties 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/JavaSource/demo/Messages.properties 2010-01-25
15:14:10 UTC (rev 19908)
@@ -1,3 +1,3 @@
-header=Hello!
-prompt_message=Name:
-hello_message=Hello
+header=Hello! (Default)
+prompt_message=Name: (Default)
+hello_message=Hello (Default)
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/WEB-INF/faces-config.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/WEB-INF/faces-config.xml 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/WEB-INF/faces-config.xml 2010-01-25
15:14:10 UTC (rev 19908)
@@ -11,6 +11,12 @@
</locale-config>
<message-bundle>messages_ru</message-bundle>
<message-bundle>messages_en</message-bundle>
- <message-bundle>messages_en_US</message-bundle>
+ <message-bundle>messages_en_US </message-bundle>
+
+ <resource-bundle>
+ <base-name>demo.Messages</base-name>
+ <var>Message</var>
+ </resource-bundle>
+
</application>
</faces-config>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2010-01-25
15:14:10 UTC (rev 19908)
@@ -13,5 +13,8 @@
<a href="pages/JBIDE/2550/jbide2550.jsf">Resource Test
Page</a><br>
<a href="pages/JBIDE/5352/jbide5352.jsf">Test Page with template name
resolving for default tags</a><br>
<a
href="pages/JBIDE/localization_versioning/resource-handling-1.jsf">Resource
localization and versioning</a><br>
+ <a href="pages/JBIDE/5218/localeAttribute.jsf">(Locale: 1) Test locale
attribute for f:view</a><br>
+ <a href="pages/JBIDE/5218/severalFViews.jsf">(Locale: 2) Test locale for
several f:views</a><br>
+ <a href="pages/JBIDE/5218/changeLocaleAndRefresh.jsf">(Locale: 3) Test
change locale and refresh</a><br>
</body>
</html>
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.jsp 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.jsp 2010-01-25
15:14:10 UTC (rev 19908)
@@ -1,17 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-<f:loadBundle var="Message" basename="demo.Messages"/>
-
-<html>
-<head>
-
-</head>
-
-<body>
-<f:view locale="de" id="fviewid">
-<div id="localeText">#{Message.hello_message}</div>
-</f:view>
-</body>
-
-</html>
Copied:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.xhtml
(from rev 19898,
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.jsp)
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/changeLocaleAndRefresh.xhtml 2010-01-25
15:14:10 UTC (rev 19908)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+<h:head>
+ <title>(Locale: 3) Test change locale and refresh</title>
+</h:head>
+<h:body>
+ <f:view locale="de" id="fviewid">
+ <div id="localeText">#{Message.hello_message}</div>
+ </f:view>
+</h:body>
+</html>
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.jsp 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.jsp 2010-01-25
15:14:10 UTC (rev 19908)
@@ -1,17 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-<f:loadBundle var="Message" basename="demo.Messages"/>
-
-<html>
-<head>
-
-</head>
-
-<body>
-<f:view locale="de">
-<div id="localeText">#{Message.hello_message}</div>
-</f:view>
-</body>
-
-</html>
Copied:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.xhtml
(from rev 19898,
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.jsp)
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/localeAttribute.xhtml 2010-01-25
15:14:10 UTC (rev 19908)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+<h:head>
+ <title>(Locale: 1) Test locale attribute for f:view</title>
+</h:head>
+<h:body>
+ <f:view locale="de">
+ <div id="localeText">#{Message.hello_message}</div>
+ </f:view>
+</h:body>
+</html>
\ No newline at end of file
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.jsp 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.jsp 2010-01-25
15:14:10 UTC (rev 19908)
@@ -1,23 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-<f:loadBundle var="Message" basename="demo.Messages"/>
-
-<html>
-<head>
-
-</head>
-
-<body>
-<f:view locale="de">
-<div id="localeText1">#{Message.hello_message}</div>
-</f:view>
-<f:view>
-<div id="localeText2">#{Message.hello_message}</div>
-</f:view>
-<f:view locale="en_US">
-<div id="localeText">#{Message.hello_message}</div>
-</f:view>
-</body>
-
-</html>
Copied:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.xhtml
(from rev 19898,
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.jsp)
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5218/severalFViews.xhtml 2010-01-25
15:14:10 UTC (rev 19908)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+<h:head>
+ <title>(Locale: 2) Test locale for several f:views</title>
+</h:head>
+<h:body>
+ <f:view locale="en">
+ <div id="localeText0">#{Message.hello_message}</div>
+ </f:view>
+ <f:view locale="de">
+ <div id="localeText1">#{Message.hello_message}</div>
+ </f:view>
+ <f:view>
+ <div id="localeText2">#{Message.hello_message}</div>
+ </f:view>
+ <f:view locale="en_GB">
+ <div id="localeText">#{Message.hello_message}</div>
+ </f:view>
+</h:body>
+</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-01-25
13:33:29 UTC (rev 19907)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-01-25
15:14:10 UTC (rev 19908)
@@ -27,18 +27,19 @@
public class TestFViewLocaleAttribute_JBIDE5218 extends VpeTest {
private static final String DEFAULT_LOCALE_PAGE = "defaultLocale.jsp";
//$NON-NLS-1$
- private static final String LOCALE_ATTRIBUTE_PAGE =
"JBIDE/5218/localeAttribute.jsp"; //$NON-NLS-1$
private static final String LOCALE_ATTRIBUTE_WITH_DEFAULT_LOCALE_PAGE =
"localeAndDefault.jsp"; //$NON-NLS-1$
- private static final String SEVERAL_FVIEWS_PAGE =
"JBIDE/5218/severalFViews.jsp"; //$NON-NLS-1$
- private static final String CHANGE_LOCALE_AND_REFRESH_PAGE =
"JBIDE/5218/changeLocaleAndRefresh.jsp"; //$NON-NLS-1$
+ private static final String LOCALE_ATTRIBUTE_PAGE =
"JBIDE/5218/localeAttribute.xhtml"; //$NON-NLS-1$
+ private static final String SEVERAL_FVIEWS_PAGE =
"JBIDE/5218/severalFViews.xhtml"; //$NON-NLS-1$
+ private static final String CHANGE_LOCALE_AND_REFRESH_PAGE =
"JBIDE/5218/changeLocaleAndRefresh.xhtml"; //$NON-NLS-1$
private static final String HELLO_DE = "Guten Tag!"; //$NON-NLS-1$
private static final String HELLO2_DE = "German Hello"; //$NON-NLS-1$
- private static final String HELLO_EN = "Hello"; //$NON-NLS-1$
+ private static final String HELLO_EN = "Hello (Default)"; //$NON-NLS-1$
private static final String HELLO_EN_US = "US Hello"; //$NON-NLS-1$
private static final String HELLO_EN_GB = "Great Britain Hello";
//$NON-NLS-1$
private static final String LOCALE_TEXT_ID = "localeText"; //$NON-NLS-1$
+ private static final String LOCALE_TEXT0_ID = "localeText0"; //$NON-NLS-1$
private static final String LOCALE_TEXT1_ID = "localeText1"; //$NON-NLS-1$
private static final String LOCALE_TEXT2_ID = "localeText2"; //$NON-NLS-1$
private static final String FVIEW_ID = "fviewid"; //$NON-NLS-1$
@@ -60,42 +61,43 @@
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
Deutch", HELLO_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
closeEditors();
}
+
/**
- * f:view has a locale attribute defined,
- * which should be applied.
- * Default locale is empty in this case.
+ * The default locale is defined,
+ * f:view has a locale attribute defined also,
+ * The default locale in this case should take an advantage.
*
* @throws Throwable
*/
- public void testLocaleAttribute() throws Throwable {
+ public void testLocaleAttributeWithDefaultLocale() throws Throwable {
VpeController controller = openInVpe(
- JsfAllTests.IMPORT_JSF_20_PROJECT_NAME, LOCALE_ATTRIBUTE_PAGE);
+ JsfAllTests.IMPORT_I18N_PROJECT_NAME,
+ LOCALE_ATTRIBUTE_WITH_DEFAULT_LOCALE_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be should be
in German", HELLO2_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
closeEditors();
}
/**
- * The default locale is defined,
- * f:view has a locale attribute defined also,
- * The default locale in this case should take an advantage.
+ * f:view has a locale attribute defined,
+ * which should be applied.
+ * Default locale is empty in this case.
*
* @throws Throwable
*/
- public void testLocaleAttributeWithDefaultLocale() throws Throwable {
+ public void testLocaleAttribute() throws Throwable {
VpeController controller = openInVpe(
- JsfAllTests.IMPORT_I18N_PROJECT_NAME,
- LOCALE_ATTRIBUTE_WITH_DEFAULT_LOCALE_PAGE);
+ JsfAllTests.IMPORT_JSF_20_PROJECT_NAME, LOCALE_ATTRIBUTE_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
Deutch", HELLO_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be should be
in 'de' locale", HELLO_EN_US.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
closeEditors();
}
@@ -110,17 +112,23 @@
VpeController controller = openInVpe(
JsfAllTests.IMPORT_JSF_20_PROJECT_NAME, SEVERAL_FVIEWS_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
- nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT1_ID);
+
+ nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT0_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO2_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
+
+ localeText = doc.getElementById(LOCALE_TEXT1_ID);
+ localizedText = getLocalizedText(localeText);
+ assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT2_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
default locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
default locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
'en_US' locale", HELLO_EN_US.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'en_US' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
+
closeEditors();
}
@@ -138,7 +146,7 @@
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in
German", HELLO2_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'de' locale", HELLO2_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
/*
* Change the locale
*/
@@ -156,7 +164,7 @@
/*
* Check the new localized message.
*/
- assertTrue("Text is '"+localizedText+"', but should be in
en_GB", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in
'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$
//$NON-NLS-2$
closeEditors();
}