JBoss Rich Faces SVN: r15459 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/org/jboss/richfaces/integrationTest/log and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 16:19:17 -0400 (Thu, 03 Sep 2009)
New Revision: 15459
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/messages.properties
Log:
- refactored Log test cases to follow conventions
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java 2009-09-03 19:23:31 UTC (rev 15458)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/log/LogTestCase.java 2009-09-03 20:19:17 UTC (rev 15459)
@@ -1,12 +1,33 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this test suite; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.jboss.richfaces.integrationTest.log;
-import junit.framework.Assert;
+import static org.testng.Assert.*;
import org.apache.commons.lang.StringUtils;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.waiting.Condition;
import org.jboss.test.selenium.waiting.Wait;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -14,43 +35,41 @@
* @version $Revision$
*/
public class LogTestCase extends AbstractSeleniumRichfacesTestCase {
+
+ private final String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
+ private final String LOC_INPUT_TEXT = getLoc("INPUT_TEXT");
+ private final String LOC_BUTTON_CLEAR = getLoc("BUTTON_CLEAR");
+ private final String LOC_OUTPUT_LOG_CONSOLE = getLoc("OUTPUT_LOG_CONSOLE");
+ private final String LOC_DIV_LOG_CONSOLE_ENTRY = getLoc("DIV_LOG_CONSOLE_ENTRY");
+
+ private final String MSG_INPUT_SAMPLE = getMsg("INPUT_SAMPLE");
+ private final String MSG_OUTPUT_DEBUG = getMsg("OUTPUT_DEBUG");
+ private final String MSG_OUTPUT_CLEAR = getMsg("OUTPUT_CLEAR");
+
/**
- * Opens specified page
+ * Force event and wait for log contain specified text
*/
- private void openPage() {
- selenium.open(contextPath + "/richfaces/log.jsf?c=log&tab=usage");
- scrollIntoView(header, true);
- }
-
- private String header = getLoc("log--header");
- private String inputText = getLoc("log--input--text");
- private String buttonClear = getLoc("log--button--clear");
- private String outputText = getLoc("log--output--text");
- private String outputDivs = getLoc("log--output--divs");
- private String messageSample = getMess("log--input--sample");
- private String messageDebug = getMess("log--output--debug");
- private String messageClear = getMess("log--output--clear");
-
@Test
public void testFillLog() {
- openPage();
-
fillLog();
}
+ /**
+ * Force event, wait for log contain specified text and log entries count
+ * stabilizes and then tries to clear the log
+ */
@Test
public void testClearLog() {
- openPage();
-
fillLog();
waitForLogStabilize();
clearLog();
}
+ /**
+ * Try fill the log and next clear and checks right behaviour
+ */
@Test
public void testRepeatingFillAndClear() {
- openPage();
-
fillLog();
waitForLogStabilize();
clearLog();
@@ -60,45 +79,56 @@
clearLog();
}
- public void waitForLogStabilize() {
- Wait.interval(3000).timeout(9000).until(new Condition() {
- long count = -1;
+ private void fillLog() {
+ final long startCount = selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue();
+ selenium.type(LOC_INPUT_TEXT, MSG_INPUT_SAMPLE);
+ selenium.fireEvent(LOC_INPUT_TEXT, Event.KEYUP);
+
+ Wait.failWith("Count of log entries never increase").until(new Condition() {
public boolean isTrue() {
- long actual = selenium.getXpathCount(outputDivs).longValue();
- if (actual == count) {
- return true;
- }
- count = actual;
- return false;
+ return selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue() > startCount;
}
});
+
+ String consoleText = selenium.getText(LOC_OUTPUT_LOG_CONSOLE);
+
+ assertTrue(consoleText.contains(MSG_OUTPUT_DEBUG), format("Console text should contain word '{0}'",
+ MSG_OUTPUT_DEBUG));
}
- public void fillLog() {
- final long startCount = selenium.getXpathCount(outputDivs).longValue();
+ private void clearLog() {
+ selenium.click(LOC_BUTTON_CLEAR);
- selenium.type(inputText, messageSample);
- selenium.fireEvent(inputText, Event.KEYUP);
-
- Wait.until(new Condition() {
+ Wait.failWith("Text of the console never get without entries (clear button only)").until(new Condition() {
public boolean isTrue() {
- return selenium.getXpathCount(outputDivs).longValue() > startCount;
+ String consoleText = selenium.getText(LOC_OUTPUT_LOG_CONSOLE);
+ return MSG_OUTPUT_CLEAR.equals(StringUtils.trim(consoleText));
}
});
+ }
- String output = selenium.getText(outputText);
- Assert.assertTrue(output.contains(messageDebug));
+ private void waitForLogStabilize() {
+ Wait.failWith("Log stabilized in entry count in given time").interval(3000).timeout(9000).until(
+ new Condition() {
+ long count = -1;
+
+ public boolean isTrue() {
+ long actual = selenium.getXpathCount(LOC_DIV_LOG_CONSOLE_ENTRY).longValue();
+ if (actual == count) {
+ return true;
+ }
+ count = actual;
+ return false;
+ }
+ });
}
- public void clearLog() {
- selenium.click(buttonClear);
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Log");
- Wait.until(new Condition() {
- public boolean isTrue() {
- String output = selenium.getText(outputText);
- return messageClear.equals(StringUtils.trim(output));
- }
- });
+ scrollIntoView(LOC_FIELDSET_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties 2009-09-03 19:23:31 UTC (rev 15458)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/locators.properties 2009-09-03 20:19:17 UTC (rev 15459)
@@ -1,5 +1,5 @@
-log--header=//legend[text()\='Log demo']
-log--input--text=//input[@type\='text']
-log--button--clear=//button[text()\='Clear']
-log--output--text //div[@id\='logConsole']
-log--output--divs=//div[@id\='logConsole']/div
+FIELDSET_HEADER=//legend[text()\='Log demo']
+INPUT_TEXT=//input[@type\='text']
+BUTTON_CLEAR=//button[text()\='Clear']
+OUTPUT_LOG_CONSOLE //div[@id\='logConsole']
+DIV_LOG_CONSOLE_ENTRY=//div[@id\='logConsole']/div
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/messages.properties 2009-09-03 19:23:31 UTC (rev 15458)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/log/messages.properties 2009-09-03 20:19:17 UTC (rev 15459)
@@ -1,3 +1,3 @@
-log--input--sample=abc
-log--output--debug=debug
-log--output--clear=Clear
+INPUT_SAMPLE=abc
+OUTPUT_DEBUG=debug
+OUTPUT_CLEAR=Clear
15 years, 3 months
JBoss Rich Faces SVN: r15458 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/org/jboss/richfaces/integrationTest/outputPanel and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 15:23:31 -0400 (Thu, 03 Sep 2009)
New Revision: 15458
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties
Log:
- refactored Output Panel test cases to follow conventions
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java 2009-09-03 19:09:36 UTC (rev 15457)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/outputPanel/OutputPanelTestCase.java 2009-09-03 19:23:31 UTC (rev 15458)
@@ -1,10 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this test suite; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.jboss.richfaces.integrationTest.outputPanel;
-import junit.framework.Assert;
+import static org.testng.Assert.*;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.waiting.Condition;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -12,72 +33,80 @@
* @version $Revision$
*/
public class OutputPanelTestCase extends AbstractSeleniumRichfacesTestCase {
- /**
- * Opens specified page
- */
- public void openPage() {
- selenium.open(contextPath
- + "/richfaces/outputPanel.jsf?c=outputPanel&tab=usage");
- scrollIntoView(header, true);
- }
- private String header = getLoc("output-panel--header");
- private String inputFail = getLoc("output-panel--input--fail");
- private String inputSuccess = getLoc("output-panel--input--success");
- private String textCorrect = getMess("output-panel--input--correct");
- private String textWrong = getMess("output-panel--input--wrong");
- private String textValidationError = getMess("output-panel--output--validation-error");
- private String formatMessage = getLoc("output-panel--output--message");
+ private String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
+ private String LOC_INPUT_WRONG = getLoc("INPUT_WRONG");
+ private String LOC_INPUT_CORRECT = getLoc("INPUT_CORRECT");
+ private String LOC_OUTPUT_MESSAGE = getLoc("OUTPUT_MESSAGE");
- Condition isApprovedTextPresent = new Condition() {
- public boolean isTrue() {
- return true;
- }
- };
+ private String MSG_INPUT_CORRECT = getMsg("INPUT_CORRECT");
+ private String MSG_INPUT_WRONG = getMsg("INPUT_WRONG");
+ private String MSG_OUTPUT_VALIDATOR_ERROR = getMsg("OUTPUT_VALIDATOR_ERROR");
+ /**
+ * Add correct text into wrong input, checks that no text and no error
+ * message appear.
+ */
@Test
- public void correctTextIntoFailInputTest() {
- textIntoInput(inputFail, textCorrect, false, false);
+ public void testCorrectTextIntoWrongInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG, MSG_INPUT_CORRECT, false, false);
}
+ /**
+ * Enter wrong text into wrong input, checks that no text and no error
+ * message appear.
+ */
@Test
- public void wrongTextIntoFailInputTest() {
- textIntoInput(inputFail, textWrong, false, false);
+ public void testWrongTextIntoWrongInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_WRONG, MSG_INPUT_WRONG, false, false);
}
+ /**
+ * Enter correct text into correct input, checks that text but no error
+ * message appear.
+ */
@Test
- public void correctTextIntoSuccessInputTest() {
- textIntoInput(inputSuccess, textCorrect, true, false);
+ public void testCorrectTextIntoSuccessInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT, MSG_INPUT_CORRECT, true, false);
}
+ /**
+ * Enter wrong text into correct input, checks that no text but only error
+ * message appear.
+ */
@Test
- public void wrongTextIntoSuccessInputTest() {
- textIntoInput(inputSuccess, textWrong, false, true);
+ public void testWrongTextIntoSuccessInput() {
+ enterTextAndCheckOutputAndErrorMessage(LOC_INPUT_CORRECT, MSG_INPUT_WRONG, false, true);
}
- public void textIntoInput(String input, final String text,
- final boolean textAppears, final boolean errorAppears) {
- openPage();
+ private void enterTextAndCheckOutputAndErrorMessage(String locInput, final String msgText,
+ final boolean textShouldAppear, final boolean errorMessageShouldAppear) {
+ selenium.type(locInput, msgText);
+ selenium.fireEvent(locInput, Event.KEYUP);
- selenium.type(input, text);
- selenium.fireEvent(input, Event.KEYUP);
-
waitModelUpdate.dontFail().until(new Condition() {
public boolean isTrue() {
- if (errorAppears || textAppears) {
- return selenium.getXpathCount(format(formatMessage, text))
- .intValue() > 0
- || selenium.getXpathCount(
- format(formatMessage, textValidationError))
+ if (errorMessageShouldAppear || textShouldAppear) {
+ return selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, msgText)).intValue() > 0
+ || selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, MSG_OUTPUT_VALIDATOR_ERROR))
.intValue() > 0;
}
return false;
}
});
- Assert.assertEquals(textAppears ? 1 : 0, selenium.getXpathCount(format(
- formatMessage, text)));
- Assert.assertEquals(errorAppears ? 1 : 0, selenium
- .getXpathCount(format(formatMessage, textValidationError)));
+ assertEquals(selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, msgText)), textShouldAppear ? 1 : 0,
+ textShouldAppear ? "Text output should appear" : "No text output should appear");
+ assertEquals(selenium.getXpathCount(format(LOC_OUTPUT_MESSAGE, MSG_OUTPUT_VALIDATOR_ERROR)),
+ errorMessageShouldAppear ? 1 : 0, errorMessageShouldAppear ? "Error message should appear"
+ : "No error message should appear");
}
+
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Output Panel");
+
+ scrollIntoView(LOC_FIELDSET_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties 2009-09-03 19:09:36 UTC (rev 15457)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/locators.properties 2009-09-03 19:23:31 UTC (rev 15458)
@@ -1,4 +1,4 @@
-output-panel--header=//legend[text()\='OutputPanel example']
-output-panel--input--fail=//input[@type\='text' and contains(@id,'text1')]
-output-panel--input--success=//input[@type\='text' and contains(@id,'text2')]
-output-panel--output--message=//*[contains(text(),'{0}')]
+FIELDSET_HEADER=//legend[text()\='OutputPanel example']
+INPUT_WRONG=//input[@type\='text' and contains(@id,'text1')]
+INPUT_CORRECT=//input[@type\='text' and contains(@id,'text2')]
+OUTPUT_MESSAGE=//*[contains(text(),'{0}')]
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties 2009-09-03 19:09:36 UTC (rev 15457)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/outputPanel/messages.properties 2009-09-03 19:23:31 UTC (rev 15458)
@@ -1,3 +1,3 @@
-output-panel--input--correct=1234567890
-output-panel--input--wrong=12345678901
-output-panel--output--validation-error=Validation Error
+INPUT_CORRECT=1234567890
+INPUT_WRONG=12345678901
+OUTPUT_VALIDATOR_ERROR=Validation Error
15 years, 3 months
JBoss Rich Faces SVN: r15457 - in root: framework/trunk/impl/src/test/java/org/richfaces/resource and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-09-03 15:09:36 -0400 (Thu, 03 Sep 2009)
New Revision: 15457
Added:
root/framework/trunk/impl/src/test/resources/resources/
root/framework/trunk/impl/src/test/resources/resources/defaultResourceHandlerResource.js
root/framework/trunk/impl/src/test/resources/resources/org.richfaces.resource.test/
root/framework/trunk/impl/src/test/resources/resources/org.richfaces.resource.test/libraryResource.js
Removed:
root/framework/trunk/impl/src/test/resources/META-INF/resources/
Modified:
root/examples/trunk/components/pom.xml
root/framework/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
Log:
Fixed:
- modules set
- unit test updated to comply with the changes in JSF spec.
Modified: root/examples/trunk/components/pom.xml
===================================================================
--- root/examples/trunk/components/pom.xml 2009-09-03 18:47:20 UTC (rev 15456)
+++ root/examples/trunk/components/pom.xml 2009-09-03 19:09:36 UTC (rev 15457)
@@ -18,9 +18,9 @@
<modules>
<module>core-demo</module>
- <module>calendar-demo</module>
+ <!--module>calendar-demo</module>
<module>panel-demo</module>
- <module>tree-demo</module>
+ <module>tree-demo</module-->
</modules>
<dependencyManagement>
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2009-09-03 18:47:20 UTC (rev 15456)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2009-09-03 19:09:36 UTC (rev 15457)
@@ -21,6 +21,7 @@
package org.richfaces.resource;
+import java.io.File;
import java.net.URL;
import java.util.Calendar;
import java.util.Date;
@@ -66,10 +67,23 @@
private LocalWebClient webClient;
+ private static final String RESOURCES_FOLDER_PATH = "resources/";
+ private static final String TEST_RESOURCE_NAME = RESOURCES_FOLDER_PATH +
+ "defaultResourceHandlerResource.js";
+
+
+ private void addClasspathResources() {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ File testResourceFile = new File(classLoader.getResource(TEST_RESOURCE_NAME).getFile());
+ File testResourceFolder = testResourceFile.getParentFile();
+ facesServer.addResourcesFromDirectory("/" + RESOURCES_FOLDER_PATH, testResourceFolder);
+ }
+
@Override
public void setUp() throws Exception {
super.setUp();
+ addClasspathResources();
webClient = new LocalWebClient(this.facesServer);
//quick fix for https://sourceforge.net/tracker/?func=detail&aid=2821888&group_id=47038&a...
webClient.setRedirectEnabled(false);
Added: root/framework/trunk/impl/src/test/resources/resources/defaultResourceHandlerResource.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/resources/defaultResourceHandlerResource.js (rev 0)
+++ root/framework/trunk/impl/src/test/resources/resources/defaultResourceHandlerResource.js 2009-09-03 19:09:36 UTC (rev 15457)
@@ -0,0 +1 @@
+/* that is a dependency of org.richfaces.resource.ResourceHandlerImplTest */
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/resources/org.richfaces.resource.test/libraryResource.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/resources/org.richfaces.resource.test/libraryResource.js (rev 0)
+++ root/framework/trunk/impl/src/test/resources/resources/org.richfaces.resource.test/libraryResource.js 2009-09-03 19:09:36 UTC (rev 15457)
@@ -0,0 +1 @@
+/* that is a dependency of org.richfaces.resource.ResourceHandlerImplTest */
\ No newline at end of file
15 years, 3 months
JBoss Rich Faces SVN: r15456 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/org/jboss/richfaces/integrationTest/mediaOutput and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 14:47:20 -0400 (Thu, 03 Sep 2009)
New Revision: 15456
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/mediaOutput/MediaOutputTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/messages.properties
Log:
- refactored Media Output test cases to follow conventions
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/mediaOutput/MediaOutputTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/mediaOutput/MediaOutputTestCase.java 2009-09-03 18:44:08 UTC (rev 15455)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/mediaOutput/MediaOutputTestCase.java 2009-09-03 18:47:20 UTC (rev 15456)
@@ -1,13 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this test suite; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.jboss.richfaces.integrationTest.mediaOutput;
import java.io.IOException;
-import java.security.NoSuchAlgorithmException;
-import junit.framework.Assert;
+import static org.testng.Assert.*;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.utils.URLUtils;
-import org.jboss.test.selenium.waiting.Wait;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -15,49 +34,61 @@
* @version $Revision$
*/
public class MediaOutputTestCase extends AbstractSeleniumRichfacesTestCase {
- /**
- * Opens specified page
- */
- public void openPage() {
- selenium.open(format("{0}/{1}", contextPath, PAGE));
- scrollIntoView(header, true);
- }
- private final String PAGE = "richfaces/mediaOutput.jsf?c=mediaOutput&tab=usage";
+ private String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
+ private String LOC_ATTRIBUTE_IMAGE_SRC = getLoc("ATTRIBUTE_IMAGE_SRC");
+ private String LOC_ATTRIBUTE_FLASH_HREF = getLoc("ATTRIBUTE_FLASH_HREF");
- private String header = getLoc("media-output--header");
+ private String MSG_MD5DIGEST_IMAGE = getMsg("MD5DIGEST_IMAGE");
+ private String MSG_MD5DIGEST_FLASH = getMsg("MD5DIGEST_FLASH");
+ /**
+ * Gets a image's source URL and obtains it's MD5 digest - checks that the
+ * digest is same as expected.
+ */
@Test
- public void imageMd5DigestTest() throws IOException,
- NoSuchAlgorithmException {
- openPage();
+ public void testImageMd5Digest() {
+ String imageSrc = selenium.getAttribute(LOC_ATTRIBUTE_IMAGE_SRC);
- waitForElement(getLoc("media-output--attribute--image-src"), Wait.DEFAULT_TIMEOUT);
-
- String imageSrc = selenium
- .getAttribute(getLoc("media-output--attribute--image-src"));
+ try {
+ String url = URLUtils.buildUrl(selenium.getLocation(), imageSrc);
- String url = URLUtils
- .buildUrl(contextRoot, contextPath, PAGE, imageSrc);
-
- Assert.assertEquals(getMess("media-output--md5-digest--image"),
- URLUtils.resourceMd5Digest(url));
+ try {
+ assertEquals(URLUtils.resourceMd5Digest(url), MSG_MD5DIGEST_IMAGE);
+ } catch (IOException e) {
+ fail("Getting resources from URL failed");
+ }
+ } catch (IOException e) {
+ fail(format("Building of URL failed: '{0}', '{1}'", selenium.getLocation(), imageSrc));
+ }
}
+ /**
+ * Gets a flash object's data URL and obtains it's MD5 digest - checks that
+ * the digest is same as expected.
+ */
@Test
- public void flashMd5DigestTest() throws IOException,
- NoSuchAlgorithmException {
- openPage();
+ public void testFlashMd5Digest() {
+ String flashHref = selenium.getAttribute(LOC_ATTRIBUTE_FLASH_HREF);
- waitForElement(getLoc("media-output--attribute--flash-object-data"), Wait.DEFAULT_TIMEOUT);
-
- String flashData = selenium
- .getAttribute(getLoc("media-output--attribute--flash-object-data"));
+ try {
+ String url = URLUtils.buildUrl(selenium.getLocation(), flashHref);
- String url = URLUtils.buildUrl(contextRoot, contextPath, PAGE,
- flashData);
+ try {
+ assertEquals(URLUtils.resourceMd5Digest(url), MSG_MD5DIGEST_FLASH);
+ } catch (IOException e) {
+ fail("Getting resources from URL failed");
+ }
+ } catch (IOException e) {
+ fail(format("Building of URL failed: '{0}', '{1}'", selenium.getLocation(), flashHref));
+ }
+ }
- Assert.assertEquals(getMess("media-output--md5-digest--flash"),
- URLUtils.resourceMd5Digest(url));
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Media Output");
+
+ scrollIntoView(LOC_FIELDSET_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties 2009-09-03 18:44:08 UTC (rev 15455)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/locators.properties 2009-09-03 18:47:20 UTC (rev 15456)
@@ -1,3 +1,3 @@
-media-output--header=//legend[text()\='MediaOutput example']
-media-output--attribute--flash-object-data=//a[@id\='swfLink']/@href
-media-output--attribute--image-src=//p[text()\='Dynamically generated JPEG file\:']/../img/@src
+FIELDSET_HEADER=//legend[text()\='MediaOutput example']
+ATTRIBUTE_FLASH_HREF=//a[@id\='swfLink']/@href
+ATTRIBUTE_IMAGE_SRC=//p[text()\='Dynamically generated JPEG file\:']/../img/@src
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/messages.properties 2009-09-03 18:44:08 UTC (rev 15455)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/mediaOutput/messages.properties 2009-09-03 18:47:20 UTC (rev 15456)
@@ -1,2 +1,2 @@
-media-output--md5-digest--flash=b979402c1c6aeba2a32821ce666621
-media-output--md5-digest--image=1fbdf5da30f854b9bdb797ed6b30393d
+MD5DIGEST_IMAGE=1fbdf5da30f854b9bdb797ed6b30393d
+MD5DIGEST_FLASH=b979402c1c6aeba2a32821ce666621
15 years, 3 months
JBoss Rich Faces SVN: r15455 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest: separator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 14:44:08 -0400 (Thu, 03 Sep 2009)
New Revision: 15455
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/separator/SeparatorTestCase.java
Log:
- follow changes to selenium-lib - removed unnecessary throws NoSuchAlghoritmException declaration
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-03 18:29:20 UTC (rev 15454)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-03 18:44:08 UTC (rev 15455)
@@ -259,9 +259,6 @@
try {
tmp = URLUtils.resourceMd5Digest(tmp);
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- fail(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/separator/SeparatorTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/separator/SeparatorTestCase.java 2009-09-03 18:29:20 UTC (rev 15454)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/separator/SeparatorTestCase.java 2009-09-03 18:44:08 UTC (rev 15455)
@@ -155,9 +155,6 @@
try {
tmp = URLUtils.resourceMd5Digest(url);
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- fail(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
15 years, 3 months
JBoss Rich Faces SVN: r15454 - branches/community/3.3.X/test-applications/selenium-testing-lib/src/main/java/org/jboss/test/selenium/utils.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 14:29:20 -0400 (Thu, 03 Sep 2009)
New Revision: 15454
Modified:
branches/community/3.3.X/test-applications/selenium-testing-lib/src/main/java/org/jboss/test/selenium/utils/URLUtils.java
Log:
- removed unnecessary throws NoSuchAlghoritmException declaration
Modified: branches/community/3.3.X/test-applications/selenium-testing-lib/src/main/java/org/jboss/test/selenium/utils/URLUtils.java
===================================================================
--- branches/community/3.3.X/test-applications/selenium-testing-lib/src/main/java/org/jboss/test/selenium/utils/URLUtils.java 2009-09-03 17:36:22 UTC (rev 15453)
+++ branches/community/3.3.X/test-applications/selenium-testing-lib/src/main/java/org/jboss/test/selenium/utils/URLUtils.java 2009-09-03 18:29:20 UTC (rev 15454)
@@ -64,8 +64,7 @@
* @return MD5 message digest of resource
* @throws IOException when connection to URL fails
*/
- public static String resourceMd5Digest(String url) throws IOException,
- NoSuchAlgorithmException {
+ public static String resourceMd5Digest(String url) throws IOException {
URLConnection connection = new URL(url).openConnection();
InputStream in = connection.getInputStream();
15 years, 3 months
JBoss Rich Faces SVN: r15453 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-03 13:36:22 -0400 (Thu, 03 Sep 2009)
New Revision: 15453
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_message.xml
Log:
RF-7756: Rich Miscellaneous component group description review --> rich:message
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_message.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_message.xml 2009-09-03 15:33:27 UTC (rev 15452)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_message.xml 2009-09-03 17:36:22 UTC (rev 15453)
@@ -17,121 +17,104 @@
</imageobject>
</mediaobject>
</figure>
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem>
- <para>Highly customizable look and feel </para>
- </listitem>
- <listitem>
- <para>Tracking both traditional and Ajax based requests</para>
- </listitem>
- <listitem>
- <para>Optional toolTip to display the detail portion of the message</para>
- </listitem>
- <listitem>
- <para>Additionally customizable with attributes and facets</para>
- </listitem>
- <listitem>
- <para>Additionally provides two parts to be optionally defined: marker and
- label</para>
- </listitem>
- </itemizedlist>
- </section>
- <section>
+ </section>
+
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>
+ <para>Consists of two parts to be defined optionally: marker (pictogram) and label (text message)</para>
+ </listitem>
+ <listitem>
+ <para>Provides set of facets for marker customization</para>
+ </listitem>
+ <listitem>
+ <para>Supports tooltip to display extra portion of message</para>
+ </listitem>
+ <listitem>
+ <para>Tracks both traditional and Ajax requests</para>
+ </listitem>
+ <listitem>
+ <para>Customizable look and feel </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
<title>Details of Usage</title>
- <para> The component has the same behavior as standard <emphasis role="bold">
- <property><h:message></property>
- </emphasis>component except next two features: <itemizedlist>
- <listitem>
- <para>It's ajaxRendered. It means that the component is reRendered after Ajax request
- automatically without outputPanel usage</para>
+ <para>
+ The component has the same behavior as standard <emphasis role="bold"><property><h:message></property></emphasis> component.
+ Besides some extra features:
+ <itemizedlist>
+ <listitem>
+ <para>auto rerendering after Ajax request without help of <emphasis role="bold"><property><h:outputPanel></property></emphasis>;</para>
+ </listitem>
+ <listitem>
+ <para>providing <code>passed</code> message after validation has been passed (optional);</para>
</listitem>
<listitem>
- <para>The component optionally provides "passed" state which will be shown if no message is displayed</para>
+ <para>possibility to add marker to a message.</para>
</listitem>
- <listitem>
- <para>Provides possibility to add some marker to message. By default a marker element
- isn't shown</para>
- </listitem>
</itemizedlist>
</para>
-
-
-
- <para> The following example shows different variants for component customization. The
- attribute <emphasis>
- <property>"passedLabel"</property>
- </emphasis> is used for definition of the label to display when no message
- appears. But the message component doesn't appear before the form submission even when
- state is defined as passed (on initial rendering). Boolean attribute<emphasis>
- <property> "showSummary" </property>
- </emphasis>defines possibility to
- display summary portion of displayed messages. The facets <emphasis>
- <property>"errorMarker"</property>
- </emphasis> and <emphasis>
- <property>"passedMarker"</property>
- </emphasis> set
- corresponding images for markers. </para>
-
<para>
- <emphasis role="bold">Example:</emphasis>
+ The <emphasis role="bold"><property><rich:message></property></emphasis> appears on page after form is submitted.
+ Even for "passed" state.
+ The <emphasis><property>"passedLabel"</property></emphasis> attribute is used for definition of the label when validation is passed.
+ Boolean attribute<emphasis><property> "showSummary" </property></emphasis>defines possibility to display summary portion of displayed messages.
</para>
- <programlisting role="XML">...
-<rich:message for="id" passedLabel="No errors" showSummary="true">
+
+ <programlisting role="XML"><rich:message for="id" passedLabel="No errors" showSummary="true">
<f:facet name="errorMarker">
<h:graphicImage url="/image/error.png"/>
</f:facet>
<f:facet name="passedMarker">
<h:graphicImage url="/image/passed.png"/>
</f:facet>
-</rich:message>
-...
-</programlisting>
+</rich:message></programlisting>
</section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;rich/message.html">Table of
- <rich:message>
- attributes</ulink>.
- </para>
- <table>
- <title>Component Identification Parameters </title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.component.RichMessage</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlRichMessage</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.component.RichMessage</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.renderkit.html.RichMessagesHtmlBaseRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.RichMessageTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
+
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;rich/message.html">Table of <rich:message> attributes</ulink>.
+ </para>
+
+ <table>
+ <title>Component Identification Parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.component.RichMessage</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlRichMessage</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.component.RichMessage</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.RichMessageRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.RichMessageTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
<title>Facets</title>
<tgroup cols="2">
@@ -169,48 +152,38 @@
<table id="mC">
- <title>Classes names that define a component appearance</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>rich-message</entry>
-
- <entry>Defines styles for a wrapper element</entry>
- </row>
-
- <row>
- <entry>rich-message-marker</entry>
-
- <entry>Defines styles for a marker</entry>
- </row>
-
- <row>
- <entry>rich-message-label</entry>
-
- <entry>Defines styles for a label</entry>
- </row>
-
- </tbody>
- </tgroup>
+ <title>Classes names that define a component appearance</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-message</entry>
+ <entry>Defines styles for a wrapper element</entry>
+ </row>
+ <row>
+ <entry>rich-message-marker</entry>
+ <entry>Defines styles for a marker</entry>
+ </row>
+ <row>
+ <entry>rich-message-label</entry>
+ <entry>Defines styles for a label</entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
- You can find all necessary information about style classes redefinition in
- <link linkend="customstyles">Definition of Custom Style Classes</link>
- section.
- </section>
+
+ <para>You can find all necessary information about style classes redefinition in <link linkend="customstyles">Definition of Custom Style Classes</link> section.</para>
+ </section>
+
<section>
<title>Relevant Resources Links</title>
<para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf?c=message">On the component LiveDemo page</ulink> you can see the example of <emphasis role="bold">
- <property><rich:message></property>
- </emphasis> usage and sources for the given example. </para>
+ Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf?c=message">Message page</ulink> at RichFaces LiveDemo for examples of component usage and their sources.
+ </para>
</section>
</section>
\ No newline at end of file
15 years, 3 months
JBoss Rich Faces SVN: r15452 - branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/help.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-09-03 11:33:27 -0400 (Thu, 03 Sep 2009)
New Revision: 15452
Modified:
branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/help/codehighlight.css
Log:
realworld/info/Chrome: Unnecessary veltical scroll bars are present on "How it works?" panels
https://jira.jboss.org/jira/browse/RF-7147
Modified: branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/help/codehighlight.css
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/help/codehighlight.css 2009-09-03 14:38:00 UTC (rev 15451)
+++ branches/community/3.3.X/examples/photoalbum/source/web/src/main/webapp/stylesheet/help/codehighlight.css 2009-09-03 15:33:27 UTC (rev 15452)
@@ -1,242 +1,246 @@
-span.property {color:#0066CC;}
+span.property {color:#0066CC;}
-pre.JAVA {line-height:10px;}
+pre.JAVA {
+ line-height:10px;
+ overflow-x:auto;
+ overflow-y:visible;
+}
-pre.XML {line-height:8px;}
+pre.XML {line-height:8px;}
pre.JSP {line-height:8px;}
-
-pre.XHTML {line-height:8px;}
-.java_type {color:#000000;}
+pre.XHTML {line-height:8px;}
+.java_type {color:#000000;}
+
.java_keyword {
- font-weight:bold;
+ font-weight:bold;
color:#7F1B55;
-}
+}
.java_javadoc_comment {
- color:#3F5FBF;
- font-style:italic;
+ color:#3F5FBF;
+ font-style:italic;
background-color:rgb(247,247,247);
-}
+}
.java_comment {
- color:#3F7F5F;
+ color:#3F7F5F;
background-color:rgb(247,247,247);
-}
+}
-.java_operator {color:#000000;}
+.java_operator {color:#000000;}
-.java_plain {color:rgb(0,0,0);}
+.java_plain {color:rgb(0,0,0);}
-.java_literal {color:#2A00FF;}
+.java_literal {color:#2A00FF;}
pre CODE {
- font-size:12px;
- color:rgb(0,0,0);
- font-family:monospace;
+ font-size:12px;
+ color:rgb(0,0,0);
+ font-family:monospace;
white-space:nowrap;
-}
+}
.java_javadoc_tag {
- font-weight:bold;
- color:#7F9FBF;
- font-style:italic;
+ font-weight:bold;
+ color:#7F9FBF;
+ font-style:italic;
background-color:rgb(247,247,247);
-}
+}
-.java_separator {color:#000000;}
+.java_separator {color:#000000;}
-.xml_plain {color:rgb(0,0,0);}
+.xml_plain {color:rgb(0,0,0);}
-.xml_tag_name {color:#3F7F7F;}
+.xml_tag_name {color:#3F7F7F;}
.xml_comment {
- color:#3F5FBF;
+ color:#3F5FBF;
background-color:rgb(247,247,247);
-}
+}
-.xml_tag_symbols {color:#008080;}
+.xml_tag_symbols {color:#008080;}
.xml_rife_tag {
- color:rgb(0,0,0);
+ color:rgb(0,0,0);
background-color:rgb(228,230,160);
-}
+}
-.xml_attribute_value {color:#2A00FF;}
+.xml_attribute_value {color:#2A00FF;}
.xml_attribute_name {
- font-weight:bold;
+ font-weight:bold;
color:#7F007F;
-}
+}
-.xml_char_data {color:rgb(0,0,0);}
+.xml_char_data {color:rgb(0,0,0);}
.xml_rife_name {
- color:#008cca;
+ color:#008cca;
background-color:rgb(228,230,160);
-}
+}
.xml_processing_instruction {
- font-weight:bold;
- color:rgb(0,0,0);
+ font-weight:bold;
+ color:rgb(0,0,0);
font-style:italic;
-}
+}
td.java {
- vertical-align:top;
+ vertical-align:top;
line-height:10px;
-}
+}
td.java-ln {
- vertical-align:top;
+ vertical-align:top;
line-height:10px;
-}
+}
tt.java {
- margin-bottom:0em;
+ margin-bottom:0em;
line-height:10px;
font-family:verdana,helvetica,sans-serif;
-}
+}
tt.java-ln {
- margin-bottom:0em;
+ margin-bottom:0em;
line-height:10px;
-}
+}
pre.java {
- margin-bottom:0em;
+ margin-bottom:0em;
line-height:10px;
-}
+}
pre.java-ln {
- margin-bottom:0em;
+ margin-bottom:0em;
line-height:10px;
-}
+}
td.java-ln {
- line-height:10px;
+ line-height:10px;
text-align:right;
-}
+}
tt.java-ln {
- color:#888888;
+ color:#888888;
line-height:10px;
-}
+}
pre.java-ln {
- color:#888888;
+ color:#888888;
line-height:10px;
-}
+}
span.java0 {
- font-size:8pt;
- color:#ffffff;
+ font-size:8pt;
+ color:#ffffff;
line-height:10px;
-}
+}
span.java1 {
- font-size:8pt;
+ font-size:8pt;
color:#808080;
-}
+}
span.java2 {
- font-size:8pt;
- color:#3f7f5f;
+ font-size:8pt;
+ color:#3f7f5f;
line-height:10px;
-}
+}
-/* Single-line comment */
+/* Single-line comment */
span.java3 {
- font-size:8pt;
- color:#3f7f5f;
+ font-size:8pt;
+ color:#3f7f5f;
line-height:10px;
-}
+}
-/* Keywords excluding 'return' */
+/* Keywords excluding 'return' */
span.java4 {
- font-weight:bold;
- font-size:8pt;
- color:#7F1B55;
+ font-weight:bold;
+ font-size:8pt;
+ color:#7F1B55;
line-height:10px;
-}
+}
span.java5 {
- font-size:8pt;
- color:#2a00ff;
+ font-size:8pt;
+ color:#2a00ff;
line-height:10px;
-}
+}
span.java6 {
- font-size:8pt;
- color:#990000;
+ font-size:8pt;
+ color:#990000;
line-height:10px;
-}
+}
span.java7 {
- font-size:8pt;
- color:#990000;
+ font-size:8pt;
+ color:#990000;
line-height:10px;
-}
+}
span.java8 {
- font-size:8pt;
- color:#000000;
+ font-size:8pt;
+ color:#000000;
line-height:10px;
-}
+}
-/* Primitive types: long, int, void etc... */
+/* Primitive types: long, int, void etc... */
span.java9 {
- font-weight:bold;
- font-size:8pt;
- color:#7F0055;
+ font-weight:bold;
+ font-size:8pt;
+ color:#7F0055;
line-height:10px;
-}
+}
span.java10 {
- font-size:8pt;
- color:#000000;
+ font-size:8pt;
+ color:#000000;
line-height:10px;
-}
+}
span.java11 {
- font-size:8pt;
- color:#7f9fbf;
+ font-size:8pt;
+ color:#7f9fbf;
line-height:10px;
-}
+}
span.java12 {
- font-size:8pt;
- color:#7f7f9f;
+ font-size:8pt;
+ color:#7f7f9f;
line-height:10px;
-}
+}
span.java13 {
- font-size:8pt;
- color:#3f3fbf;
+ font-size:8pt;
+ color:#3f3fbf;
line-height:10px;
-}
+}
span.java14 {
- font-size:8pt;
- color:#3f5fbf;
+ font-size:8pt;
+ color:#3f5fbf;
line-height:10px;
-}
+}
span.java15 {
- font-size:8pt;
- color:#7F0055;
+ font-size:8pt;
+ color:#7F0055;
line-height:10px;
-}
+}
-/* Annotations */
+/* Annotations */
span.java16 {
- font-size:8pt;
- color:#646464;
+ font-size:8pt;
+ color:#646464;
line-height:10px;
}
15 years, 3 months
JBoss Rich Faces SVN: r15451 - in branches/community/3.3.X/ui/simpleTogglePanel/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-09-03 10:38:00 -0400 (Thu, 03 Sep 2009)
New Revision: 15451
Modified:
branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
Log:
SimpleTogglePanel generates empty display/height/width style attribute
https://jira.jboss.org/jira/browse/RF-7518
Modified: branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
--- branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-09-03 13:00:58 UTC (rev 15450)
+++ branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-09-03 14:38:00 UTC (rev 15451)
@@ -248,6 +248,36 @@
}
}
+ public void encodeSwitchOnDivStart(ResponseWriter writer,
+ FacesContext context, UISimpleTogglePanel component) throws IOException {
+ encodeSwitchDivStart(writer, context, component, true);
+ }
+
+ public void encodeSwitchOffDivStart(ResponseWriter writer,
+ FacesContext context, UISimpleTogglePanel component) throws IOException {
+ encodeSwitchDivStart(writer, context, component, false);
+ }
+
+ private void encodeSwitchDivStart(ResponseWriter writer,
+ FacesContext context, UISimpleTogglePanel component, boolean isSwitchOn)
+ throws IOException {
+ String clientId = component.getClientId(context);
+ writer.startElement("div", component);
+
+ getUtils().writeAttribute(writer, "class", "rich-stglpnl-marker" );
+ getUtils().writeAttribute(writer, "id", convertToString(clientId) + "_switch_" + (isSwitchOn ? "on" : "off"));
+
+ String display = convertToString(getSwitchStatus(context, component, isSwitchOn)).trim();
+ if (!isEmpty(display)) {
+ display = "display: " + display;
+ }
+ getUtils().writeAttribute(writer, "style", display);
+ }
+
+ public String getSwitchStatus(FacesContext context, UIComponent component, boolean isSwitchOn) {
+ return ((UISimpleTogglePanel) component).isOpened() ^ isSwitchOn ? EMPTY : NONE;
+ }
+
private boolean isEmpty(String str) {
return str == null || str.length() == 0;
}
@@ -259,25 +289,4 @@
public void encodeDivEnd(ResponseWriter writer) throws IOException {
writer.endElement("div");
}
-
- public String getSwitchOnStatus(FacesContext context, UIComponent component) {
- UISimpleTogglePanel simpleTogglePanel = (UISimpleTogglePanel) component;
- return simpleTogglePanel.isOpened() ? EMPTY : NONE;
-// String sw = Boolean.toString(((UISimpleTogglePanel) component).isOpened());
-// if (sw == null || sw.equals(Boolean.toString(UISimpleTogglePanel.EXPANDED)))
-// return EMPTY;
-// else return NONE;
- }
-
- public String getSwitchOffStatus(FacesContext context, UIComponent component) {
- UISimpleTogglePanel simpleTogglePanel = (UISimpleTogglePanel) component;
- return simpleTogglePanel.isOpened() ? NONE : EMPTY ;
-
-// String sw = Boolean.toString(((UISimpleTogglePanel) component).isOpened());
-// if (sw == null || sw.equals(Boolean.toString(UISimpleTogglePanel.EXPANDED)))
-// return NONE;
-// else return EMPTY;
-
- }
-
}
Modified: branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
===================================================================
--- branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2009-09-03 13:00:58 UTC (rev 15450)
+++ branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2009-09-03 14:38:00 UTC (rev 15451)
@@ -39,7 +39,9 @@
onclick="#{this:getOnClick(context,component)}">
<div class="rich-stglpanel-marker">
- <div id="#{clientId}_switch_on" style="display: #{this:getSwitchOnStatus(context, component)};" class="rich-stglpnl-marker">
+ <jsp:scriptlet>
+ encodeSwitchOnDivStart(writer, context, component);
+ </jsp:scriptlet>
<jsp:scriptlet><![CDATA[
if(component.getFacet("closeMarker")!=null && component.getFacet("closeMarker").isRendered()) {
]]></jsp:scriptlet>
@@ -49,9 +51,11 @@
writer.write("«");
}
]]></jsp:scriptlet>
- </div>
- <div id="#{clientId}_switch_off"
- style="display: #{this:getSwitchOffStatus(context, component)};" class="rich-stglpnl-marker">
+ <jsp:scriptlet>
+ encodeDivEnd(writer);
+
+ encodeSwitchOffDivStart(writer, context, component);
+ </jsp:scriptlet>
<jsp:scriptlet><![CDATA[
if(component.getFacet("openMarker")!=null && component.getFacet("openMarker").isRendered()) {
]]></jsp:scriptlet>
@@ -61,7 +65,9 @@
writer.write("»");
}
]]></jsp:scriptlet>
- </div>
+ <jsp:scriptlet>
+ encodeDivEnd(writer);
+ </jsp:scriptlet>
</div>
<jsp:scriptlet><![CDATA[
15 years, 3 months
JBoss Rich Faces SVN: r15450 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/org/jboss/richfaces/integrationTest/include and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2009-09-03 09:00:58 -0400 (Thu, 03 Sep 2009)
New Revision: 15450
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/include/IncludeTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/messages.properties
Log:
- refactored Include test cases to follow conventions
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/include/IncludeTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/include/IncludeTestCase.java 2009-09-03 12:20:29 UTC (rev 15449)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/include/IncludeTestCase.java 2009-09-03 13:00:58 UTC (rev 15450)
@@ -1,10 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces
+ *
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this test suite; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.jboss.richfaces.integrationTest.include;
-import junit.framework.Assert;
+import static org.testng.Assert.*;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.waiting.Condition;
import org.jboss.test.selenium.waiting.Wait;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -12,165 +33,160 @@
* @version $Revision$
*/
public class IncludeTestCase extends AbstractSeleniumRichfacesTestCase {
+
+ private String LOC_FIELDSET_HEADER = getLoc("FIELDSET_HEADER");
+ private String LOC_BUTTON_PREVIOUS = getLoc("BUTTON_PREVIOUS");
+ private String LOC_BUTTON_NEXT = getLoc("BUTTON_NEXT");
+ private String LOC_INPUT_FIRSTNAME = getLoc("INPUT_FIRSTNAME");
+ private String LOC_INPUT_LASTNAME = getLoc("INPUT_LASTNAME");
+ private String LOC_INPUT_COMPANY = getLoc("INPUT_COMPANY");
+ private String LOC_INPUT_NOTES = getLoc("INPUT_NOTES");
+ private String LOC_OUTPUT_FIRSTNAME = getLoc("OUTPUT_FIRSTNAME");
+ private String LOC_OUTPUT_LASTNAME = getLoc("OUTPUT_LASTNAME");
+ private String LOC_OUTPUT_COMPANY = getLoc("OUTPUT_COMPANY");
+ private String LOC_OUTPUT_NOTES = getLoc("OUTPUT_NOTES");
+
+ private String MSG_INPUT_SAMPLE_PREFORMATTED = getMsg("INPUT_SAMPLE_PREFORMATTED");
+ private String MSG_MESSAGE_COMPANY_REQUIRED = getMsg("MESSAGE_COMPANY_REQUIRED");
+ private String MSG_MESSAGE_LASTNAME_REQUIRED = getMsg("MESSAGE_LASTNAME_REQUIRED");
+ private String MSG_MESSAGE_NOTES_REQUIRED = getMsg("MESSAGE_NOTES_REQUIRED");
+
/**
- * Opens specified page
+ * Simply fill in all inputs and checks that they will be output well on
+ * following pages.
*/
- public void openPage() {
- selenium.open(contextPath
- + "/richfaces/include.jsf?c=include&tab=usage");
- scrollIntoView(header, true);
- }
-
- private String header = getLoc("include--header");
- private String buttonNext = getLoc("include--button--next");
- private String buttonPrevious = getLoc("include--button--previous");
- private String inputFirstName = getLoc("include--input--first-name");
- private String inputLastName = getLoc("include--input--last-name");
- private String inputCompany = getLoc("include--input--company");
- private String inputNotes = getLoc("include--input--notes");
- private String outputFirstName = getLoc("include--output--first-name");
- private String outputLastName = getLoc("include--output--last-name");
- private String outputCompany = getLoc("include--output--company");
- private String outputNotes = getLoc("include--output--notes");
- private String sample = getMess("include--input--sample");
-
@Test
- public void goThroughStepsTest() {
- openPage();
-
+ public void testGoThroughSteps() {
goThroughSteps();
}
- @Test(dependsOnMethods = { "goThroughStepsTest" })
- public void goThroughStepsBackTest() {
- openPage();
-
+ /**
+ * Fill in all inputs, checks that they are output well on following pages
+ * and then go through previous pages and check that all stay still without
+ * change.
+ */
+ @Test(dependsOnMethods = { "testGoThroughSteps" })
+ public void testGoThroughStepsBack() {
goThroughSteps();
goThroughStepsBack();
}
+ /**
+ * Go through pages and on every page try to don't fill some input - checks
+ * that message 'value required' will appear. On the last page checks that
+ * every output is filled-in right.
+ */
@Test
- public void tryFailedValidationTest() {
- openPage();
+ public void testTryFailedValidation() {
+ assertTrue(isFirstPage());
- Assert.assertTrue(isFirstPage());
+ selenium.type(LOC_INPUT_FIRSTNAME, format(MSG_INPUT_SAMPLE_PREFORMATTED, 1));
+ selenium.type(LOC_INPUT_LASTNAME, format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ selenium.click(LOC_BUTTON_NEXT);
- selenium.type(inputFirstName, format(sample, 1));
- selenium.type(inputLastName, format(sample, 2));
- selenium.click(buttonNext);
+ waitForText(MSG_MESSAGE_COMPANY_REQUIRED);
- waitForText(getMess("include--message--company-required"));
+ selenium.type(LOC_INPUT_COMPANY, format(MSG_INPUT_SAMPLE_PREFORMATTED, 3));
+ selenium.click(LOC_BUTTON_NEXT);
- selenium.type(inputCompany, format(sample, 3));
- selenium.click(buttonNext);
-
- Wait.until(new Condition() {
+ Wait.failWith("Switching to second page failed").until(new Condition() {
public boolean isTrue() {
return isSecondPage();
}
});
- selenium.click(buttonPrevious);
+ selenium.click(LOC_BUTTON_PREVIOUS);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to first page failed").until(new Condition() {
public boolean isTrue() {
return isFirstPage();
}
});
- selenium.type(inputLastName, "");
- selenium.click(buttonNext);
+ selenium.type(LOC_INPUT_LASTNAME, "");
+ selenium.click(LOC_BUTTON_NEXT);
- waitForText(getMess("include--message--last-name-required"));
+ waitForText(MSG_MESSAGE_LASTNAME_REQUIRED);
- selenium.type(inputLastName, format(sample, 2));
- selenium.click(buttonNext);
+ selenium.type(LOC_INPUT_LASTNAME, format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ selenium.click(LOC_BUTTON_NEXT);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to second page failed").until(new Condition() {
public boolean isTrue() {
return isSecondPage();
}
});
- selenium.click(buttonNext);
+ selenium.click(LOC_BUTTON_NEXT);
- waitForText(getMess("include--message--notes-required"));
+ waitForText(MSG_MESSAGE_NOTES_REQUIRED);
- selenium.type(inputNotes, format(sample, 4));
- selenium.click(buttonNext);
+ selenium.type(LOC_INPUT_NOTES, format(MSG_INPUT_SAMPLE_PREFORMATTED, 4));
+ selenium.click(LOC_BUTTON_NEXT);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to last page failed").until(new Condition() {
public boolean isTrue() {
return isLastPage();
}
});
- Assert.assertEquals(format(sample, 1), selenium
- .getText(outputFirstName));
- Assert
- .assertEquals(format(sample, 2), selenium
- .getText(outputLastName));
- Assert.assertEquals(format(sample, 3), selenium.getText(outputCompany));
- Assert.assertEquals(format(sample, 4), selenium.getText(outputNotes));
+ assertEquals(selenium.getText(LOC_OUTPUT_FIRSTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 1));
+ assertEquals(selenium.getText(LOC_OUTPUT_LASTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ assertEquals(selenium.getText(LOC_OUTPUT_COMPANY), format(MSG_INPUT_SAMPLE_PREFORMATTED, 3));
+ assertEquals(selenium.getText(LOC_OUTPUT_NOTES), format(MSG_INPUT_SAMPLE_PREFORMATTED, 4));
}
- public void goThroughSteps() {
- Assert.assertTrue(isFirstPage());
+ private void goThroughSteps() {
+ assertTrue(isFirstPage());
- selenium.type(inputFirstName, format(sample, 1));
- selenium.type(inputLastName, format(sample, 2));
- selenium.type(inputCompany, format(sample, 3));
- selenium.click(buttonNext);
+ selenium.type(LOC_INPUT_FIRSTNAME, format(MSG_INPUT_SAMPLE_PREFORMATTED, 1));
+ selenium.type(LOC_INPUT_LASTNAME, format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ selenium.type(LOC_INPUT_COMPANY, format(MSG_INPUT_SAMPLE_PREFORMATTED, 3));
+ selenium.click(LOC_BUTTON_NEXT);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to second page failed").until(new Condition() {
public boolean isTrue() {
return isSecondPage();
}
});
- selenium.type(inputNotes, format(sample, 4));
- selenium.click(buttonNext);
+ selenium.type(LOC_INPUT_NOTES, format(MSG_INPUT_SAMPLE_PREFORMATTED, 4));
+ selenium.click(LOC_BUTTON_NEXT);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to last page failed").until(new Condition() {
public boolean isTrue() {
return isLastPage();
}
});
- Assert.assertEquals(format(sample, 1), selenium
- .getText(outputFirstName));
- Assert
- .assertEquals(format(sample, 2), selenium
- .getText(outputLastName));
- Assert.assertEquals(format(sample, 3), selenium.getText(outputCompany));
- Assert.assertEquals(format(sample, 4), selenium.getText(outputNotes));
+ assertEquals(selenium.getText(LOC_OUTPUT_FIRSTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 1));
+ assertEquals(selenium.getText(LOC_OUTPUT_LASTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ assertEquals(selenium.getText(LOC_OUTPUT_COMPANY), format(MSG_INPUT_SAMPLE_PREFORMATTED, 3));
+ assertEquals(selenium.getText(LOC_OUTPUT_NOTES), format(MSG_INPUT_SAMPLE_PREFORMATTED, 4));
}
private void goThroughStepsBack() {
- selenium.click(buttonPrevious);
+ selenium.click(LOC_BUTTON_PREVIOUS);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to second page failed").until(new Condition() {
public boolean isTrue() {
return isSecondPage();
}
});
- Assert.assertEquals(format(sample, 4), selenium.getValue(inputNotes));
+ assertEquals(selenium.getValue(LOC_INPUT_NOTES), format(MSG_INPUT_SAMPLE_PREFORMATTED, 4));
- selenium.click(buttonPrevious);
+ selenium.click(LOC_BUTTON_PREVIOUS);
- Wait.until(new Condition() {
+ Wait.failWith("Switching to first page failed").until(new Condition() {
public boolean isTrue() {
return isFirstPage();
}
});
- Assert.assertEquals(format(sample, 1), selenium
- .getValue(inputFirstName));
- Assert
- .assertEquals(format(sample, 2), selenium
- .getValue(inputLastName));
- Assert.assertEquals(format(sample, 3), selenium.getValue(inputCompany));
+ assertEquals(selenium.getValue(LOC_INPUT_FIRSTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 1));
+ assertEquals(selenium.getValue(LOC_INPUT_LASTNAME), format(MSG_INPUT_SAMPLE_PREFORMATTED, 2));
+ assertEquals(selenium.getValue(LOC_INPUT_COMPANY), format(MSG_INPUT_SAMPLE_PREFORMATTED, 3));
}
private boolean isFirstPage() {
@@ -185,9 +201,16 @@
return isButtonsPresent(true, false);
}
- private boolean isButtonsPresent(boolean previousPresent,
- boolean nextPresent) {
- return (previousPresent == selenium.isElementPresent(buttonPrevious))
- && (nextPresent == selenium.isElementPresent(buttonNext));
+ private boolean isButtonsPresent(boolean previousPresent, boolean nextPresent) {
+ return (previousPresent == selenium.isElementPresent(LOC_BUTTON_PREVIOUS))
+ && (nextPresent == selenium.isElementPresent(LOC_BUTTON_NEXT));
}
+
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Include");
+
+ scrollIntoView(LOC_FIELDSET_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties 2009-09-03 12:20:29 UTC (rev 15449)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/locators.properties 2009-09-03 13:00:58 UTC (rev 15450)
@@ -1,11 +1,11 @@
-include--header=//legend[text()\='Include example']
-include--button--previous=//*[@type\='button' and @value\='<<Previous']
-include--button--next=//*[@type\='button' and @value\='Next >>']
-include--input--first-name=//*[text()\='First Name\:']/../*[2]/*[@type\='text']
-include--input--last-name=//*[text()\='Last Name\:']/../*[2]/*[@type\='text']
-include--input--company=//*[text()\='Company\:']/../*[2]/*[@type\='text']
-include--input--notes=//*[contains(@id, 'notes')]
-include--output--first-name=//*[text()\='First Name\:']/../*[2]
-include--output--last-name=//*[text()\='Last Name\:']/../*[2]
-include--output--company=//*[text()\='Company\:']/../*[2]
-include--output--notes=//*[text()\='Notes\:']/../*[2]
+FIELDSET_HEADER=//legend[text()\='Include example']
+BUTTON_PREVIOUS=//*[@type\='button' and @value\='<<Previous']
+BUTTON_NEXT=//*[@type\='button' and @value\='Next >>']
+INPUT_FIRSTNAME=//*[text()\='First Name\:']/../*[2]/*[@type\='text']
+INPUT_LASTNAME=//*[text()\='Last Name\:']/../*[2]/*[@type\='text']
+INPUT_COMPANY=//*[text()\='Company\:']/../*[2]/*[@type\='text']
+INPUT_NOTES=//*[contains(@id, 'notes')]
+OUTPUT_FIRSTNAME=//*[text()\='First Name\:']/../*[2]
+OUTPUT_LASTNAME=//*[text()\='Last Name\:']/../*[2]
+OUTPUT_COMPANY=//*[text()\='Company\:']/../*[2]
+OUTPUT_NOTES=//*[text()\='Notes\:']/../*[2]
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/messages.properties 2009-09-03 12:20:29 UTC (rev 15449)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/include/messages.properties 2009-09-03 13:00:58 UTC (rev 15450)
@@ -1,4 +1,4 @@
-include--input--sample=sample{0}
-include--message--company-required=Company\: Validation Error\: Value is required.
-include--message--last-name-required=Last Name\: Validation Error\: Value is required.
-include--message--notes-required=Notes\: Validation Error\: Value is required.
+INPUT_SAMPLE_PREFORMATTED=sample{0}
+MESSAGE_COMPANY_REQUIRED=Company\: Validation Error\: Value is required.
+MESSAGE_LASTNAME_REQUIRED=Last Name\: Validation Error\: Value is required.
+MESSAGE_NOTES_REQUIRED=Notes\: Validation Error\: Value is required.
15 years, 3 months