JBoss Rich Faces SVN: r8730 - trunk/ui/panelbar/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:46:19 -0400 (Fri, 23 May 2008)
New Revision: 8730
Modified:
trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
===================================================================
--- trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2008-05-23 13:42:08 UTC (rev 8729)
+++ trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2008-05-23 13:46:19 UTC (rev 8730)
@@ -182,7 +182,7 @@
assertNotNull(input);
assertEquals("input", input.getNodeName());
classAttr = input.getAttributeValue("value");
- assertTrue(classAttr.contains(panelBarItem1.getClientId(facesContext)));
+ assertTrue(classAttr.contains(panelBarItem1.getId()));
div = page.getHtmlElementById(panelBarItem1.getClientId(facesContext));
assertNotNull(div);
16 years, 7 months
JBoss Rich Faces SVN: r8729 - trunk/ui/suggestionbox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:42:08 -0400 (Fri, 23 May 2008)
New Revision: 8729
Modified:
trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2008-05-23 13:33:32 UTC (rev 8728)
+++ trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2008-05-23 13:42:08 UTC (rev 8729)
@@ -21,20 +21,22 @@
package org.richfaces.component;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.UIInput;
-import javax.faces.component.html.HtmlForm;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIInput;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
/**
* Unit test for SuggestionBox component.
*/
@@ -46,8 +48,8 @@
javaScripts.add("prototype.js");
javaScripts.add("org.ajax4jsf.javascript.SmartPositionScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/scriptaculo.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
+ javaScripts.add("scripts/scriptaculo.js");
+ javaScripts.add("scripts/suggestionbox.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/available.js");
}
@@ -160,7 +162,7 @@
}
}
- assertTrue(found);
+ assertTrue(srcAttr, found);
}
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8728 - trunk/ui/togglePanel/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:33:32 -0400 (Fri, 23 May 2008)
New Revision: 8728
Modified:
trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
===================================================================
--- trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2008-05-23 13:31:12 UTC (rev 8727)
+++ trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2008-05-23 13:33:32 UTC (rev 8728)
@@ -53,6 +53,7 @@
static {
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
javaScripts.add("scripts/togglePanel.js");
}
@@ -201,7 +202,7 @@
}
}
- assertTrue(found);
+ assertTrue(srcAttr, found);
}
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8727 - trunk/ui/tabPanel/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:31:12 -0400 (Fri, 23 May 2008)
New Revision: 8727
Modified:
trunk/ui/tabPanel/src/test/java/org/richfaces/component/TabPanelComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/tabPanel/src/test/java/org/richfaces/component/TabPanelComponentTest.java
===================================================================
--- trunk/ui/tabPanel/src/test/java/org/richfaces/component/TabPanelComponentTest.java 2008-05-23 13:27:15 UTC (rev 8726)
+++ trunk/ui/tabPanel/src/test/java/org/richfaces/component/TabPanelComponentTest.java 2008-05-23 13:31:12 UTC (rev 8727)
@@ -214,6 +214,21 @@
}
}
+ private void checkResource(String path, int format) throws Exception {
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ InternetResource resource = builder.getResource(path);
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
+ assertEquals(format, info.getFormat());
+
+ }
+
public void testRenderImages() throws Exception {
HtmlPage view = renderView();
assertNotNull(view);
@@ -226,23 +241,15 @@
Page page = webClient.getPage(uri);
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- String[] resources = new String[]{
+ String[] pngResources = new String[]{
"org.richfaces.renderkit.images.TabGradientA",
- "org.richfaces.renderkit.images.TabGradientB",
- "org.richfaces.renderkit.images.TabStripeImage"
+ "org.richfaces.renderkit.images.TabGradientB"
};
+
+ for (int i = 0; i < pngResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
+ }
- for (int i = 0; i < resources.length; i++) {
- resource = builder.getResource(resources[i]);
- assertNotNull(resource);
- uri = "http:" + resource.getUri(facesContext, null);
- page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- }
+ checkResource("org.richfaces.renderkit.images.TabStripeImage", ImageInfo.FORMAT_GIF);
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8726 - trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:27:15 -0400 (Fri, 23 May 2008)
New Revision: 8726
Modified:
trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java
===================================================================
--- trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java 2008-05-23 13:22:24 UTC (rev 8725)
+++ trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java 2008-05-23 13:27:15 UTC (rev 8726)
@@ -59,7 +59,6 @@
private UIColumn column2 = null;
private static final Set<String> javaScripts = new HashSet<String>();
- private static final Set<String> imageClasses = new HashSet<String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -70,27 +69,6 @@
javaScripts.add("scripts/OrderingList.js");
javaScripts.add("scripts/ListShuttle.js");
javaScripts.add("scripts/ListBase.js");
-
- imageClasses.add("org.richfaces.renderkit.html.images.TriangleIconUp");
- imageClasses.add("org.richfaces.renderkit.html.images.TriangleIconDown");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
-
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopy");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAll");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAllDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemove");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAll");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAllDisabled");
}
/**
@@ -315,6 +293,23 @@
assertEquals(IMAGE_COUNT, foundImages);
}
+ private void checkResource(String path, int format) throws Exception {
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ builder.createResource(null, path);
+ InternetResource resource = builder.getResource(path);
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+
+ assertTrue(info.check());
+ assertEquals(format, info.getFormat());
+ assertTrue(info.getHeight() > 0);
+ assertTrue(info.getWidth() > 0);
+ }
+
/**
* Test default images rendering
*
@@ -323,25 +318,41 @@
public void testRenderImages() throws Exception {
HtmlPage view = renderView();
assertNotNull(view);
+
+ String[] pngResources = new String[] {
+ "org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient",
+ "org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient",
+ "org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient"
+ };
+
+ for (int i = 0; i < pngResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
+ }
- InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
-
- for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- builder.createResource(null, clazz);
- InternetResource resource = builder.getResource(clazz);
- assertNotNull(resource);
- String uri = "http:" + resource.getUri(facesContext, null);
- Page page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
-
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
+ String[] gifResources = new String[] {
+ "org.richfaces.renderkit.html.images.TriangleIconUp",
+ "org.richfaces.renderkit.html.images.TriangleIconDown",
+ "org.richfaces.renderkit.html.images.OrderingListIconTop",
+ "org.richfaces.renderkit.html.images.OrderingListIconBottom",
+ "org.richfaces.renderkit.html.images.OrderingListIconUpDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconDownDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconTopDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled",
+
+ "org.richfaces.renderkit.html.images.ListShuttleIconCopy",
+ "org.richfaces.renderkit.html.images.ListShuttleIconCopyDisabled",
+ "org.richfaces.renderkit.html.images.ListShuttleIconCopyAll",
+ "org.richfaces.renderkit.html.images.ListShuttleIconCopyAllDisabled",
+ "org.richfaces.renderkit.html.images.ListShuttleIconRemove",
+ "org.richfaces.renderkit.html.images.ListShuttleIconRemoveAll",
+ "org.richfaces.renderkit.html.images.ListShuttleIconRemoveDisabled",
+ "org.richfaces.renderkit.html.images.ListShuttleIconRemoveAllDisabled"
+ };
+
+ for (int i = 0; i < gifResources.length; i++) {
+ checkResource(gifResources[i], ImageInfo.FORMAT_GIF);
+ }
+
}
/**
16 years, 7 months
JBoss Rich Faces SVN: r8725 - trunk/ui/orderingList/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:22:24 -0400 (Fri, 23 May 2008)
New Revision: 8725
Modified:
trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
===================================================================
--- trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2008-05-23 13:11:53 UTC (rev 8724)
+++ trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2008-05-23 13:22:24 UTC (rev 8725)
@@ -53,7 +53,6 @@
*/
public class OrderingListRenderingTest extends AbstractAjax4JsfTestCase {
private static Set<String> javaScripts = new HashSet<String>();
- private static Set<String> imageClasses = new HashSet<String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -63,18 +62,6 @@
javaScripts.add("scripts/Control.js");
javaScripts.add("scripts/OrderingList.js");
javaScripts.add("scripts/ListBase.js");
-
- imageClasses.add("org.richfaces.renderkit.html.images.TriangleIconUp");
- imageClasses.add("org.richfaces.renderkit.html.images.TriangleIconDown");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
- imageClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
}
/**
@@ -182,6 +169,23 @@
assertEquals(foundCount, javaScripts.size());
}
+ private void checkResource(String clazz, int format) throws Exception {
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ builder.createResource(null, clazz);
+ InternetResource resource = builder.getResource(clazz);
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+
+ assertTrue(clazz, info.check());
+ assertEquals(clazz, format, info.getFormat());
+ assertTrue(clazz, info.getHeight() > 0);
+ assertTrue(clazz, info.getWidth() > 0);
+ }
+
/**
* Test default images rendering
*
@@ -191,24 +195,30 @@
HtmlPage view = renderView();
assertNotNull(view);
- InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ String[] pngResources = new String[] {
+ "org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient",
+ "org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient",
+ "org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient"
+ };
+
+ for (int i = 0; i < pngResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
+ }
- for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- builder.createResource(null, clazz);
- InternetResource resource = builder.getResource(clazz);
- assertNotNull(resource);
- String uri = "http:" + resource.getUri(facesContext, null);
- Page page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
-
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
+ String[] gifResources = new String[] {
+ "org.richfaces.renderkit.html.images.TriangleIconUp",
+ "org.richfaces.renderkit.html.images.TriangleIconDown",
+ "org.richfaces.renderkit.html.images.OrderingListIconTop",
+ "org.richfaces.renderkit.html.images.OrderingListIconBottom",
+ "org.richfaces.renderkit.html.images.OrderingListIconUpDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconDownDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconTopDisabled",
+ "org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled"
+ };
+
+ for (int i = 0; i < gifResources.length; i++) {
+ checkResource(gifResources[i], ImageInfo.FORMAT_GIF);
+ }
}
/**
16 years, 7 months
JBoss Rich Faces SVN: r8724 - trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:11:53 -0400 (Fri, 23 May 2008)
New Revision: 8724
Modified:
trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java
===================================================================
--- trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java 2008-05-23 13:05:10 UTC (rev 8723)
+++ trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java 2008-05-23 13:11:53 UTC (rev 8724)
@@ -45,7 +45,6 @@
import org.ajax4jsf.resource.image.ImageInfo;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.ajax4jsf.tests.HtmlTestUtils;
-import org.apache.commons.lang.StringUtils;
import org.richfaces.renderkit.html.images.SliderArrowImage;
import org.richfaces.renderkit.html.images.SliderArrowSelectedImage;
import org.richfaces.renderkit.html.images.SliderFieldGradient;
@@ -58,7 +57,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
/** Unit test for simple Component. */
public class InputNumberSliderComponentTest extends AbstractAjax4JsfTestCase {
@@ -219,6 +217,22 @@
assertTrue(imageDim.getWidth() == 7 && imageDim.getHeight() == 8);
}
+ private void checkResource(String name, int format) throws Exception {
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ InternetResource resource = builder.getResource(name);
+
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode()
+ == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
+ assertEquals(format, info.getFormat());
+ }
+
public void testRenderImages() throws Exception {
renderView();
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
@@ -229,26 +243,23 @@
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse
.SC_OK);
- String[] resources = new String[]{
- SliderArrowImage.class.getName(),
- SliderArrowSelectedImage.class.getName(),
+ String[] pngResources = new String[]{
SliderFieldGradient.class.getName(),
SliderTrackGradient.class.getName()
};
- for (int i = 0; i < resources.length; i++) {
- resource = builder.getResource(resources[i]);
- assertNotNull(resource);
- uri = "http:" + resource.getUri(facesContext, null);
- page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode()
- == HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- }
+ for (int i = 0; i < pngResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
+ }
+
+ String[] gifResources = new String[]{
+ SliderArrowImage.class.getName(),
+ SliderArrowSelectedImage.class.getName(),
+ };
+
+ for (int i = 0; i < gifResources.length; i++) {
+ checkResource(gifResources[i], ImageInfo.FORMAT_GIF);
+ }
}
public void testUpdate() throws Exception {
16 years, 7 months
JBoss Rich Faces SVN: r8723 - trunk/ui/inputnumber-spinner/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 09:05:10 -0400 (Fri, 23 May 2008)
New Revision: 8723
Modified:
trunk/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java
===================================================================
--- trunk/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java 2008-05-23 12:59:54 UTC (rev 8722)
+++ trunk/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java 2008-05-23 13:05:10 UTC (rev 8723)
@@ -46,7 +46,6 @@
import org.ajax4jsf.resource.image.ImageInfo;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.ajax4jsf.tests.HtmlTestUtils;
-import org.apache.commons.lang.StringUtils;
import org.richfaces.renderkit.html.images.SpinnerButtonDown;
import org.richfaces.renderkit.html.images.SpinnerButtonGradient;
import org.richfaces.renderkit.html.images.SpinnerButtonUp;
@@ -58,7 +57,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
/** Unit test for simple Component. */
public class InputNumberSpinnerComponentTest extends AbstractAjax4JsfTestCase {
@@ -186,6 +184,22 @@
assertTrue(imageDim.getWidth() == 14 && imageDim.getHeight() == 7);
}
+ private void checkResource(String name, int format) throws Exception {
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ InternetResource resource = builder.getResource(name);
+
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode()
+ == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
+ assertEquals(format, info.getFormat());
+ }
+
public void testRenderImages() throws Exception {
renderView();
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
@@ -196,25 +210,22 @@
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse
.SC_OK);
- String[] resources = new String[]{
+ String[] pngResources = new String[]{
SpinnerButtonGradient.class.getName(),
SpinnerFieldGradient.class.getName(),
+ };
+
+ for (int i = 0; i < pngResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
+ }
+
+ String[] gifResources = new String[]{
SpinnerButtonDown.class.getName(),
SpinnerButtonUp.class.getName()
};
- for (int i = 0; i < resources.length; i++) {
- resource = builder.getResource(resources[i]);
- assertNotNull(resource);
- uri = "http:" + resource.getUri(facesContext, null);
- page = webClient.getPage(uri);
- assertTrue(page.getWebResponse().getStatusCode()
- == HttpServletResponse.SC_OK);
- ImageInfo info = new ImageInfo();
- info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
- assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ for (int i = 0; i < gifResources.length; i++) {
+ checkResource(pngResources[i], ImageInfo.FORMAT_PNG);
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8722 - trunk/ui/dropdown-menu/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 08:59:54 -0400 (Fri, 23 May 2008)
New Revision: 8722
Modified:
trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java
===================================================================
--- trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java 2008-05-23 12:55:24 UTC (rev 8721)
+++ trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java 2008-05-23 12:59:54 UTC (rev 8722)
@@ -240,7 +240,7 @@
info.setInput(page.getWebResponse().getContentAsStream());
//image recognizable?
assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8721 - trunk/ui/tree/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 08:55:24 -0400 (Fri, 23 May 2008)
New Revision: 8721
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2008-05-23 12:30:13 UTC (rev 8720)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2008-05-23 12:55:24 UTC (rev 8721)
@@ -56,6 +56,7 @@
import org.richfaces.event.NodeExpandedListener;
import org.richfaces.event.NodeSelectedEvent;
import org.richfaces.event.NodeSelectedListener;
+import org.richfaces.model.ListRowKey;
import org.xml.sax.InputSource;
import com.gargoylesoftware.htmlunit.Page;
@@ -595,7 +596,7 @@
defaultFacet.getChildren().add(input1);
tree.setNodeFace("node");
-
+ tree.setRowKey(new ListRowKey("testId"));
Iterator dataChildren = tree.dataChildren();
assertTrue(dataChildren.hasNext());
assertSame(treeNode, dataChildren.next());
16 years, 7 months