Author: alexsmirnov
Date: 2010-12-07 19:59:05 -0500 (Tue, 07 Dec 2010)
New Revision: 20441
Added:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
Modified:
branches/RF-8742-1/ui/validator/ui/pom.xml
Log:
CODING IN PROGRESS - issue RF-9217: CSV: development tests for client side(qunit)
https://jira.jboss.org/browse/RF-9217
Modified: branches/RF-8742-1/ui/validator/ui/pom.xml
===================================================================
--- branches/RF-8742-1/ui/validator/ui/pom.xml 2010-12-07 23:18:08 UTC (rev 20440)
+++ branches/RF-8742-1/ui/validator/ui/pom.xml 2010-12-08 00:59:05 UTC (rev 20441)
@@ -104,6 +104,12 @@
<artifactId>jsf-test-jetty</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-qunit</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<scm>
Added:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
===================================================================
---
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
(rev 0)
+++
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java 2010-12-08
00:59:05 UTC (rev 20441)
@@ -0,0 +1,61 @@
+package org.richfaces.convert;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.jboss.test.qunit.Qunit;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import com.google.common.collect.ImmutableList;
+
+(a)RunWith(Parameterized.class)
+public class MockConverterTest {
+
+ @Rule
+ public final Qunit qunit =
Qunit.builder().loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
+
.loadJsfResource("richfaces-event.js").loadJsfResource("richfaces-csv.js",
"org.richfaces").loadJsfResource("resource.js").build();
+
+ private final TestCriteria criteria;
+
+ private MockFacesEnvironment facesEnvironment;
+
+ public MockConverterTest(TestCriteria criteria) {
+ this.criteria = criteria;
+ }
+
+ @Before
+ public void setUp(){
+ this.facesEnvironment = MockFacesEnvironment.createEnvironment();
+ }
+
+ @After
+ public void tearDown(){
+ this.facesEnvironment.release();
+ this.facesEnvironment = null;
+ }
+ @Test
+ public void testConvert() throws Exception {
+
+ }
+
+ @Parameters
+ public static List<TestCriteria[]> getTestCriterias() {
+ return ImmutableList.of(pass("true"), pass("ok"),
fail("123"));
+ }
+
+ private static TestCriteria[] pass(String string) {
+ return new TestCriteria[] { new TestCriteria(string) };
+ }
+
+ private static TestCriteria[] fail(String string) {
+ return new TestCriteria[] { new TestCriteria(string) };
+ }
+}
Property changes on:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
===================================================================
---
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
(rev 0)
+++
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java 2010-12-08
00:59:05 UTC (rev 20441)
@@ -0,0 +1,20 @@
+package org.richfaces.convert;
+
+public class TestCriteria {
+
+ private final String string;
+
+ public TestCriteria(String string) {
+ this.string = string;
+
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the string
+ */
+ public String getString() {
+ return string;
+ }
+
+}
Property changes on:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain