Author: maksimkaszynski
Date: 2007-07-23 15:04:43 -0400 (Mon, 23 Jul 2007)
New Revision: 1810
Added:
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java
Removed:
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/model/
Log:
introduced framework/impl-parent and sandbox/impl modules
Added:
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java
(rev 0)
+++
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/convert/selection/ClientSelectionConverterTest.java 2007-07-23
19:04:43 UTC (rev 1810)
@@ -0,0 +1,68 @@
+/**
+ *
+ */
+package org.richfaces.convert.selection;
+
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.model.selection.ClientSelection;
+import org.richfaces.model.selection.SelectionRange;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ClientSelectionConverterTest extends AbstractAjax4JsfTestCase {
+
+ private Converter converter;
+
+ /**
+ * @param name
+ */
+ public ClientSelectionConverterTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ converter = application.createConverter(ClientSelection.class);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ converter = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.convert.selection.ClientSelectionConverter#getAsObject(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.String)}.
+ */
+ public void testGetAsObject() {
+ //fail("Not yet implemented"); // TODO
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.convert.selection.ClientSelectionConverter#getAsString(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.Object)}.
+ */
+ public void testGetAsString() {
+
+ ClientSelection clientSelection = new ClientSelection();
+ clientSelection.addRange(new SelectionRange(2,3));
+ clientSelection.addRange(new SelectionRange(5,22));
+
+ String value = converter.getAsString(facesContext, null, clientSelection);
+
+ assertNotNull(value);
+ assertTrue(value.length() > 0);
+ assertEquals("2,3;5,22;", value);
+
+
+ }
+
+}
Show replies by date