JBoss Rich Faces SVN: r12905 - in trunk/test-applications/realworld2: tests and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-10 08:44:21 -0400 (Tue, 10 Mar 2009)
New Revision: 12905
Added:
trunk/test-applications/realworld2/tests/
trunk/test-applications/realworld2/tests/META-INF/
trunk/test-applications/realworld2/tests/META-INF/MANIFEST.MF
trunk/test-applications/realworld2/tests/pom.xml
trunk/test-applications/realworld2/tests/src/
trunk/test-applications/realworld2/tests/src/test/
trunk/test-applications/realworld2/tests/src/test/java/
trunk/test-applications/realworld2/tests/src/test/java/org/
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/RichSeleniumTest.java
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/SeleniumTestBase.java
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/TestAnnotationTransformer.java
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/testng/
trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/testng/LoginTest.java
trunk/test-applications/realworld2/tests/src/test/resources/
trunk/test-applications/realworld2/tests/src/test/resources/testng.xml
Log:
Login Selenium Test Added
Added: trunk/test-applications/realworld2/tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld2/tests/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test-applications/realworld2/tests/META-INF/MANIFEST.MF 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Class-Path: commons-beanutils-1.7.0.jar commons-collections-3.2.jar co
+ mmons-digester-1.8.jar richfaces-api-3.3.0.GA.jar richfaces-impl-3.3.
+ 0.GA.jar richfaces-ui-3.3.0.GA.jar
+
Added: trunk/test-applications/realworld2/tests/pom.xml
===================================================================
--- trunk/test-applications/realworld2/tests/pom.xml (rev 0)
+++ trunk/test-applications/realworld2/tests/pom.xml 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,168 @@
+<?xml version="1.0"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>realworld</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>${projectName}-tests</artifactId>
+ <name>Selenium Tests Module</name>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-ear</artifactId>
+ <version>${project.version}</version>
+ <type>ear</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>${richfacesVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>${richfacesVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>${richfacesVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_08</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.server</groupId>
+ <artifactId>selenium-server-coreless</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jetty</groupId>
+ <artifactId>org.mortbay.jetty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+
+ <!-- Skip the normal tests, we'll run them in the integration-test phase -->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ src/test/resources/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy</goal>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ <!--goal>undeploy</goal-->
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jboss4x</containerId>
+ <append>false</append>
+
+ <zipUrlInstaller>
+ <url>${jboss.installer.url}</url>
+ <installDir>
+ ${project.basedir}/target/installs
+ </installDir>
+ </zipUrlInstaller>
+ </container>
+ <configuration>
+ <home>${jbosshome}/server/${jbosscontext}</home>
+ <type>existing</type>
+ <properties>
+ <cargo.hostname>localhost</cargo.hostname>
+ <cargo.jboss.configuration>${jbosscontext}</cargo.jboss.configuration>
+ <cargo.rmi.port>1099</cargo.rmi.port>
+ </properties>
+ </configuration>
+ <deployer>
+ <type>installed</type>
+ <deployables>
+ <deployable>
+ <artifactId>${projectName}-ear</artifactId>
+ <type>ear</type>
+ </deployable>
+ </deployables>
+ </deployer>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/RichSeleniumTest.java
===================================================================
--- trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/RichSeleniumTest.java (rev 0)
+++ trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/RichSeleniumTest.java 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,11 @@
+package org.richfaces.realworld;
+
+public interface RichSeleniumTest {
+
+ public void startSelenium(String browser);
+
+ public void stopSelenium();
+
+ public String getTestUrl();
+
+}
Added: trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/SeleniumTestBase.java (rev 0)
+++ trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/SeleniumTestBase.java 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,877 @@
+package org.richfaces.realworld;
+
+
+
+import java.io.File;
+import java.io.FileFilter;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.openqa.selenium.server.RemoteControlConfiguration;
+import org.openqa.selenium.server.SeleniumServer;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Parameters;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+/**
+ * The base java class for selenium tests implementation.
+ *
+ * @author Andrey Markavtsov
+ *
+ */
+public abstract class SeleniumTestBase implements RichSeleniumTest {
+
+ /** Specifies the time to wait for page rendering */
+ private static final Integer pageRenderTime = 60000;
+
+ /** Specifies the time to wait for ajax processing */
+ protected static final int ajaxCompletionTime = 20000;
+
+ protected static final String serverPort = "8080";
+
+ protected static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
+
+ /** Parent component id */
+ private String parentId;
+
+ /** The default selenium instance */
+ public DefaultSelenium selenium;
+
+ /** Host */
+ public String host;
+
+ /** Port */
+ public String port;
+
+ /** Protocol */
+ public String protocol;
+
+ private String filterPrefix;
+
+ private SeleniumServer seleniumServer;
+
+ private Object[][] data;
+
+ private int seleniumServerPort = 5556;
+
+ /** Defines the name of current j2ee application name */
+ public static final String APPLICATION_NAME = "realworld";
+
+ public SeleniumTestBase() {
+ this("http", "localhost", serverPort);
+ }
+
+ public SeleniumTestBase(String protocol, String host, String port) {
+ this.host = host;
+ this.port = port;
+ this.protocol = protocol;
+ }
+
+ @BeforeSuite
+ public void startSeleniumServer() throws Exception {
+ RemoteControlConfiguration config = new RemoteControlConfiguration();
+ config.setMultiWindow(false);
+ config.setPort(seleniumServerPort);
+ seleniumServer = new SeleniumServer(false, config);
+ seleniumServer.start();
+ }
+
+ //@DataProvider(name = "templates")
+// protected Object[][] templates() {
+// return new Object[][] { { Template.SIMPLE }, { Template.DATA_TABLE }, { Template.MODAL_PANEL } };
+// //return this.data;
+// }
+
+ /**
+ * This method are invoked before selenium tests started
+ */
+ @BeforeClass
+ @Parameters({"browser"})
+ public void startSelenium(String browser) {
+ if (browser.equals("*firefox")) {
+ String firefox = findFirefox();
+ if (firefox != null) {
+ browser = firefox;
+ }
+ }
+
+ synchronized (MUTEX) {
+ this.filterPrefix = filterPrefix;
+ selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
+ selenium.start();
+ selenium.allowNativeXpath("false");
+ }
+ }
+
+ private String findFirefox() {
+ String browser = null;
+ File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
+ for (int i = 0; browser == null && i < libs.length; i++) {
+ File lib = libs[i];
+ if (lib.isDirectory()) {
+ System.out.println("---->lib#" + i + ": " + lib.getPath());
+ File[] firefoxDirs = lib.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&& pathname.getName().startsWith("firefox")
+ && pathname.isDirectory();
+ }
+ });
+ for (int j = firefoxDirs.length - 1; browser == null && j >= 0; j--) {
+ System.out.println("------>firefoxDir#" + j + ": " + firefoxDirs[j].getPath());
+ File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ boolean result = false;
+ if (pathname != null && pathname.isFile()) {
+ String name = pathname.getName();
+ result = "firefox".equals(name) || "firefox-bin".equals(name);
+ }
+ return result;
+ }
+ });
+ if (firefoxes.length > 1 && "firefox-bin".equals(firefoxes[1].getName())) {
+ browser = "*firefox " + firefoxes[1].getPath();
+ } else if (firefoxes.length > 0){
+ browser = "*firefox " + firefoxes[0].getPath();
+ }
+ }
+ }
+ }
+ return browser;
+ }
+
+ /**
+ * This method are invoked after selenium tests completed
+ */
+ @AfterClass(alwaysRun=true)
+ public void stopSelenium() {
+ synchronized (MUTEX) {
+ selenium.stop();
+ selenium = null;
+ }
+ }
+
+// protected void loadTemplates(String templateExpr) {
+// String[] array = new String[]{};
+// if(null != templateExpr) {
+// array = templateExpr.split(",");
+// }
+//
+// List<Object[]> list = new ArrayList<Object[]>();
+// for (String string : array) {
+// Object[] elem = new Object[] {Template.valueOf(string)};
+// list.add(elem);
+// }
+//
+// this.data = (Object[][]) list.toArray(new Object[0][0]);
+// }
+
+ @AfterSuite
+ public void stopSeleniumServer() throws Exception {
+ seleniumServer.stop();
+ }
+
+ /**
+ * @param url
+ * @param browser
+ * @return
+ */
+ private DefaultSelenium createSeleniumClient(String url, String browser) {
+ return new DefaultSelenium(host, seleniumServerPort, browser, url);
+ }
+
+ private static final Object MUTEX = new Object();
+
+ /**
+ * Renders page
+ */
+ protected void renderPage() {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + getTestUrl());
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ }
+
+ /**
+ * Writes status message on client side
+ *
+ * @param message
+ */
+ public void writeStatus(String message, boolean isError) {
+ message = message.replace("'", "\\'");
+ StringBuffer buffer = new StringBuffer("writeStatus('");
+ buffer.append(message);
+ if (!isError) {
+ buffer.append("')");
+ }else {
+ buffer.append("',true)");
+ }
+ runScript(buffer.toString());
+ }
+
+ /**
+ * Writes status message on client side
+ *
+ * @param message
+ */
+ public void writeStatus(String message) {
+ writeStatus(message, false);
+ }
+
+ /**
+ * ReRenders the component
+ */
+ public void reRenderForm() {
+ selenium.getEval("selenium.browserbot.getCurrentWindow().reRenderAll();");
+ // clickById("_Selenium_Test_ReRender_Form:_reRender");
+ waitForAjaxCompletion(3000);
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ checkJSError();
+ return result;
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script, boolean checkEerror) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ if (checkEerror) {
+ checkJSError();
+ }
+ return result;
+ }
+
+ /**
+ * Checks if JS error occurred. Fails test if yes. This method should be
+ * invoked after each event or any thing which can be a cause of JS error.
+ */
+ public void checkJSError() {
+ /*
+ String error = selenium.getEval(WINDOW_JS_RESOLVER + "checkError();");
+ if (error != null && !("null".equals(error)) && !("".equals(error))) {
+ Assert.fail("Failure by the following Javascript error: " + error);
+ }*/
+ }
+
+ /**
+ * Checks if page containing component test has been rendered completely
+ */
+ public void checkPageRendering() {
+ try {
+ String t1 = getTextById("_Selenium_Test_ControlPoint1");
+ String t2 = getTextById("_Selenium_Test_ControlPoint2");
+ if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
+ Assert.fail("The page has been not rendered properlly");
+ }
+ } catch (Exception e) {
+ Assert.fail("The page has not been rendered properly due the following error: " + e);
+ }
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion(int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "done==true", String.valueOf(miliseconds));
+ runScript("window.done=false");
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion() {
+ waitForAjaxCompletion(ajaxCompletionTime);
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForPageToLoad(int miliseconds) {
+ selenium.waitForPageToLoad(String.valueOf(miliseconds));
+ }
+
+ /**
+ * Waits for condition
+ *
+ * @param condition
+ * @param miliseconds
+ */
+ public void waiteForCondition(String condition, int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + condition, String.valueOf(miliseconds));
+ checkJSError();
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ */
+ public void waitForPageToLoad() {
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueNotEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueNotEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param locator -
+ * locator an element locator
+ * @param value -
+ * text defined
+ */
+ public void AssertTextEquals(String locator, String value) {
+ String _v = selenium.getText(locator);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ */
+ public void AssertTextNotEquals(String id, String value) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextNotEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node is visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertVisible(String id) {
+ Assert.assertTrue(isVisibleById(id));
+ }
+
+ /**
+ * Asserts DOM node is visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertVisible(String id, String message) {
+ Assert.assertTrue(isVisibleById(id), message);
+ }
+
+ /**
+ * Asserts DOM node is not present
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotPresent(String id) {
+ Assert.assertFalse(isPresentById(id));
+ }
+
+ /**
+ * Asserts DOM node is not visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotVisible(String id) {
+ Assert.assertFalse(isVisibleById(id));
+ }
+
+ /**
+ * Asserts DOM node is present
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertPresent(String id) {
+ Assert.assertTrue(isPresentById(id));
+ }
+
+ /**
+ * Asserts DOM node is present
+ * @param id - DOM element id
+ */
+ public void AssertRendered(String id) {
+ if (!isPresentById(id)) {
+ Assert.fail("Component " + id + " should be rendered on page");
+ }
+ }
+
+ /**
+ * Asserts DOM node is not present
+ * @param id - DOM element id
+ */
+ public void AssertNotRendered(String id) {
+ if (isPresentById(id)) {
+ Assert.fail("Component " + id + " should not be rendered on page");
+ }
+ }
+
+ /**
+ * Returns element's text
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getTextById(String id) {
+ return selenium.getText("id=" + id);
+ }
+
+ /**
+ * Returns element's value
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getValueById(String id) {
+ return selenium.getValue("id=" + id);
+ }
+
+ /**
+ * Sets a new value for DOM node with specified id.
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * a new DOM element's value
+ */
+ public void setValueById(String id, String value) {
+ runScript(String.format("document.getElementById('%1$s').value='%2$s';", id, value));
+ }
+
+ /**
+ * Returns element's width
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getWidthById(String id) {
+ return selenium.getElementWidth("id=" + id);
+ }
+
+ /**
+ * Returns element's height
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getHeightById(String id) {
+ return selenium.getElementHeight("id=" + id);
+ }
+
+ /**
+ * Clicks on element
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public void clickById(String id) {
+ selenium.click("id=" + id);
+ checkJSError();
+ }
+
+ /**
+ * Clicks an ajax command and wait for ajax request completion.
+ * @param locator an element locator
+ */
+ public void clickAjaxCommandAndWait(String locator) {
+ selenium.click(locator);
+ waitForAjaxCompletion();
+ }
+
+ /**
+ * This method should be used for click on command controls instead of
+ * 'clickById' method.
+ *
+ * @param commandId
+ */
+ public void clickCommandAndWait(String commandId) {
+ selenium.click("id=" + commandId);
+ waitForPageToLoad();
+ }
+
+ /**
+ * Return true if element is visible
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public boolean isVisibleById(String id) {
+ return selenium.isVisible("id=" + id);
+ }
+
+ /**
+ * Returns true if element with given id is present.
+ *
+ * @param id -
+ * DOM element id
+ * @return true if element with given id is present, otherwise - false
+ */
+ public boolean isPresentById(String id) {
+ return selenium.isElementPresent("id=" + id);
+ }
+
+ /**
+ * Invokes JS method on client.
+ *
+ * @param id -
+ * DOM id of component
+ * @param method -
+ * string method name
+ * @param parameters -
+ * parameters
+ * @return
+ */
+ public String invokeFromComponent(String id, String method, Object parameters) {
+ String _return = null;
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("$('");
+ buffer.append(id);
+ buffer.append("').component.");
+ buffer.append(method);
+ buffer.append("(");
+ buffer.append(ScriptUtils.toScript(parameters));
+ buffer.append(");");
+ _return = runScript(buffer.toString());
+ return _return;
+ }
+
+ /**
+ * Creates delay
+ *
+ * @param miliSeconds
+ * @throws InterruptedException
+ */
+ public void delay(int miliSeconds) {
+ try {
+ Thread.sleep(miliSeconds);
+ } catch (Exception e) {
+
+ }
+ }
+
+ /**
+ * Creates pause for defined time in miliSeconds
+ *
+ * @param miliSeconds
+ */
+ public void pause(int miliSeconds, String id) {
+ StringBuffer script = new StringBuffer("pause(");
+ script.append(miliSeconds);
+ script.append(",'");
+ script.append(id);
+ script.append("');");
+ runScript(script.toString());
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "pauseHolder['" + id + "'] == true;", String
+ .valueOf(miliSeconds + 1000));
+ }
+
+ /**
+ * @return the parentId
+ */
+ public String getParentId() {
+ return parentId;
+ }
+
+ /**
+ * @param parentId
+ * the parentId to set
+ */
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+
+ /**
+ * Workaround for selenium.type/selenium.typeKeys
+ * @param locator
+ * @param string
+ */
+ public void type(String locator, String string) {
+ selenium.type(locator, "");
+ StringBuffer value = new StringBuffer(selenium.getValue(locator));
+ char[] chars = string.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ String key = Character.toString(chars[i]);
+ value.append(key);
+
+ selenium.keyDown(locator, key);
+
+ if(!isFF()) {
+ selenium.type(locator, value.toString());
+ }
+
+ selenium.keyPress(locator, key);
+ selenium.keyUp(locator, key);
+
+ }
+ }
+
+ public void testOnclickEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onclick event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.click(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnDblclickEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing ondblclick event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.doubleClick(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnfocusEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onfocus event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.focus(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeydownEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onkeydown event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyDown(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeypressEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onkeypress event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyPress(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeyupEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onkeyup event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyUp(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmousedownEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onmousedown event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseDown(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmousemoveEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onmousemove event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseMove(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseoutEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseout event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseOut(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseoverEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseover event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseOver(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseupEvent(String testElementId, String testElementResultId, String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseup event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseUp(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ /**
+ * Method to assert element style attribute with expected
+ * @param elementId - tested element id
+ * @param expectedExpression - expected style attribute
+ */
+ public void assertStyleAttribute(String elementId, String expectedExpression) {
+ String styleAttribute = selenium.getAttribute("//*[@id='" + elementId + "']/@style");
+ if (!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
+ Assert.fail("Element '" + elementId + "' with style '" + styleAttribute + "' doesn't contain '" + expectedExpression + "'");
+ }
+ }
+
+ /**
+ * Asserts that expected columns count equals actual one.
+ * @param i the expected columns count
+ * @param tableId id of table to be checked
+ */
+ public void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
+ * Asserts that expected rows count equals actual one.
+ * @param i the expected rows count
+ * @param tableId id of table to be checked
+ */
+ public void assertRowsCount(int i, String tableId) {
+ int count = selenium.getXpathCount("//table[@id='" + tableId + "']/tbody/tr").intValue();
+ Assert.assertEquals(count, i);
+ }
+
+ /**
+ * Checks whether client is FireFox
+ *
+ * @return true if client is FireFox
+ */
+ public boolean isFF() {
+ return new Boolean(selenium.getEval("navigator.userAgent.indexOf('Firefox') > -1"));
+ }
+
+ /**
+ * Returns the url to test page to be opened by selenium
+ *
+ * @return
+ */
+ public abstract String getTestUrl();
+
+ /**
+ * Simulates mouse event for element
+ * @param id - Element ID
+ * @param eventName - Mouse event Name
+ * @param x - X mouse position
+ * @param y - Y mouse position
+ * @return - Event
+ */
+ public String fireMouseEvent(String id, String eventName, int x, int y, boolean ctrl) {
+ return runScript("fireMouseEvent('" + id + "','" + eventName + "', "
+ + x + "," + y + ","+ctrl+");");
+ }
+
+ /**
+ * Calls component JS API
+ *
+ * @param id - Client id of the component to call operation on
+ * @param function - JS function representing operation that should be called
+ * @return - Result of execution
+ */
+ public String callComponentOperation(String id, JSFunction function) {
+ StringBuffer command = new StringBuffer();
+ new JSFunction("document.getElementById", id).appendScript(command);
+ command.append(".component.");
+ function.appendScript(command);
+ return runScript(command.toString());
+ }
+}
Added: trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/TestAnnotationTransformer.java
===================================================================
--- trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/TestAnnotationTransformer.java (rev 0)
+++ trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/TestAnnotationTransformer.java 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,28 @@
+package org.richfaces.realworld;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import org.testng.internal.annotations.IAnnotationTransformer;
+import org.testng.internal.annotations.ITest;
+import org.testng.internal.annotations.TestAnnotation;
+
+/**
+ * This transformer sets necessary data provider for each test method.
+ *
+ * @author carcasser
+ */
+public class TestAnnotationTransformer implements IAnnotationTransformer {
+
+ /**
+ * @see IAnnotationTransformer#transform(ITest, Class, Constructor, Method)
+ */
+ public void transform(ITest annotation, Class testClass, Constructor testConstructor, Method testMethod) {
+
+ if ((testClass == null || RichSeleniumTest.class.isAssignableFrom(testClass))
+ && (annotation instanceof TestAnnotation)) {
+ ((TestAnnotation) annotation).setDataProvider("templates");
+ }
+ }
+
+}
\ No newline at end of file
Added: trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/testng/LoginTest.java
===================================================================
--- trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/testng/LoginTest.java (rev 0)
+++ trunk/test-applications/realworld2/tests/src/test/java/org/richfaces/realworld/testng/LoginTest.java 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,73 @@
+/**
+ *
+ */
+package org.richfaces.realworld.testng;
+
+import org.richfaces.realworld.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+public class LoginTest extends SeleniumTestBase {
+
+ static final String usernameId = "loginPanelForm:username";
+ static final String passwordId = "loginPanelForm:password";
+ static final String loginButtonPath= "//td[@class='login-table-col']/input[1]";
+ static final String loggedUserPath = "//a[@class='logged-user']";
+ static final String loginLinkId = "j_id27:loginPanelShowlink";
+ static final String shelfCountPath = "//table[@id='menuform:menu']/tbody/tr/td[2]";
+
+ static final int SHELF_COUNT = 2;
+
+ static final String LOGIN_NAME = "amarkhel";
+ static final String LOGIN_PASSWORD = "12345";
+
+ @Test
+ public void testAuthentication() {
+ renderPage();
+
+ selenium.click("id=" + loginLinkId);
+ try {
+ Thread.sleep(5000);
+ }catch (Exception e) {
+ Assert.fail("Test failed caused by: " + e);
+ }
+
+ AssertVisible(usernameId, "Input for username in not visible");
+ AssertVisible(passwordId, "Input for password in not visible");
+
+ String type = selenium.getAttribute("//*[@id='"+passwordId+"']/@type");
+ if (!"password".equals(type)) {
+ Assert.fail("Password input should be of 'password' type");
+ }
+
+ setValueById(usernameId, LOGIN_NAME);
+ setValueById(passwordId, LOGIN_PASSWORD);
+
+ selenium.click(loginButtonPath);
+ waitForPageToLoad();
+
+ String loggedText = selenium.getText(loggedUserPath);
+ if (!loggedText.contains(LOGIN_NAME)) {
+ Assert.fail("Authentication was not succesfull. Logged user text should contain typed login name");
+ }
+
+ String shelfCount = selenium.getText(shelfCountPath);
+ if (!String.valueOf(SHELF_COUNT).equals(shelfCount)) {
+ Assert.fail("Shelf count for user [" + LOGIN_NAME + "] should be " + SHELF_COUNT + ".But was " + shelfCount);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return "/index.seam";
+ }
+
+}
Added: trunk/test-applications/realworld2/tests/src/test/resources/testng.xml
===================================================================
--- trunk/test-applications/realworld2/tests/src/test/resources/testng.xml (rev 0)
+++ trunk/test-applications/realworld2/tests/src/test/resources/testng.xml 2009-03-10 12:44:21 UTC (rev 12905)
@@ -0,0 +1,12 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDANe">
+ <!-- test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ </test-->
+ <test name="FireFoxFunctionalTestsDANe">
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.realworld.testng" />
+ </packages>
+ </test>
+</suite>
15 years, 10 months
JBoss Rich Faces SVN: r12904 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-03-10 08:29:54 -0400 (Tue, 10 Mar 2009)
New Revision: 12904
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
https://jira.jboss.org/jira/browse/RF-4354
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2009-03-10 12:19:15 UTC (rev 12903)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2009-03-10 12:29:54 UTC (rev 12904)
@@ -494,7 +494,7 @@
var elements = []
element = element.parentNode;
- while (element && element!=window.document)
+ while (element && element!=window.document.body)
{
if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
{
15 years, 10 months
JBoss Rich Faces SVN: r12903 - in trunk/test-applications/realworld2/web/src/main/webapp: stylesheet and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-03-10 08:19:15 -0400 (Tue, 10 Mar 2009)
New Revision: 12903
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Realworld: move styles to css, refactoring
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 12:02:32 UTC (rev 12902)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 12:19:15 UTC (rev 12903)
@@ -302,14 +302,14 @@
.preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
.preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
+.preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute; border: 0px;}
.preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
.preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
.preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
.preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
+.preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute; border: 0px;}
.preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
.preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
@@ -318,21 +318,21 @@
.preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
+.preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute; border: 0px;}
.preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
.preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
.preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
.preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
+.preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute; border: 0px;}
.preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
.preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
.preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
.preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
+.preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute; border: 0px;}
.preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
.preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
15 years, 10 months
JBoss Rich Faces SVN: r12902 - in trunk/test-applications/realworld2/web/src/main: webapp/img/shell and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-03-10 08:02:32 -0400 (Tue, 10 Mar 2009)
New Revision: 12902
Added:
trunk/test-applications/realworld2/web/src/main/webapp/img/shell/avatar_default.png
Modified:
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbums.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Realworld: apply new design for image editing markup, move styles to css
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-10 11:58:49 UTC (rev 12901)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-10 12:02:32 UTC (rev 12902)
@@ -47,10 +47,10 @@
comment.askForFriend=\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443
comment.askForFriend.message=\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043C\u0435\u043D\u044F \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0432\u0430\u0448\u0438\u0445 \u0434\u0440\u0443\u0437\u0435\u0439.
comment.date=\u0414\u0430\u0442\u0430\: \#{comment.date}
-comment.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
+comment.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
comment.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
comment.noComments=\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 \u043A \u044D\u0442\u043E\u0439 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442
-comment.add=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
+comment.add=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C
comment.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
comment.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
@@ -280,4 +280,4 @@
pics=\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439
tags=\u0422\u044D\u0433\u0438
comment.comments=\u041A\u043E\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438
-original_size=\u041E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440
+original_size=\u041E\u0440\u0438\u0433\u0438\u043D\u0430\u043B
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/shell/avatar_default.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/shell/avatar_default.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbums.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 11:58:49 UTC (rev 12901)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 12:02:32 UTC (rev 12902)
@@ -295,7 +295,7 @@
.content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
.preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
-.preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
+.preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute; border: 0px;}
.preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
.preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
@@ -338,9 +338,9 @@
.preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
.preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-.preview_box_photo_nav {width : 50px; height : 50px; position : relative; float : left; margin : 0px 2px 0px 0px;}
-.preview_box_photo_nav img.pr_photo_bg {width : 50px; height : 50px; position : absolute;}
-.preview_box_photo_nav table{position : relative; width : 50px; height : 50px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
+.preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute; border: 0px;}
+.preview_box_photo_nav table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_photo_nav table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
.preview_box_photo_nav table img.sel{margin: 0px 0px 0px 0px; border : 3px solid #DF6400;}
@@ -484,4 +484,126 @@
.dr-insldr-vert-spacer {
padding: 0px;
- }
+}
+
+.shelf-header-table{
+ border-collapse : collapse;
+ margin-bottom : 15px;
+}
+
+.shelf-header-table h1{
+ margin-bottom : 4px;
+}
+
+.shelf-header-table-col2{
+ padding : 8px 0px 0px 20px;
+ vertical-align : top;
+ white-space : nowrap;
+}
+
+.additional-info-text{
+ color : #666666;
+}
+
+.album-header-table{
+ border-collapse : collapse;
+ margin-bottom : 15px;
+}
+
+.album-header-table h1{
+ margin-bottom : 4px;
+}
+
+.album-header-table-col2{
+ padding : 8px 0px 0px 20px;
+ vertical-align : top;
+ white-space : nowrap;
+}
+
+.album-cover-image{
+ border : 2px solid #FFFFFF;
+}
+
+.image-header-table{
+ border-collapse : collapse;
+ margin-bottom : 15px;
+}
+
+.image-header-table h1{
+ margin-bottom : 4px;
+}
+
+.image-header-table-col2{
+ padding : 8px 0px 0px 20px;
+ vertical-align : top;
+ white-space : nowrap;
+}
+
+.image-cover-image{
+ border : 2px solid #FFFFFF;
+}
+
+.mainImage-div{
+ padding-top : 10px;
+}
+
+.mainImage-table{
+ border-collapse : collapse;
+ margin-bottom : 5px;
+}
+
+.mainImage-table-col1{
+ padding-right : 10px;
+ padding-left : 30px;
+ text-align : right;
+}
+
+.mainImage-table-col3{
+ padding-bottom : 5px
+}
+
+.buttons-body{
+ cursor : pointer;
+ margin : 0px 0px 0px 0px;
+ position : relative;
+ width : 103px;
+ height : 28px;
+}
+
+.buttons-body-image{
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ border: 0px;
+}
+.buttons-body-text-div{
+ position : relative;
+ color : #ffffff;
+ top : 7px;
+ left : 8px;
+}
+.buttons-body-spacer-image{
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ border: 0px;
+}
+
+.slideshow-outerdiv{
+ cursor : pointer;
+ margin-bottom : 7px
+}
+
+.comment-table{
+ border-collapse : collapse;
+ margin-bottom : 20px;
+}
+.comment-deleteLink{
+ margin : 1px 0px 7px 0px;
+ background : #f1f1f1;
+ padding : 3px 4px 4px 4px;
+}
+.comment-text{
+ margin : 0px 0px 10px 0px;
+ padding : 0px 4px 0px 4px;
+}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12901 - in trunk/test-applications/realworld2/web/src/main: webapp/includes/misc and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-10 07:58:49 -0400 (Tue, 10 Mar 2009)
New Revision: 12901
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/errorPanel.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
Log:
Add error modal panel
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-10 10:28:21 UTC (rev 12900)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-10 11:58:49 UTC (rev 12901)
@@ -358,6 +358,10 @@
setSelectedImageIndex(index+1);
}
+ public void generateError() {
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("Is not implemented yet!"));
+ }
+
public User getSelectedUser() {
return selectedUser;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-03-10 10:28:21 UTC (rev 12900)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-03-10 11:58:49 UTC (rev 12901)
@@ -105,7 +105,7 @@
}
public boolean isUserAlbum(Album album){
- if(album == null){
+ if(album == null || album.getOwner() == null){
return false;
}
return album.getOwner().equals(user);
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/errorPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12900 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-10 06:28:21 -0400 (Tue, 10 Mar 2009)
New Revision: 12900
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
fix bugs
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 2009-03-09 23:19:03 UTC (rev 12899)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2009-03-10 10:28:21 UTC (rev 12900)
@@ -52,7 +52,9 @@
static final String RESET_METHOD = "#{calendarBean.reset}";
static final String RESET_METHOD2 = "#{calendarBean.reset2}";
-
+
+ static final String RESET_METHOD3 = "#{calendarBean.reset3}";
+
static final String INIT_SHOW_ATTRIBUTES_TEST = "#{calendarBean.initShowAttributesTest}";
static final String INIT_REQUIRED_TEST = "#{calendarBean.initRequiredTest}";
@@ -985,7 +987,7 @@
@Test
public void testValueAndCurrentDateOfCalendarInCaseOfPopupTrue(Template template) {
- renderPage(template, RESET_METHOD);
+ renderPage(template, RESET_METHOD3);
initIds(getParentId());
String expectedSelectedDate = "03/03/2007 11:00";
String expectedCurrentDate = "04/04/2008 13:00";
@@ -1824,7 +1826,7 @@
jointPoint = jointPoint.replaceAll("\\$", WINDOW_JS_RESOLVER + "\\$");
String expression;
if ("==".equals(operation)) {
- expression = "Math.abs(" + calendarPoint + " - " + jointPoint + ") < 2";
+ expression = "Math.abs(" + calendarPoint + " - " + jointPoint + ") <= 2";
} else {
expression = calendarPoint + " " + operation + " " + jointPoint;
}
15 years, 10 months
JBoss Rich Faces SVN: r12899 - in trunk/sandbox: ui/layout/src/main/config/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-03-09 19:19:03 -0400 (Mon, 09 Mar 2009)
New Revision: 12899
Added:
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/layout.xhtml
trunk/sandbox/ui/layout/src/main/config/component/layout.xml
trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/LayoutPosition.java
trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayout.java
trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java
trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayout.jspx
Modified:
trunk/sandbox/ui/layout/src/main/config/component/layoutPanel.xml
trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java
trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayoutPanel.jspx
Log:
layout component created.
Added: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/layout.xhtml
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/pages/layout.xhtml (rev 0)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/pages/layout.xhtml 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,65 @@
+<layout:page xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:layout="http://richfaces.org/layout"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ markupposition="xhtml"
+ contentposition="text/html"
+ theme="#{bean.theme}"
+ width="#{bean.width}"
+ sidebarWidth="#{bean.sidebarWidth}"
+ sidebarPosition="#{bean.position}"
+ headerClass="p_header"
+ footerClass="p_footer"
+ bodyClass="p_body"
+ sidebarClass="p_sidebar"
+ pageTitle="Simple Page Layout"
+ >
+ <f:facet name="pageHeader">
+ <style>
+ .yui-u {text-align: center;}
+ </style>
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Header"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Copyright (c) 2009 RichFaces. All rights reserved."/>
+ </f:facet>
+ <f:facet name="sidebar">
+ <h:form>
+ <h2>Page Attributes</h2>
+ <h:panelGrid columns="2">
+ <h:outputLabel for="theme" value="Page Theme"/>
+ <h:inputText id="theme" value="#{bean.theme}"/>
+ <h:outputLabel for="width" value="Page Width"/>
+ <h:inputText id="width" value="#{bean.width}"/>
+ <h:outputLabel for="sidebarwidth" value="Sidebar Width"/>
+ <h:inputText id="sidebarwidth" value="#{bean.sidebarWidth}"/>
+ <h:outputLabel for="position" value="Side bar position"/>
+ <h:selectOneMenu value="#{bean.position}">
+ <f:selectItem itemValue="left"/>
+ <f:selectItem itemValue="right"/>
+ </h:selectOneMenu>
+ <h:outputLabel for="skin" value="Current skin"/>
+ <h:selectOneMenu binding="#{skinBean.component}">
+ </h:selectOneMenu>
+ <h:commandButton value="Change" action="#{skinBean.change}"></h:commandButton>
+ </h:panelGrid>
+ </h:form>
+ </f:facet>
+
+ <!-- body of the page -->
+
+ <layout:layout>
+ <layout:layoutPanel position="center">Center panel</layout:layoutPanel>
+ <layout:layoutPanel position="left">Left</layout:layoutPanel>
+ <layout:layoutPanel position="right">Right</layout:layoutPanel>
+ <layout:layoutPanel position="top">Top</layout:layoutPanel>
+ <layout:layoutPanel position="bottom">Bottom</layout:layoutPanel>
+
+ </layout:layout>
+
+</layout:page>
\ No newline at end of file
Property changes on: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/layout.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/layout/src/main/config/component/layout.xml
===================================================================
--- trunk/sandbox/ui/layout/src/main/config/component/layout.xml (rev 0)
+++ trunk/sandbox/ui/layout/src/main/config/component/layout.xml 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+
+<components>
+ <component>
+ <name>org.richfaces.Layout</name>
+ <family>org.richfaces.Layout</family>
+ <classname>org.richfaces.component.html.HtmlLayout</classname>
+ <superclass>org.richfaces.component.UILayout</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.LayoutRenderer</name>
+ <template>org/richfaces/htmlLayout.jspx</template>
+ </renderer>
+ <tag>
+ <name>layout</name>
+ <classname>org.richfaces.taglib.LayoutTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ </component>
+</components>
Property changes on: trunk/sandbox/ui/layout/src/main/config/component/layout.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/layout/src/main/config/component/layoutPanel.xml
===================================================================
--- trunk/sandbox/ui/layout/src/main/config/component/layoutPanel.xml 2009-03-09 19:03:51 UTC (rev 12898)
+++ trunk/sandbox/ui/layout/src/main/config/component/layoutPanel.xml 2009-03-09 23:19:03 UTC (rev 12899)
@@ -29,12 +29,11 @@
-->
&ui_component_attributes;
- <property>
- <name>type</name>
- <classname>java.lang.String</classname>
+ <property required="true">
+ <name>position</name>
+ <classname>org.richfaces.component.LayoutPosition</classname>
<description>
</description>
- <defaultvalue>""</defaultvalue>
</property>
</component>
Added: trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/LayoutPosition.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/LayoutPosition.java (rev 0)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/LayoutPosition.java 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+/**
+ * @author asmirnov
+ *
+ */
+public enum LayoutPosition {
+ center,
+ left,
+ right,
+ top,
+ bottom;
+}
Property changes on: trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/LayoutPosition.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayout.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayout.java (rev 0)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayout.java 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIPanel;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UILayout extends UIPanel {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Layout";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Layout";
+
+}
Property changes on: trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayout.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java 2009-03-09 19:03:51 UTC (rev 12898)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java 2009-03-09 23:19:03 UTC (rev 12899)
@@ -16,4 +16,17 @@
public static final String COMPONENT_FAMILY = "org.richfaces.LayoutPanel";
+ /**
+ * Get placement position type name
+ * @return
+ */
+ public abstract LayoutPosition getPosition();
+
+ /**
+ * Set placement position type name
+ * @param newvalue
+ */
+ public abstract void setPosition(LayoutPosition newvalue);
+
+
}
Added: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java (rev 0)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,114 @@
+/**
+ *
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.LayoutPosition;
+import org.richfaces.component.UILayout;
+import org.richfaces.component.UILayoutPanel;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class AbstractLayoutRenderer extends
+ HeaderResourcesRendererBase {
+
+ public void renderLayout(FacesContext context, UILayout layout) throws IOException {
+ // Detect layout content;
+ UILayoutPanel top = null;
+ UILayoutPanel bottom = null;
+ UILayoutPanel left = null;
+ UILayoutPanel right = null;
+ UILayoutPanel center = null;
+ int columns = 0;
+ for (UIComponent child : layout.getChildren()) {
+ if (child instanceof UILayoutPanel) {
+ UILayoutPanel layoutPanel = (UILayoutPanel) child;
+ LayoutPosition position = layoutPanel.getPosition();
+ if( LayoutPosition.top.equals(position)){
+ if(null != top){
+ throw new FacesException("Duplicate layoutPanel's with same position"+position);
+ }
+ top = layoutPanel;
+ } else if( LayoutPosition.bottom.equals(position)){
+ if(null != bottom){
+ throw new FacesException("Duplicate layoutPanel's with same position"+position);
+ }
+ bottom = layoutPanel;
+ } else if( LayoutPosition.left.equals(position)){
+ if(null != left){
+ throw new FacesException("Duplicate layoutPanel's with same position"+position);
+ }
+ left = layoutPanel;
+ columns++;
+ } else if( LayoutPosition.right.equals(position)){
+ if(null != right){
+ throw new FacesException("Duplicate layoutPanel's with same position"+position);
+ }
+ right = layoutPanel;
+ columns++;
+ } else if( null == position || LayoutPosition.center.equals(position)){
+ if(null != center){
+ throw new FacesException("Duplicate layoutPanel's with same position"+position);
+ }
+ center = layoutPanel;
+ columns++;
+ } else {
+
+ }
+ }
+ }
+ if(columns>0 && null == center){
+ throw new FacesException("Center layout panel for multi-column layout is not defined");
+ }
+ ResponseWriter writer = context.getResponseWriter();
+ if(null != top){
+ renderChild(context, top);
+ }
+ if(columns>1){
+ // Render Y! CSS Grid
+ writer.startElement(HTML.DIV_ELEM, layout);
+ // calculate class.
+ String yahooClass = "yui-g";
+ if(columns >2){
+ yahooClass = "yui-gb";
+ } else {
+ Object width = center.getAttributes().get("width");
+ if("75%".equals(width)){
+ yahooClass = "yui-gc";
+ } else if("66%".equals(width)){
+ yahooClass = "yui-gd";
+ }
+ }
+ writer.writeAttribute(HTML.class_ATTRIBUTE, yahooClass, null);
+ if(null != left){
+ left.getAttributes().put("first", "first");
+ center.getAttributes().remove("first");
+ renderChild(context, left);
+ } else {
+ center.getAttributes().put("first", "first");
+ }
+ renderChild(context, center);
+ if(null != right){
+ right.getAttributes().remove("first");
+ renderChild(context, right);
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ } else if (columns == 1) {
+ renderChild(context, center);
+ }
+ if(null != bottom){
+ renderChild(context, bottom);
+ }
+ }
+}
Property changes on: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayout.jspx
===================================================================
--- trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayout.jspx (rev 0)
+++ trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayout.jspx 2009-03-09 23:19:03 UTC (rev 12899)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h="http://jsf.exadel.com/header"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.LayoutRenderer"
+ baseclass="org.richfaces.renderkit.AbstractLayoutRenderer"
+ component="org.richfaces.component.UILayout"
+ >
+ <h:styles>css/grids.css</h:styles>
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ <vcp:body>
+ <f:call name="renderLayout" />
+ </vcp:body>
+
+ </div>
+</f:root>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayout.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayoutPanel.jspx
===================================================================
--- trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayoutPanel.jspx 2009-03-09 19:03:51 UTC (rev 12898)
+++ trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlLayoutPanel.jspx 2009-03-09 23:19:03 UTC (rev 12899)
@@ -12,10 +12,8 @@
component="org.richfaces.component.UILayoutPanel"
>
<f:clientid var="clientId"/>
- <h:styles>css/grids.css</h:styles>
<c:set var="styleClass" value="#{component.attributes['styleClass']}"/>
- <c:set var="yuiClass" value="#{component.attributes['type']}"/>
- <div id="#{clientId}" class="#{styleClass} yui-#{yuiClass}"
+ <div id="#{clientId}" class="yui-u #{component.attributes['first']} #{styleClass}"
x:passThruWithExclusions="type,id, styleClass"
>
<vcp:body>
15 years, 10 months
JBoss Rich Faces SVN: r12898 - trunk/ui/drag-drop/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-09 15:03:51 -0400 (Mon, 09 Mar 2009)
New Revision: 12898
Modified:
trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
Log:
https://jira.jboss.org/jira/browse/RF-5373
Modified: trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2009-03-09 18:36:23 UTC (rev 12897)
+++ trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2009-03-09 19:03:51 UTC (rev 12898)
@@ -75,11 +75,14 @@
</description>
<defaultvalue>""</defaultvalue>
</property>
-
-
- <property hidden="true" >
- <name>actionExpression</name>
- </property>
+
+
+ <property hidden="true" >
+ <name>data</name>
+ </property>
+ <property hidden="true" >
+ <name>actionExpression</name>
+ </property>
<property hidden="true">
<name>ajaxSingle</name>
15 years, 10 months
JBoss Rich Faces SVN: r12897 - in trunk/sandbox: ui/layout/src/main/config/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2009-03-09 14:36:23 -0400 (Mon, 09 Mar 2009)
New Revision: 12897
Modified:
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/ui/layout/src/main/config/component/page.xml
trunk/sandbox/ui/layout/src/main/config/faces/faces-config.xml
trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids-context.css
trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids.css
trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
Log:
violetRays theme has been added
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)
Modified: trunk/sandbox/ui/layout/src/main/config/component/page.xml
===================================================================
--- trunk/sandbox/ui/layout/src/main/config/component/page.xml 2009-03-09 18:31:50 UTC (rev 12896)
+++ trunk/sandbox/ui/layout/src/main/config/component/page.xml 2009-03-09 18:36:23 UTC (rev 12897)
@@ -150,4 +150,8 @@
<name>org.richfaces.CssZendPageRenderer</name>
<template>org/richfaces/cssZendPage.jspx</template>
</renderer>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.VioletRaysRenderer</name>
+ <template>org/richfaces/violetRays.jspx</template>
+ </renderer>
</components>
Modified: trunk/sandbox/ui/layout/src/main/config/faces/faces-config.xml
===================================================================
--- trunk/sandbox/ui/layout/src/main/config/faces/faces-config.xml 2009-03-09 18:31:50 UTC (rev 12896)
+++ trunk/sandbox/ui/layout/src/main/config/faces/faces-config.xml 2009-03-09 18:36:23 UTC (rev 12897)
@@ -9,5 +9,10 @@
<renderer-type>org.richfaces.CssZendPageRenderer</renderer-type>
<renderer-class>org.richfaces.renderkit.html.CssZendRenderer</renderer-class>
</renderer>
+ <renderer>
+ <component-family>org.richfaces.Page</component-family>
+ <renderer-type>org.richfaces.VioletRaysRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.VioletRaysRenderer</renderer-class>
+ </renderer>
</render-kit>
</faces-config>
\ No newline at end of file
Modified: trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids-context.css
===================================================================
--- trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids-context.css 2009-03-09 18:31:50 UTC (rev 12896)
+++ trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids-context.css 2009-03-09 18:36:23 UTC (rev 12897)
@@ -14,8 +14,8 @@
Section: General Rules
*/
.yui-cssgrids body {
- /* center the page */
- text-align: center;
+ /* center the page - removed (SS)*/
+ /* text-align: center; */
margin-left: auto;
margin-right: auto;
}
Modified: trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids.css
===================================================================
--- trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids.css 2009-03-09 18:31:50 UTC (rev 12896)
+++ trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/grids.css 2009-03-09 18:36:23 UTC (rev 12897)
@@ -14,8 +14,8 @@
Section: General Rules
*/
body {
- /* center the page */
- text-align: center;
+ /* center the page - removed (SS)*/
+ /*text-align: center; */
margin-left: auto;
margin-right: auto;
}
Modified: trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
===================================================================
--- trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-09 18:31:50 UTC (rev 12896)
+++ trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-09 18:36:23 UTC (rev 12897)
@@ -8,10 +8,7 @@
<u:style name="font-family" skin="generalFamilyFont" />
<u:style name="margin" value="0" />
<u:style name="padding" value="0" />
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.PageBackgroundGradient"/>
- </u:style>
- <u:style name="background-color" skin="additionalBackgroundColor"/>
+ <u:style name="background-color" value="#FFF"/>
<u:style name="background-repeat" value="repeat-x"/>
</u:selector>
@@ -50,7 +47,7 @@
<u:selector name=".rich-page-footer">
<u:style name="text-align" value="center" />
<u:style name="padding" value="20px 0" />
- <u:style name="background-color" skin="tableFooterBackgroundColor"/>
+ <u:style name="background-color" value="#333"/>
<u:style name="color" skin="trimColor" />
<u:style name="font-size" skin="headerSizeFont" />
</u:selector>
15 years, 10 months
JBoss Rich Faces SVN: r12896 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-03-09 14:31:50 -0400 (Mon, 09 Mar 2009)
New Revision: 12896
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
Log:
RF-6289
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-09 17:53:40 UTC (rev 12895)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-09 18:31:50 UTC (rev 12896)
@@ -15,7 +15,7 @@
</h:inputText>
</h:form>
<h:panelGroup id="panelGroup">
- <rich:hotKey key="#{hotKey.key}" handler="document.getElementById('input').value = '#{hotKey.key}'"/>
+ <rich:hotKey id="hotKey" key="#{hotKey.key}" handler="document.getElementById('input').value = '#{hotKey.key}'"/>
<input id="input" />
</h:panelGroup>
</ui:define>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-09 17:53:40 UTC (rev 12895)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-09 18:31:50 UTC (rev 12896)
@@ -9,12 +9,15 @@
private String key;
+ private String hotKey;
+
private String input;
private void init(Template template) {
renderPage(null, template, "#{dataList.init}");
String attrForm = getParentId() + "attrForm";
key = attrForm + ":key";
+ hotKey = getParentId() + "hotKey";
input = "input";
}
@@ -22,7 +25,7 @@
* Create hotKey component with timing="immediate"
* (or "onload")attribute and check that it works -
* alpha/numeric/arrows/special(ins/del/pgup/pgdn/home/end)/enter/esc keys
- * and check 'key' attribute
+ * and Check 'key' attribute
*/
@Test
public void testKeyAttribute(Template template) {
@@ -90,6 +93,28 @@
}
+ /**
+ * check 'enable()' and 'disable()' JS API functions
+ */
+ @Test
+ public void testDisableFunction(Template template) {
+ init(template);
+ String keySequence = "return";
+ selenium.type(key, keySequence);
+ waitForAjaxCompletion();
+ selenium.runScript("var hotKey = document.getElementById('" + hotKey + "').component");
+ Assert.assertEquals(selenium.getValue(input), "");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), keySequence);
+ selenium.runScript("hotKey.disable()");
+ selenium.type(input, "");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), "");
+ selenium.runScript("hotKey.enable()");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), keySequence);
+ }
+
@Override
public String getTestUrl() {
return "pages/hotKey/hotKey.xhtml";
15 years, 10 months