JBoss Rich Faces SVN: r22720 - in modules/tests/metamer/trunk/application/src/main: resources and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-15 07:54:05 -0400 (Thu, 15 Sep 2011)
New Revision: 22720
Added:
modules/tests/metamer/trunk/application/src/main/resources/audio/
modules/tests/metamer/trunk/application/src/main/resources/audio/alarm.mp3
modules/tests/metamer/trunk/application/src/main/resources/flash/
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementA.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementLink.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementScript.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/flash.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml
Log:
RFPL-1444 (media output): added pages with other elements and updated flash and audio pages (still not working)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java 2011-09-14 13:54:42 UTC (rev 22719)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java 2011-09-15 11:54:05 UTC (rev 22720)
@@ -50,7 +50,9 @@
@RequestScoped
public class A4JMediaOutputBean implements Serializable {
+ public static final String CSS_TEXT = "#mediaOutputMarked { color: red }";
public static final String HTML_TEXT = "<span id='htmlText' style='color: red'>SOME RED HTML TEXT</span>";
+ public static final String JAVASCRIPT_TEXT = "document.write('<span id=mediaOutputJavascriptText>JAVASCRIPT TEXT</span>')";
public static final String PLAIN_TEXT = "SOME PLAIN TEXT";
private static final long serialVersionUID = -1L;
private static Logger logger;
@@ -95,22 +97,13 @@
}
public void createContentAudioMpeg(OutputStream out, Object data) throws IOException {
- InputStream in = null;
- try {
- in = A4JMediaOutputBean.class.getClassLoader().getResourceAsStream("audio/alarm.mp3");
- byte[] dataBytes = new byte[1000];
- int length;
- while((length = in.read(dataBytes)) != 0) {
- out.write(dataBytes, 0, length);
- }
- out.flush();
- } finally {
- if (in != null) {
- in.close();
- }
- }
+ createContentFromResource(out, data, "audio/alarm.mp3");
}
+ public void createContentFlash(OutputStream out, Object data) throws IOException {
+ createContentFromResource(out, data, "flash/text.swf");
+ }
+
public void createContentImagePng(OutputStream out, Object data) throws IOException {
if (data instanceof MediaData) {
MediaData paintData = (MediaData) data;
@@ -134,10 +127,21 @@
}
}
+ public void createContentTextCss(OutputStream out, Object data) throws IOException {
+ out.write(CSS_TEXT.getBytes());
+ out.flush();
+ }
+
public void createContentTextHtml(OutputStream out, Object data) throws IOException {
out.write(HTML_TEXT.getBytes());
+ out.flush();
}
+ public void createContentTextJavascript(OutputStream out, Object data) throws IOException {
+ out.write(JAVASCRIPT_TEXT.getBytes());
+ out.flush();
+ }
+
public void createContentTextPlain(OutputStream out, Object data) throws IOException {
out.write(PLAIN_TEXT.getBytes());
out.flush();
@@ -152,21 +156,15 @@
}
}
- public void paintFlash(OutputStream out, Object data) throws IOException {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- if (loader == null) {
- loader = getClass().getClassLoader();
- }
-
- InputStream stream = loader.getResourceAsStream("resources/flash/text.swf");
-
- if (stream != null) {
- try {
- copy(stream, out);
- } finally {
- stream.close();
+ private void createContentFromResource(OutputStream out, Object data, String resourceName) throws IOException {
+ InputStream in = null;
+ try {
+ in = A4JMediaOutputBean.class.getClassLoader().getResourceAsStream(resourceName);
+ copy(in, out);
+ } finally {
+ if (in != null) {
+ in.close();
}
- }
+ }
}
}
Added: modules/tests/metamer/trunk/application/src/main/resources/audio/alarm.mp3
===================================================================
(Binary files differ)
Property changes on: modules/tests/metamer/trunk/application/src/main/resources/audio/alarm.mp3
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementA.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementA.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementA.xhtml 2011-09-15 11:54:05 UTC (rev 22720)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentTextHtml}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="a"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="text/html"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="#{a4jMediaOutputBean.attributes['type'].value}"
+ uriAttribute="href"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ >
+ This is a link
+ </a4j:mediaOutput>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementA.xhtml
___________________________________________________________________
Added: svn:executable
+ *
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementLink.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementLink.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementLink.xhtml 2011-09-15 11:54:05 UTC (rev 22720)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentTextCss}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="link"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="text/css"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="stylesheet"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="text/css"
+ uriAttribute="href"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ <span id="mediaOutputMarked">This text should be red.</span>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementLink.xhtml
___________________________________________________________________
Added: svn:executable
+ *
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementScript.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementScript.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementScript.xhtml 2011-09-15 11:54:05 UTC (rev 22720)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentTextJavascript}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="script"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="text/javascript"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="text/javascript"
+ uriAttribute="src"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/elementScript.xhtml
___________________________________________________________________
Added: svn:executable
+ *
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/flash.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/flash.xhtml 2011-09-14 13:54:42 UTC (rev 22719)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/flash.xhtml 2011-09-15 11:54:05 UTC (rev 22720)
@@ -42,8 +42,8 @@
<h:outputScript library="script" name="swfobject.js"/>
<a4j:outputPanel id="flashPanelDynamic">
- <a4j:mediaOutput element="a" id="swfLink" style="display: none;" cacheable="false"
- createContent="#{a4jMediaOutputBean.paintFlash}" value="#{mediaData}" />
+ <a4j:mediaOutput element="a" id="swfLink" style="display: none;" mimeType="application/x-shockwave-flash" cacheable="false"
+ createContent="#{a4jMediaOutputBean.createContentFlash}" value="#{mediaData}" />
<a4j:outputPanel layout="block" id="myFlashContent" style="width: 200px; height: 200px">
<a href="http://www.adobe.com/go/getflashplayer">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml 2011-09-14 13:54:42 UTC (rev 22719)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml 2011-09-15 11:54:05 UTC (rev 22720)
@@ -31,25 +31,37 @@
<ui:define name="links">
+ <metamer:testPageLink id="elementA" outcome="elementA" value="Element <a></a>">
+ Simple page that contains <b>a4j:mediaOutput</b> (a, text/html) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="elementLink" outcome="elementLink" value="Element <link/>">
+ Simple page that contains <b>a4j:mediaOutput</b> (link, text/css) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="elementScript" outcome="elementScript" value="Element <script></script>">
+ Simple page that contains <b>a4j:mediaOutput</b> (script, text/javascript) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="imagePng" outcome="imagePng" value="Image Png">
- Simple page that contains <b>a4j:mediaOutput</b> (image/png) and input boxes for all its attributes.
+ Simple page that contains <b>a4j:mediaOutput</b> (img, image/png) and input boxes for all its attributes.
</metamer:testPageLink>
<metamer:testPageLink id="textHtml" outcome="textHtml" value="Text HTML">
- Simple page that contains <b>a4j:mediaOutput</b> (text/html) and input boxes for all its attributes.
+ Simple page that contains <b>a4j:mediaOutput</b> (object, text/html) and input boxes for all its attributes.
</metamer:testPageLink>
<metamer:testPageLink id="textPlain" outcome="textPlain" value="Text Plain">
- Simple page that contains <b>a4j:mediaOutput</b> (text/plain) and input boxes for all its attributes.
+ Simple page that contains <b>a4j:mediaOutput</b> (object, text/plain) and input boxes for all its attributes.
</metamer:testPageLink>
<ui:remove>
<metamer:testPageLink id="audioMpeg" outcome="audioMpeg" value="Audio Mpeg">
- Simple page that contains <b>a4j:mediaOutput</b> (audio/mpeg) and input boxes for all its attributes.
- </metamer:testPageLink>
+ Simple page that contains <b>a4j:mediaOutput</b> (object, audio/mpeg) and input boxes for all its attributes.
+ </metamer:testPageLink>
<metamer:testPageLink id="flash" outcome="flash" value="Flash">
Simple page that contains <b>a4j:mediaOutput</b> (flash) and input boxes for all its attributes.
- </metamer:testPageLink>
+ </metamer:testPageLink>
</ui:remove>
</ui:define>
13 years, 3 months
JBoss Rich Faces SVN: r22719 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-14 09:54:42 -0400 (Wed, 14 Sep 2011)
New Revision: 22719
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/AbstractMediaOutputTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImagePng.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextHtml.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextPlain.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
Log:
RFPL-1444 (media output): tests for other mime types
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/AbstractMediaOutputTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/AbstractMediaOutputTest.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/AbstractMediaOutputTest.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public abstract class AbstractMediaOutputTest extends AbstractMetamerTest {
+
+ protected static final JQueryLocator MEDIA_OUTPUT = pjq("*[id$=mediaOutput]");
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestAttributes.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for attributes (page /faces/components/a4jMediaOutput/imagePng.xhtml)
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestAttributes extends AbstractMediaOutputTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jMediaOutput/imagePng.xhtml");
+ }
+
+ @Test
+ public void testAccesskey() {
+ testHtmlAttribute(MEDIA_OUTPUT, "accesskey", "r");
+ }
+
+ @Test
+ public void testAlign() {
+ testHtmlAttribute(MEDIA_OUTPUT, "align", "left");
+ }
+
+ @Test
+ public void testBorder() {
+ testHtmlAttribute(MEDIA_OUTPUT, "border", "3");
+ }
+
+ @Test
+ public void testCharset() {
+ testHtmlAttribute(MEDIA_OUTPUT, "charset", "utf-8");
+ }
+
+ @Test
+ public void testCoords() {
+ testHtmlAttribute(MEDIA_OUTPUT, "coords", "circle: 150, 60, 60");
+ }
+
+ @Test
+ public void testDir() {
+ testDir(MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testHreflang() {
+ testHtmlAttribute(MEDIA_OUTPUT, "hreflang", "sk");
+ }
+
+ @Test
+ public void testIsmap() {
+ AttributeLocator<?> attr = MEDIA_OUTPUT.getAttribute(new Attribute("ismap"));
+ assertFalse(selenium.isAttributePresent(attr), "Attribute ismap should not be present.");
+
+ selenium.click(pjq("input[type=radio][name$=ismapInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.isAttributePresent(attr), "Attribute ismap should be present.");
+ assertEquals(selenium.getAttribute(attr), "ismap", "Attribute dir");
+ }
+
+ @Test
+ public void testOnblur() {
+ testFireEvent(Event.BLUR, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOndblclick() {
+ testFireEvent(Event.DBLCLICK, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnfocus() {
+ testFireEvent(Event.FOCUS, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnkeydown() {
+ testFireEvent(Event.KEYDOWN, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnkeypress() {
+ testFireEvent(Event.KEYPRESS, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnkeyup() {
+ testFireEvent(Event.KEYUP, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testRel() {
+ testHtmlAttribute(MEDIA_OUTPUT, "rel", "metamer");
+ }
+
+ @Test
+ public void testRendered() {
+ JQueryLocator input = pjq("input[type=radio][name$=renderedInput][value=false]");
+ selenium.click(input);
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(MEDIA_OUTPUT), "Image should not be rendered when rendered=false.");
+ }
+
+ @Test
+ public void testRev() {
+ testHtmlAttribute(MEDIA_OUTPUT, "rev", "metamer");
+ }
+
+ @Test
+ public void testShape() {
+ testHtmlAttribute(MEDIA_OUTPUT, "shape", "default");
+ }
+
+ @Test
+ public void testStyle() {
+ testStyle(MEDIA_OUTPUT, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ testStyleClass(MEDIA_OUTPUT, "styleClass");
+ }
+
+ @Test
+ public void testTabindex() {
+ testHtmlAttribute(MEDIA_OUTPUT, "tabindex", "50");
+ }
+
+ @Test
+ public void testTarget() {
+ testHtmlAttribute(MEDIA_OUTPUT, "target", "_blank");
+ }
+
+ @Test
+ public void testTitle() {
+ testTitle(MEDIA_OUTPUT);
+ }
+
+ @Test
+ public void testUsemap() {
+ testHtmlAttribute(MEDIA_OUTPUT, "usemap", "metamer");
+ }
+
+}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-09-14 13:52:49 UTC (rev 22718)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
-
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import java.awt.Color;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.imageio.ImageIO;
-
-import org.jboss.test.selenium.dom.Event;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.testng.annotations.Test;
-
-/**
- * Test case for page /faces/components/a4jMediaOutput/image.xhtml
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-public class TestImage extends AbstractMetamerTest {
-
- private JQueryLocator image = pjq("img[id$=mediaOutput]");
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/a4jMediaOutput/image.xhtml");
- }
-
- @Test
- public void testImage() {
- AttributeLocator imageURLAttr = image.getAttribute(Attribute.SRC);
- URL imageURL = buildUrl(contextRoot, selenium.getAttribute(imageURLAttr));
-
- BufferedImage bufferedImage = null;
-
- try {
- bufferedImage = ImageIO.read(imageURL);
- } catch (IOException ex) {
- fail("Could not download image from URL " + imageURL.getPath());
- }
-
- assertEquals(bufferedImage.getHeight(), 120, "Height of the image");
- assertEquals(bufferedImage.getWidth(), 300, "Width of the image");
-
- for (int x = 0; x < 150; x++) {
- for (int y = 0; y < 60; y++) {
- assertEquals(bufferedImage.getRGB(x, y), Color.YELLOW.getRGB(), "Top-left quadrant should be yellow [" + x + ", " + y + "].");
- }
- }
-
- for (int x = 150; x < 300; x++) {
- for (int y = 0; y < 60; y++) {
- assertEquals(bufferedImage.getRGB(x, y), Color.RED.getRGB(), "Top-right quadrant should be red [" + x + ", " + y + "].");
- }
- }
-
- for (int x = 0; x < 150; x++) {
- for (int y = 60; y < 120; y++) {
- assertEquals(bufferedImage.getRGB(x, y), Color.BLUE.getRGB(), "Bottom-left quadrant should be blue [" + x + ", " + y + "].");
- }
- }
-
- for (int x = 150; x < 300; x++) {
- for (int y = 60; y < 120; y++) {
- assertEquals(bufferedImage.getRGB(x, y), Color.GREEN.getRGB(), "Bottom-right quadrant should be yellow [" + x + ", " + y + "].");
- }
- }
- }
-
- @Test
- public void testAccesskey() {
- testHtmlAttribute(image, "accesskey", "r");
- }
-
- @Test
- public void testAlign() {
- testHtmlAttribute(image, "align", "left");
- }
-
- @Test
- public void testBorder() {
- testHtmlAttribute(image, "border", "3");
- }
-
- @Test
- public void testCharset() {
- testHtmlAttribute(image, "charset", "utf-8");
- }
-
- @Test
- public void testCoords() {
- testHtmlAttribute(image, "coords", "circle: 150, 60, 60");
- }
-
- @Test
- public void testDir() {
- testDir(image);
- }
-
- @Test
- public void testHreflang() {
- testHtmlAttribute(image, "hreflang", "sk");
- }
-
- @Test
- public void testIsmap() {
- AttributeLocator<?> attr = image.getAttribute(new Attribute("ismap"));
- assertFalse(selenium.isAttributePresent(attr), "Attribute ismap should not be present.");
-
- selenium.click(pjq("input[type=radio][name$=ismapInput][value=true]"));
- selenium.waitForPageToLoad();
-
- assertTrue(selenium.isAttributePresent(attr), "Attribute ismap should be present.");
- assertEquals(selenium.getAttribute(attr), "ismap", "Attribute dir");
- }
-
- @Test
- public void testOnblur() {
- testFireEvent(Event.BLUR, image);
- }
-
- @Test
- public void testOnclick() {
- testFireEvent(Event.CLICK, image);
- }
-
- @Test
- public void testOndblclick() {
- testFireEvent(Event.DBLCLICK, image);
- }
-
- @Test
- public void testOnfocus() {
- testFireEvent(Event.FOCUS, image);
- }
-
- @Test
- public void testOnkeydown() {
- testFireEvent(Event.KEYDOWN, image);
- }
-
- @Test
- public void testOnkeypress() {
- testFireEvent(Event.KEYPRESS, image);
- }
-
- @Test
- public void testOnkeyup() {
- testFireEvent(Event.KEYUP, image);
- }
-
- @Test
- public void testOnmousedown() {
- testFireEvent(Event.MOUSEDOWN, image);
- }
-
- @Test
- public void testOnmousemove() {
- testFireEvent(Event.MOUSEMOVE, image);
- }
-
- @Test
- public void testOnmouseout() {
- testFireEvent(Event.MOUSEOUT, image);
- }
-
- @Test
- public void testOnmouseover() {
- testFireEvent(Event.MOUSEOVER, image);
- }
-
- @Test
- public void testOnmouseup() {
- testFireEvent(Event.MOUSEUP, image);
- }
-
- @Test
- public void testRel() {
- testHtmlAttribute(image, "rel", "metamer");
- }
-
- @Test
- public void testRendered() {
- JQueryLocator input = pjq("input[type=radio][name$=renderedInput][value=false]");
- selenium.click(input);
- selenium.waitForPageToLoad();
-
- assertFalse(selenium.isElementPresent(image), "Image should not be rendered when rendered=false.");
- }
-
- @Test
- public void testRev() {
- testHtmlAttribute(image, "rev", "metamer");
- }
-
- @Test
- public void testShape() {
- testHtmlAttribute(image, "shape", "default");
- }
-
- @Test
- public void testStyle() {
- testStyle(image, "style");
- }
-
- @Test
- public void testStyleClass() {
- testStyleClass(image, "styleClass");
- }
-
- @Test
- public void testTabindex() {
- testHtmlAttribute(image, "tabindex", "50");
- }
-
- @Test
- public void testTarget() {
- testHtmlAttribute(image, "target", "_blank");
- }
-
- @Test
- public void testTitle() {
- testTitle(image);
- }
-
- @Test
- public void testUsemap() {
- testHtmlAttribute(image, "usemap", "metamer");
- }
-}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImagePng.java (from rev 22702, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImagePng.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImagePng.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/a4jMediaOutput/imagePng.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestImagePng extends AbstractMediaOutputTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jMediaOutput/imagePng.xhtml");
+ }
+
+ @Test
+ public void testImage() {
+ AttributeLocator imageURLAttr = MEDIA_OUTPUT.getAttribute(Attribute.SRC);
+ URL imageURL = buildUrl(contextRoot, selenium.getAttribute(imageURLAttr));
+
+ BufferedImage bufferedImage = null;
+
+ try {
+ bufferedImage = ImageIO.read(imageURL);
+ } catch (IOException ex) {
+ fail("Could not download image from URL " + imageURL.getPath());
+ }
+
+ assertEquals(bufferedImage.getHeight(), 120, "Height of the image");
+ assertEquals(bufferedImage.getWidth(), 300, "Width of the image");
+
+ for (int x = 0; x < 150; x++) {
+ for (int y = 0; y < 60; y++) {
+ assertEquals(bufferedImage.getRGB(x, y), Color.YELLOW.getRGB(), "Top-left quadrant should be yellow [" + x + ", " + y + "].");
+ }
+ }
+
+ for (int x = 150; x < 300; x++) {
+ for (int y = 0; y < 60; y++) {
+ assertEquals(bufferedImage.getRGB(x, y), Color.RED.getRGB(), "Top-right quadrant should be red [" + x + ", " + y + "].");
+ }
+ }
+
+ for (int x = 0; x < 150; x++) {
+ for (int y = 60; y < 120; y++) {
+ assertEquals(bufferedImage.getRGB(x, y), Color.BLUE.getRGB(), "Bottom-left quadrant should be blue [" + x + ", " + y + "].");
+ }
+ }
+
+ for (int x = 150; x < 300; x++) {
+ for (int y = 60; y < 120; y++) {
+ assertEquals(bufferedImage.getRGB(x, y), Color.GREEN.getRGB(), "Bottom-right quadrant should be yellow [" + x + ", " + y + "].");
+ }
+ }
+ }
+
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextHtml.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextHtml.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextHtml.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.richfaces.tests.metamer.bean.a4j.A4JMediaOutputBean;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestTextHtml extends AbstractMediaOutputTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jMediaOutput/textHtml.xhtml");
+ }
+
+ @Test
+ public void testInit() throws IOException {
+ AttributeLocator urlAttr = MEDIA_OUTPUT.getAttribute(Attribute.DATA);
+ URL url = buildUrl(contextRoot, selenium.getAttribute(urlAttr));
+ BufferedReader input = null;
+ StringBuilder foundContent = new StringBuilder();
+ try {
+ input = new BufferedReader(new InputStreamReader(url.openStream()));
+ String line;
+ while((line = input.readLine()) != null) {
+ foundContent.append(line);
+ }
+ } finally {
+ if (input != null) {
+ input.close();
+ }
+ }
+ assertTrue(foundContent.toString().contains(A4JMediaOutputBean.HTML_TEXT));
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextPlain.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextPlain.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestTextPlain.java 2011-09-14 13:54:42 UTC (rev 22719)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jMediaOutput;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.richfaces.tests.metamer.bean.a4j.A4JMediaOutputBean;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestTextPlain extends AbstractMediaOutputTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jMediaOutput/textPlain.xhtml");
+ }
+
+ @Test
+ public void testInit() throws IOException {
+ AttributeLocator urlAttr = MEDIA_OUTPUT.getAttribute(Attribute.DATA);
+ URL url = buildUrl(contextRoot, selenium.getAttribute(urlAttr));
+ BufferedReader input = null;
+ StringBuilder foundContent = new StringBuilder();
+ try {
+ input = new BufferedReader(new InputStreamReader(url.openStream()));
+ String line;
+ while((line = input.readLine()) != null) {
+ foundContent.append(line);
+ }
+ } finally {
+ if (input != null) {
+ input.close();
+ }
+ }
+ assertTrue(foundContent.toString().contains(A4JMediaOutputBean.PLAIN_TEXT));
+ }
+
+}
13 years, 3 months
JBoss Rich Faces SVN: r22718 - in modules/tests/metamer/trunk/application/src/main: webapp/components/a4jMediaOutput and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-14 09:52:49 -0400 (Wed, 14 Sep 2011)
New Revision: 22718
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/audioMpeg.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/imagePng.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textHtml.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textPlain.xhtml
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/image.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml
Log:
RFPL-1444 (media output): added pages with other mime types
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java 2011-09-14 08:47:24 UTC (rev 22717)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java 2011-09-14 13:52:49 UTC (rev 22718)
@@ -50,10 +50,12 @@
@RequestScoped
public class A4JMediaOutputBean implements Serializable {
+ public static final String HTML_TEXT = "<span id='htmlText' style='color: red'>SOME RED HTML TEXT</span>";
+ public static final String PLAIN_TEXT = "SOME PLAIN TEXT";
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
-
+
/**
* Initializes the managed bean.
*/
@@ -92,7 +94,24 @@
this.attributes = attributes;
}
- public void paint(OutputStream out, Object data) throws IOException {
+ public void createContentAudioMpeg(OutputStream out, Object data) throws IOException {
+ InputStream in = null;
+ try {
+ in = A4JMediaOutputBean.class.getClassLoader().getResourceAsStream("audio/alarm.mp3");
+ byte[] dataBytes = new byte[1000];
+ int length;
+ while((length = in.read(dataBytes)) != 0) {
+ out.write(dataBytes, 0, length);
+ }
+ out.flush();
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ }
+
+ public void createContentImagePng(OutputStream out, Object data) throws IOException {
if (data instanceof MediaData) {
MediaData paintData = (MediaData) data;
BufferedImage img = new BufferedImage(paintData.getWidth(), paintData.getHeight(), BufferedImage.TYPE_INT_RGB);
@@ -115,6 +134,15 @@
}
}
+ public void createContentTextHtml(OutputStream out, Object data) throws IOException {
+ out.write(HTML_TEXT.getBytes());
+ }
+
+ public void createContentTextPlain(OutputStream out, Object data) throws IOException {
+ out.write(PLAIN_TEXT.getBytes());
+ out.flush();
+ }
+
private void copy(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[2048];
int read;
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/audioMpeg.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/audioMpeg.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/audioMpeg.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentAudioMpeg}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="object"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="audio/mpeg"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="#{a4jMediaOutputBean.attributes['type'].value}"
+ uriAttribute="data"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/audioMpeg.xhtml
___________________________________________________________________
Added: svn:executable
+ *
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/image.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/image.xhtml 2011-09-14 08:47:24 UTC (rev 22717)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/image.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
-
- <!--
-JBoss, Home of Professional Open Source
-Copyright 2010-2011, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-This software 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 software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
- -->
-
- <ui:composition template="/templates/template.xhtml">
-
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
-
- <ui:define name="head"/>
-
- <ui:define name="component">
- <a4j:mediaOutput id="mediaOutput"
- accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
- align="#{a4jMediaOutputBean.attributes['align'].value}"
- archive="#{a4jMediaOutputBean.attributes['archive'].value}"
- border="#{a4jMediaOutputBean.attributes['border'].value}"
- cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
- charset="#{a4jMediaOutputBean.attributes['charset'].value}"
- classid="#{a4jMediaOutputBean.attributes['classid'].value}"
- codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
- codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
- converter="#{a4jMediaOutputBean.attributes['converter'].value}"
- coords="#{a4jMediaOutputBean.attributes['coords'].value}"
- createContent="#{a4jMediaOutputBean.paint}"
- declare="#{a4jMediaOutputBean.attributes['declare'].value}"
- dir="#{a4jMediaOutputBean.attributes['dir'].value}"
- element="img"
- expires="#{a4jMediaOutputBean.attributes['expires'].value}"
- hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
- hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
- ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
- lang="#{a4jMediaOutputBean.attributes['lang'].value}"
- lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
- mimeType="image/png"
- onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
- onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
- ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
- onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
- onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
- onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
- onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
- onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
- onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
- onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
- onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
- onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
- rel="#{a4jMediaOutputBean.attributes['rel'].value}"
- rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
- rev="#{a4jMediaOutputBean.attributes['rev'].value}"
- shape="#{a4jMediaOutputBean.attributes['shape'].value}"
- standby="#{a4jMediaOutputBean.attributes['standby'].value}"
- style="#{a4jMediaOutputBean.attributes['style'].value}"
- styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
- tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
- target="#{a4jMediaOutputBean.attributes['target'].value}"
- title="#{a4jMediaOutputBean.attributes['title'].value}"
- type="#{a4jMediaOutputBean.attributes['type'].value}"
- uriAttribute="src"
- usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
- value="#{mediaData}"
- vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
- />
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/imagePng.xhtml (from rev 22702, modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/image.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/imagePng.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/imagePng.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentImagePng}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="img"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="image/png"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="#{a4jMediaOutputBean.attributes['type'].value}"
+ uriAttribute="src"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml 2011-09-14 08:47:24 UTC (rev 22717)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/list.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -31,11 +31,22 @@
<ui:define name="links">
- <metamer:testPageLink id="image" outcome="image" value="Image">
- Simple page that contains <b>a4j:mediaOutput</b> (image) and input boxes for all its attributes.
+ <metamer:testPageLink id="imagePng" outcome="imagePng" value="Image Png">
+ Simple page that contains <b>a4j:mediaOutput</b> (image/png) and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="textHtml" outcome="textHtml" value="Text HTML">
+ Simple page that contains <b>a4j:mediaOutput</b> (text/html) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="textPlain" outcome="textPlain" value="Text Plain">
+ Simple page that contains <b>a4j:mediaOutput</b> (text/plain) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
<ui:remove>
+ <metamer:testPageLink id="audioMpeg" outcome="audioMpeg" value="Audio Mpeg">
+ Simple page that contains <b>a4j:mediaOutput</b> (audio/mpeg) and input boxes for all its attributes.
+ </metamer:testPageLink>
<metamer:testPageLink id="flash" outcome="flash" value="Flash">
Simple page that contains <b>a4j:mediaOutput</b> (flash) and input boxes for all its attributes.
</metamer:testPageLink>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textHtml.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textHtml.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textHtml.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentTextHtml}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="object"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="text/html"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="#{a4jMediaOutputBean.attributes['type'].value}"
+ uriAttribute="data"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textHtml.xhtml
___________________________________________________________________
Added: svn:executable
+ *
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textPlain.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textPlain.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textPlain.xhtml 2011-09-14 13:52:49 UTC (rev 22718)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+ <a4j:mediaOutput id="mediaOutput"
+ accesskey="#{a4jMediaOutputBean.attributes['accesskey'].value}"
+ align="#{a4jMediaOutputBean.attributes['align'].value}"
+ archive="#{a4jMediaOutputBean.attributes['archive'].value}"
+ border="#{a4jMediaOutputBean.attributes['border'].value}"
+ cacheable="#{a4jMediaOutputBean.attributes['cacheable'].value}"
+ charset="#{a4jMediaOutputBean.attributes['charset'].value}"
+ classid="#{a4jMediaOutputBean.attributes['classid'].value}"
+ codebase="#{a4jMediaOutputBean.attributes['codebase'].value}"
+ codetype="#{a4jMediaOutputBean.attributes['codetype'].value}"
+ converter="#{a4jMediaOutputBean.attributes['converter'].value}"
+ coords="#{a4jMediaOutputBean.attributes['coords'].value}"
+ createContent="#{a4jMediaOutputBean.createContentTextPlain}"
+ declare="#{a4jMediaOutputBean.attributes['declare'].value}"
+ dir="#{a4jMediaOutputBean.attributes['dir'].value}"
+ element="object"
+ expires="#{a4jMediaOutputBean.attributes['expires'].value}"
+ hreflang="#{a4jMediaOutputBean.attributes['hreflang'].value}"
+ hspace="#{a4jMediaOutputBean.attributes['hspace'].value}"
+ ismap="#{a4jMediaOutputBean.attributes['ismap'].value}"
+ lang="#{a4jMediaOutputBean.attributes['lang'].value}"
+ lastModified="#{a4jMediaOutputBean.attributes['lastModified'].value}"
+ mimeType="text/plain"
+ onblur="#{a4jMediaOutputBean.attributes['onblur'].value}"
+ onclick="#{a4jMediaOutputBean.attributes['onclick'].value}"
+ ondblclick="#{a4jMediaOutputBean.attributes['ondblclick'].value}"
+ onfocus="#{a4jMediaOutputBean.attributes['onfocus'].value}"
+ onkeydown="#{a4jMediaOutputBean.attributes['onkeydown'].value}"
+ onkeypress="#{a4jMediaOutputBean.attributes['onkeypress'].value}"
+ onkeyup="#{a4jMediaOutputBean.attributes['onkeyup'].value}"
+ onmousedown="#{a4jMediaOutputBean.attributes['onmousedown'].value}"
+ onmousemove="#{a4jMediaOutputBean.attributes['onmousemove'].value}"
+ onmouseout="#{a4jMediaOutputBean.attributes['onmouseout'].value}"
+ onmouseover="#{a4jMediaOutputBean.attributes['onmouseover'].value}"
+ onmouseup="#{a4jMediaOutputBean.attributes['onmouseup'].value}"
+ rel="#{a4jMediaOutputBean.attributes['rel'].value}"
+ rendered="#{a4jMediaOutputBean.attributes['rendered'].value}"
+ rev="#{a4jMediaOutputBean.attributes['rev'].value}"
+ shape="#{a4jMediaOutputBean.attributes['shape'].value}"
+ standby="#{a4jMediaOutputBean.attributes['standby'].value}"
+ style="#{a4jMediaOutputBean.attributes['style'].value}"
+ styleClass="#{a4jMediaOutputBean.attributes['styleClass'].value}"
+ tabindex="#{a4jMediaOutputBean.attributes['tabindex'].value}"
+ target="#{a4jMediaOutputBean.attributes['target'].value}"
+ title="#{a4jMediaOutputBean.attributes['title'].value}"
+ type="#{a4jMediaOutputBean.attributes['type'].value}"
+ uriAttribute="data"
+ usemap="#{a4jMediaOutputBean.attributes['usemap'].value}"
+ value="#{mediaData}"
+ vspace="#{a4jMediaOutputBean.attributes['vspace'].value}"
+ />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jMediaOutputBean.attributes}" id="attributes" render="panel"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jMediaOutput/textPlain.xhtml
___________________________________________________________________
Added: svn:executable
+ *
13 years, 3 months
JBoss Rich Faces SVN: r22717 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richOrderingList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-14 04:47:24 -0400 (Wed, 14 Sep 2011)
New Revision: 22717
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/OrderingListAttributes.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
Log:
RFPL-1547 (ordering list): added some tests, mainly for events
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java 2011-09-14 06:59:17 UTC (rev 22716)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java 2011-09-14 08:47:24 UTC (rev 22717)
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.tests.metamer.ftest.model;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
@@ -22,8 +43,10 @@
private final JQueryLocator header = pjq("thead.rf-ord-lst-header > tr");
private final JQueryLocator item = pjq("tbody[id$=orderingListItems] > tr.rf-ord-opt");
private final JQueryLocator itemSelected = pjq("tbody[id$=orderingListItems] > tr.rf-ord-opt.rf-ord-sel");
- private final JQueryLocator list = pjq("div.rf-ord-lst-scrl");
+ private final JQueryLocator list = pjq("div[id$=orderingList] div.rf-ord-lst-dcrtn");
+ private final JQueryLocator listArea = pjq("div[id$=orderingList] td:eq(0)");
private final JQueryLocator orderingList = pjq("div[id$=orderingList]");
+ private final JQueryLocator scrollableArea = pjq("div.rf-ord-lst-scrl");
private int numberOfItems = -1;
private int numberOfColumns = -1;
private final AjaxSelenium selenium;
@@ -71,6 +94,10 @@
return list;
}
+ public JQueryLocator getListArea() {
+ return listArea;
+ }
+
public JQueryLocator getLocator() {
return orderingList;
}
@@ -89,6 +116,10 @@
return numberOfItems;
}
+ public JQueryLocator getScrollableArea() {
+ return scrollableArea;
+ }
+
public boolean isButtonBottomEnabled() {
return isButtonEnabled(buttonBottom);
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java 2011-09-14 06:59:17 UTC (rev 22716)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java 2011-09-14 08:47:24 UTC (rev 22717)
@@ -24,9 +24,12 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.NegationCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.model.OrderingList;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import org.richfaces.tests.metamer.ftest.attributes.Attributes;
/**
* Abstract test case for pages faces/components/richOrderingList/
@@ -37,6 +40,12 @@
private OrderingList orderingList = new OrderingList();
+ private JQueryLocator requestTime = jq("span#requestTime");
+
+ private JQueryLocator submitButton = pjq("input[id$=submitButton]");
+
+ protected static final Attributes<OrderingListAttributes> ATTRIBUTES = new Attributes<OrderingListAttributes>();
+
protected void checkButtonsBottom() {
assertFalse(orderingList.isButtonBottomEnabled(), "The button [bottom] should be disabled.");
assertFalse(orderingList.isButtonDownEnabled(), "The button [down] should be disabled.");
@@ -129,6 +138,12 @@
assertTrue(selenium.belongsClass(getOrderingList().getItem(index), "rf-ord-sel"), "After selecting an item, the item should belong to the class <rf-ord-sel>.");
}
+ protected void submit() {
+ String timeBefore = selenium.getText(requestTime);
+ selenium.click(submitButton);
+ selenium.waitForPageToLoad();
+ }
+
private void checkColumnValuesSwapped(int indexA, String stateA, String cityA, int indexB, String stateB, String cityB) {
assertEquals(orderingList.getItemColumnValue(indexA, 0), stateB, "The rows weren't swapped succesfully after moving.");
assertEquals(orderingList.getItemColumnValue(indexA, 1), cityB, "The rows weren't swapped succesfully after moving.");
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/OrderingListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/OrderingListAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/OrderingListAttributes.java 2011-09-14 08:47:24 UTC (rev 22717)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richOrderingList;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public enum OrderingListAttributes implements AttributeEnum{
+
+ columnClasses,
+ columnVar,
+ converter,
+ converterMessage,
+ disabled,
+ disabledClass,
+ downBottomText,
+ downText,
+ headerClass,
+ immediate,
+ itemClass,
+ itemLabel,
+ itemValue,
+ listHeight,
+ listWidth,
+ maxListHeight,
+ minListHeight,
+ onblur,
+ onchange,
+ onclick,
+ ondblclick,
+ onfocus,
+ onkeydown,
+ onkeypress,
+ onkeyup,
+ onlistclick,
+ onlistdblclick,
+ onlistkeydown,
+ onlistkeypress,
+ onlistkeyup,
+ onlistmousedown,
+ onlistmousemove,
+ onlistmouseout,
+ onlistmouseover,
+ onlistmouseup,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ rendered,
+ required,
+ requiredMessage,
+ selectItemClass,
+ style,
+ styleClass,
+ upText,
+ upTopText,
+ validator,
+ validatorMessage,
+ value,
+ valueChangeListener,
+ var
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java 2011-09-14 06:59:17 UTC (rev 22716)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java 2011-09-14 08:47:24 UTC (rev 22717)
@@ -28,6 +28,7 @@
import org.testng.annotations.Test;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
/**
* Selenium tests for page faces/components/richOrderingList/withColumn.xhtml.
@@ -37,8 +38,6 @@
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
public class TestOrderingList extends AbstractOrderingListTest {
-
- private OrderingList orderingList = new OrderingList();
@Override
public URL getTestUrl() {
@@ -47,30 +46,39 @@
@Test
public void testInit() {
- assertTrue(orderingList.isOrderingListPresent(), "The ordering list should be present.");
- assertFalse(orderingList.isButtonBottomEnabled(), "The button [bottom] should be disabled.");
- assertFalse(orderingList.isButtonDownEnabled(), "The button [down] should be disabled.");
- assertFalse(orderingList.isButtonTopEnabled(), "The button [top] should be disabled.");
- assertFalse(orderingList.isButtonUpEnabled(), "The button [up] should be disabled.");
+ assertTrue(getOrderingList().isOrderingListPresent(), "The ordering list should be present.");
+ assertFalse(getOrderingList().isButtonBottomEnabled(), "The button [bottom] should be disabled.");
+ assertFalse(getOrderingList().isButtonDownEnabled(), "The button [down] should be disabled.");
+ assertFalse(getOrderingList().isButtonTopEnabled(), "The button [top] should be disabled.");
+ assertFalse(getOrderingList().isButtonUpEnabled(), "The button [up] should be disabled.");
}
@Test
public void testSelectFirst() {
- orderingList.selectItem(0);
+ getOrderingList().selectItem(0);
checkButtonsTop();
}
@Test
public void testSelectLast() {
- orderingList.selectItem(orderingList.getNumberOfItems() - 1);
+ getOrderingList().selectItem(getOrderingList().getNumberOfItems() - 1);
checkButtonsBottom();
}
@Test
public void testSelectMiddle() {
- orderingList.selectItem(2);
+ getOrderingList().selectItem(2);
checkButtonsMiddle();
}
+ @Test
+ public void testSubmit() {
+ getOrderingList().selectItem(1);
+ getOrderingList().moveTop();
+ String expectedState = getOrderingList().getItemColumnValue(0, 0);
+ submit();
+ String foundState = getOrderingList().getItemColumnValue(0, 0);
+ assertEquals(expectedState, foundState, "After submitting the ordering list doesn't preserve the chosen order.");
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-09-14 06:59:17 UTC (rev 22716)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-09-14 08:47:24 UTC (rev 22717)
@@ -25,16 +25,21 @@
import java.util.HashMap;
import java.util.Map;
+import javax.swing.plaf.basic.BasicInternalFrameTitlePane.RestoreAction;
+
import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.URLUtils;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.model.OrderingList;
import org.testng.annotations.Test;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
/**
* Selenium tests for page faces/components/richOrderingList/withColumn.xhtml.
@@ -42,7 +47,7 @@
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
public class TestOrderingListAttributes extends AbstractOrderingListTest {
-
+
@Override
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/withColumn.xhtml");
@@ -50,7 +55,7 @@
@Test
public void testColumnClasses() {
- fillAttribute("columnClasses", "some-class");
+ ATTRIBUTES.set(OrderingListAttributes.columnClasses, "some-class");
for (int i=0; i<getOrderingList().getNumberOfColumns(); i++) {
assertTrue(selenium.belongsClass(getOrderingList().getItemColumn(0, i), "some-class"), "The column <" + i + "> doesn't belong to set class <some-class>.");
}
@@ -58,7 +63,7 @@
@Test
public void testDisabled() {
- fillAttribute("disabled", true);
+ ATTRIBUTES.set(OrderingListAttributes.disabled, "true");
try {
getOrderingList().getIndexOfSelectedItem();
fail("The attribute <disabled> is set to true, but the ordering list is still enabled.");
@@ -67,55 +72,171 @@
}
@Test
+ public void testDisabledClass() {
+ ATTRIBUTES.set(OrderingListAttributes.disabled, "true");
+ ATTRIBUTES.set(OrderingListAttributes.disabledClass, "disabled-class");
+ assertTrue(selenium.belongsClass(getOrderingList().getLocator(), "disabled-class"), "The disabled class is not set when the ordering list is disabled.");
+ }
+
+ @Test
public void testHeaderClass() {
- fillAttribute("headerClass", "some-class");
+ ATTRIBUTES.set(OrderingListAttributes.headerClass, "some-class");
assertTrue(selenium.belongsClass(getOrderingList().getHeader(), "some-class"), "The attribute <headerClass> is set to <some-class>, but the header doesn't belong to this class.");
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11317")
public void testItemClass() {
- fillAttribute("itemClass", "some-class");
+ ATTRIBUTES.set(OrderingListAttributes.itemClass, "some-class");
assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <itemClass> is set to <some-class>, but the first item doesn't belong to this class.");
}
@Test
public void testListHeight() {
- testSizeCssProperty(getOrderingList().getList(), "listHeight", CssProperty.HEIGHT);
+ testSizeCssProperty(getOrderingList().getScrollableArea(), OrderingListAttributes.listHeight, CssProperty.HEIGHT);
}
@Test
public void testListWidth() {
- testSizeCssProperty(getOrderingList().getList(), "listWidth", CssProperty.WIDTH);
+ testSizeCssProperty(getOrderingList().getScrollableArea(), OrderingListAttributes.listWidth, CssProperty.WIDTH);
}
@Test
public void testMaxListHeight() {
- fillAttribute("listHeight", "");
- testSizeCssProperty(getOrderingList().getList(), "maxListHeight", new CssProperty("max-height"));
+ ATTRIBUTES.set(OrderingListAttributes.listHeight, "");
+ testSizeCssProperty(getOrderingList().getScrollableArea(), OrderingListAttributes.maxListHeight, new CssProperty("max-height"));
}
@Test
public void testMinListHeight() {
- fillAttribute("listHeight", "");
- testSizeCssProperty(getOrderingList().getList(), "minListHeight", new CssProperty("min-height"));
+ ATTRIBUTES.set(OrderingListAttributes.listHeight, "");
+ testSizeCssProperty(getOrderingList().getScrollableArea(), OrderingListAttributes.minListHeight, new CssProperty("min-height"));
}
@Test(enabled=false)
- public void testOnClick() {
- testFireEvent(Event.CLICK, pjq("div[id$=orderingList] tr[id$=orderingList]:first"));
+ public void testOnblur() {
+ // TODO
}
@Test
+ public void testOnchange() {
+ testFireEvent(Event.CHANGE, getOrderingList().getLocator());
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, getOrderingList().getLocator());
+ }
+
+ @Test(enabled=false)
+ @IssueTracking("https://issues.jboss.org/browse/RF-11318")
+ public void testOndblclick() {
+ // TODO
+ }
+
+ @Test(enabled=false)
+ public void testOnfocus() {
+ // TODO
+ }
+
+ @Test
+ public void testOnkeydown() {
+ testFireEvent(Event.KEYDOWN, getOrderingList().getListArea());
+ }
+
+ @Test
+ public void testOnkeypress() {
+ testFireEvent(Event.KEYPRESS, getOrderingList().getListArea());
+ }
+
+ @Test
+ public void testOnkeyup() {
+ testFireEvent(Event.KEYUP, getOrderingList().getListArea());
+ }
+
+ @Test
+ public void testOnlistclick() {
+ testFireEvent(Event.CLICK, getOrderingList().getList(), "listclick");
+ }
+
+ @Test(enabled=false)
+ public void testOnlistdblclick() {
+ // TODO
+ }
+
+ @Test
+ public void testOnlistkeydown() {
+ testFireEvent(Event.KEYDOWN, getOrderingList().getList(), "listkeydown");
+ }
+
+ @Test
+ public void testOnlistkeypress() {
+ testFireEvent(Event.KEYPRESS, getOrderingList().getList(), "listkeypress");
+ }
+
+ @Test
+ public void testOnlistkeyup() {
+ testFireEvent(Event.KEYUP, getOrderingList().getList(), "listkeyup");
+ }
+
+ @Test
+ public void testOnlistmousedown() {
+ testFireEvent(Event.MOUSEDOWN, getOrderingList().getList(), "listmousedown");
+ }
+
+ @Test
+ public void testOnlistmousemove() {
+ testFireEvent(Event.MOUSEMOVE, getOrderingList().getList(), "listmousemove");
+ }
+
+ @Test
+ public void testOnlistmouseout() {
+ testFireEvent(Event.MOUSEOUT, getOrderingList().getList(), "listmouseout");
+ }
+
+ @Test
+ public void testOnlistmouseover() {
+ testFireEvent(Event.MOUSEOVER, getOrderingList().getList(), "listmouseover");
+ }
+
+ @Test
+ public void testOnlistmouseup() {
+ testFireEvent(Event.MOUSEUP, getOrderingList().getList(), "listmouseup");
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, getOrderingList().getLocator());
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, getOrderingList().getLocator());
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, getOrderingList().getLocator());
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, getOrderingList().getLocator());
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, getOrderingList().getLocator());
+ }
+
+ @Test
public void testRendered() {
- fillAttribute("rendered", false);
+ ATTRIBUTES.set(OrderingListAttributes.rendered, false);
assertFalse(getOrderingList().isOrderingListPresent(), "The attribute <rendered> is set to <false>, but it has no effect.");
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11310")
public void testSelectItemClass() {
- fillAttribute("selectItemClass", "some-class");
+ ATTRIBUTES.set(OrderingListAttributes.selectItemClass, "some-class");
selectItem(0);
assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <selectItemClass> is set to <some-class>, but it has no effect.");
}
@@ -125,28 +246,13 @@
super.testStyle(getOrderingList().getLocator(), "style");
}
- private void fillAttribute(String name, boolean value) {
- JQueryLocator attribute = pjq("input[type=radio][name$=" + name + "Input][value=" + Boolean.toString(value) + "]");
- selenium.click(attribute);
- selenium.waitForPageToLoad();
- }
-
- private void fillAttribute(String name, String value) {
- JQueryLocator attribute = pjq("input[name$=" + name + "Input]");
- selenium.type(attribute, value);
- selenium.fireEvent(attribute, Event.BLUR);
- selenium.waitForPageToLoad();
- }
-
- private void testSizeCssProperty(JQueryLocator element, String attributeName, CssProperty cssProperty) {
+ private void testSizeCssProperty(JQueryLocator element, OrderingListAttributes attribute, CssProperty cssProperty) {
Map<String, String> values = new HashMap<String, String>();
values.put("100", "100px");
- values.put("200px", "200px");
-// values.put("200em", "200em");
-// values.put("200cm", "200cm");
+ values.put("200px", "200px");
for(String value : values.keySet()) {
- fillAttribute(attributeName, value);
- assertEquals(selenium.getStyle(getOrderingList().getList(), cssProperty), values.get(value), "The attribute <" + attributeName +"> is set to <" + value + ">, but it has no effect.");
+ ATTRIBUTES.set(attribute, value);
+ assertEquals(selenium.getStyle(getOrderingList().getScrollableArea(), cssProperty), values.get(value), "The attribute <" + attribute.name() +"> is set to <" + value + ">, but it has no effect.");
}
}
}
13 years, 3 months
JBoss Rich Faces SVN: r22716 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/model and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-14 02:59:17 -0400 (Wed, 14 Sep 2011)
New Revision: 22716
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Capital.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
Log:
RF-11397: bug fixed, the ordering list needs tha capital to have properly defined equals method
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java 2011-09-13 09:34:13 UTC (rev 22715)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java 2011-09-14 06:59:17 UTC (rev 22716)
@@ -47,24 +47,27 @@
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
- LOGGER.info("capital as object: " + value);
for(Capital capital : capitals) {
if (capitalAsString(capital).equals(value)) {
Capital toReturn = new Capital();
toReturn.setName(capital.getName());
toReturn.setState(capital.getState());
toReturn.setTimeZone(capital.getTimeZone());
+ LOGGER.info("converting string [" + value + "] to object [" + toReturn + "].");
return toReturn;
}
}
+ LOGGER.info("converting [" + value + "] to object wasn't succuessful.");
throw new FacesException("Cannot convert parameter \"" + value + "\" to the Capital.");
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (!(value instanceof Capital)) {
+ LOGGER.info("converting [" + value + "] to string wasn't successful.");
throw new FacesException("Cannot convert parameter \"" + value + "\" to the String.");
}
+ LOGGER.info("converting object [" + value + "] to string [" + capitalAsString((Capital) value) + "].");
return capitalAsString((Capital) value);
}
@@ -77,8 +80,12 @@
}
private String capitalAsString(Capital capital) {
- LOGGER.info("capital as string: " + capital.getName());
- return capital.getName();
+ if (capital == null) {
+ return null;
+ } else {
+ return capital.getName();
+ }
}
}
+
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Capital.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Capital.java 2011-09-13 09:34:13 UTC (rev 22715)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Capital.java 2011-09-14 06:59:17 UTC (rev 22716)
@@ -82,6 +82,45 @@
this.timeZone = timeZone;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((state == null) ? 0 : state.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Capital other = (Capital) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (state == null) {
+ if (other.state != null) {
+ return false;
+ }
+ } else if (!state.equals(other.state)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
public String toString() {
return name + " (" + state + ")";
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-09-13 09:34:13 UTC (rev 22715)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-09-14 06:59:17 UTC (rev 22716)
@@ -31,9 +31,7 @@
<ui:define name="component">
<h:form>
- <h:commandButton value="submit">
- <f:ajax execute="@form" render="orderingList output" />
- </h:commandButton>
+ <h:commandButton id="submitButton" value="submit" execute="@form" />
<br />
<rich:orderingList columnClasses="#{richOrderingListBean.attributes['columnClasses'].value}"
columnVar="#{richOrderingListBean.attributes['columnVar'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-09-13 09:34:13 UTC (rev 22715)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-09-14 06:59:17 UTC (rev 22716)
@@ -31,9 +31,7 @@
<ui:define name="component">
<h:form>
- <h:commandButton value="submit">
- <f:ajax execute="@form" render="orderingList output" />
- </h:commandButton>
+ <h:commandButton id="submitButton" value="submit" execute="@form" />
<hr />
<rich:orderingList columnClasses="#{richOrderingListBean.attributes['columnClasses'].value}"
columnVar="#{richOrderingListBean.attributes['columnVar'].value}"
13 years, 3 months
JBoss Rich Faces SVN: r22715 - modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-09-13 05:34:13 -0400 (Tue, 13 Sep 2011)
New Revision: 22715
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
Log:
RFPL-1660: added lost attribute
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-09-12 20:11:52 UTC (rev 22714)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-09-13 09:34:13 UTC (rev 22715)
@@ -85,6 +85,7 @@
upText="#{richOrderingListBean.attributes['upText'].value}"
upTopText="#{richOrderingListBean.attributes['upTopText'].value}"
value="#{richOrderingListBean.capitals}"
+ var="capital"
>
<f:converter converterId="capitalConverter" />
<rich:column>
13 years, 3 months
JBoss Rich Faces SVN: r22714 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-12 16:11:52 -0400 (Mon, 12 Sep 2011)
New Revision: 22714
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
Log:
RFPL-1240, RF-11395: add appropriate IssueTracking for CSV example for rich:autocomplete
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java 2011-09-12 20:11:32 UTC (rev 22713)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java 2011-09-12 20:11:52 UTC (rev 22714)
@@ -33,7 +33,7 @@
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
-@IssueTracking("")
+@IssueTracking("https://issues.jboss.org/browse/RF-11395")
public class TestAutocompleteCSV extends TestComponentWithJSR303 {
@Override
13 years, 3 months
JBoss Rich Faces SVN: r22713 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-12 16:11:32 -0400 (Mon, 12 Sep 2011)
New Revision: 22713
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml
Log:
RFPL-1240: add csv for rich:autocomplete (example + tests)
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml 2011-09-12 20:11:32 UTC (rev 22713)
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <h:commandButton id="hButton" value="h:commandButton" style="margin-right: 10px;"/>
+ <a4j:commandButton id="a4jButton" value="a4j:commandButton"/>
+ <br/><br/>
+
+ <h:panelGrid columns="3">
+ not empty
+ <rich:autocomplete id="input1"
+ autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value1}"
+ >
+ <rich:validator event="change" />
+ <a4j:ajax event="change" render="output1"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg1" for="input1"/>
+
+ pattern [a-z].*
+ <rich:autocomplete id="input2"
+ autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value2}"
+ >
+ <rich:validator event="change"/>
+ <a4j:ajax event="change" render="output2"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg2" for="input2"/>
+
+ size 3-6
+ <rich:autocomplete id="input3"
+ autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value3}"
+ >
+ <rich:validator event="change"/>
+ <a4j:ajax event="change" render="output3"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg3" for="input3"/>
+
+ custom (RichFaces)
+ <rich:autocomplete id="input4"
+ value="#{richAutocompleteBean.value4}"
+ >
+ <f:validator validatorId="org.richfaces.StringRichFacesValidator"/>
+ <rich:validator event="change"/>
+ <a4j:ajax event="change" render="output4"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg4" for="input4"/>
+
+ </h:panelGrid>
+ <br/><br/>
+
+ <h:panelGrid columns="2">
+ output1
+ <h:outputText id="output1" value="#{richAutocompleteBean.value1}"/>
+ output2
+ <h:outputText id="output2" value="#{richAutocompleteBean.value2}"/>
+ output3
+ <h:outputText id="output3" value="#{richAutocompleteBean.value3}"/>
+ output4
+ <h:outputText id="output4" value="#{richAutocompleteBean.value4}"/>
+ </h:panelGrid>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richAutocompleteBean.attributes}" id="attributes" />
+ <metamer:attributes value="#{richAutocompleteBean.ajaxAttributes}" id="ajaxAttributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml 2011-09-12 19:02:49 UTC (rev 22712)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml 2011-09-12 20:11:32 UTC (rev 22713)
@@ -43,6 +43,10 @@
<metamer:testPageLink id="jsr303" outcome="jsr303" value="JSR-303 Bean Validation">
Simple page that contains some <b>rich:autocomplete</b>s with various JSR-303 validators.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="csv" outcome="csv" value="Client Side Validation">
+ Simple page that contains some <b>rich:autocomplete</b>s testing client-side validation..
+ </metamer:testPageLink>
</ui:define>
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java 2011-09-12 20:11:32 UTC (rev 22713)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richAutocomplete;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+
+/**
+ * Test for page faces/components/richAutocomplete/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@IssueTracking("")
+public class TestAutocompleteCSV extends TestComponentWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richAutocomplete/csv.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}
13 years, 3 months
JBoss Rich Faces SVN: r22712 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-12 15:02:49 -0400 (Mon, 12 Sep 2011)
New Revision: 22712
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
Log:
RFPL-1612: add IssueTracking and fix for event handlers tests for pickList
IssueTracking changed from tracking bug in pickList component to tracking problem with test, which is false positive. Handlers are working when check manualy, but tests are still failing. Have to investigate bit more, or find some workaroud to get this working reliable
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-09-12 18:38:09 UTC (rev 22711)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-09-12 19:02:49 UTC (rev 22712)
@@ -35,6 +35,7 @@
import org.jboss.test.selenium.utils.URLUtils;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
@@ -315,16 +316,14 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOnblur() {
testFireEvent(Event.BLUR, pickListTop);
}
@Test
- public void testOnchange() {
- attributes.setOnchange("metamerEvents += \"change \"");
- addItem("North Carolina");
- waitGui.failWith("Attribute onchange does not work correctly").until(
- new EventFiredCondition(Event.CHANGE));
+ public void testOnchange() {
+ testFireEvent(Event.CHANGE, pickListTop, "change");
}
@Test
@@ -338,6 +337,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOnfocus() {
testFireEvent(Event.FOCUS, pickListTop);
}
@@ -405,16 +405,19 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOnsourcekeydown() {
testFireEvent(Event.KEYDOWN, pickListSource, "sourcekeydown");
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOnsourcekeypress() {
testFireEvent(Event.KEYPRESS, pickListSource, "sourcekeypress");
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOnsourcekeyup() {
testFireEvent(Event.KEYUP, pickListSource, "sourcekeyup");
}
@@ -455,16 +458,19 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOntargetkeydown() {
testFireEvent(Event.KEYDOWN, pickListTarget, "targetkeydown");
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOntargetkeypress() {
testFireEvent(Event.KEYPRESS, pickListTarget, "targetkeypress");
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1659")
public void testOntargetkeyup() {
testFireEvent(Event.KEYUP, pickListTarget, "targetkeyup");
}
13 years, 3 months
JBoss Rich Faces SVN: r22711 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-12 14:38:09 -0400 (Mon, 12 Sep 2011)
New Revision: 22711
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
Add Issuetracking for @lang and @readonly tests and fix test for title for rich:editor
There is failing test for @lang due to problem with RF, then test for readonly which seems to be limitation of selenium. And failing test for title was fixed, since there were ambiguous condition to verify title: no @title present, which is not always met even title isn't displayed as well
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-09-12 18:37:50 UTC (rev 22710)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-09-12 18:38:09 UTC (rev 22711)
@@ -19,6 +19,7 @@
import org.jboss.test.selenium.utils.URLUtils;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
@@ -189,6 +190,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11394")
public void testLang() {
String langVal = "xyz";
attributes.setLang(langVal);
@@ -219,6 +221,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1658")
public void testReadonly() {
typeTextToEditor(text1);
@@ -313,8 +316,8 @@
AttributeLocator<?> attribute = editor.getAttribute(new Attribute("title"));
// title = null
- assertFalse(selenium.isAttributePresent(attribute), "Attribute title should not be present.");
-
+ assertFalse(title.equals(selenium.getAttribute(attribute)), "Attribute title should not be present.");
+
// set title
attributes.setTitle(title);
13 years, 3 months