Author: alexsmirnov
Date: 2010-12-20 19:37:16 -0500 (Mon, 20 Dec 2010)
New Revision: 20707
Added:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java
Removed:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java
Modified:
branches/4.0.0.M5/
branches/4.0.0.M5/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
branches/4.0.0.M5/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
branches/4.0.0.M5/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
branches/4.0.0.M5/ui/validator/ui/pom.xml
branches/4.0.0.M5/ui/validator/ui/src/main/config/faces-config.xml
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/LengthValidatorTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java
Log:
Merged revisions 20702-20705 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20702 | alexsmirnov | 2010-12-20 15:33:39 -0800 (Mon, 20 Dec 2010) | 2 lines
RESOLVED - issue RF-10063: Switch CSV to RichFaces AJAX behavior
https://issues.jboss.org/browse/RF-10063
.......
r20703 | alexsmirnov | 2010-12-20 15:48:52 -0800 (Mon, 20 Dec 2010) | 2 lines
RESOLVED - issue RF-9776: CDK: code with potential NPEs is generated
https://issues.jboss.org/browse/RF-9776
.......
r20704 | alexsmirnov | 2010-12-20 16:06:06 -0800 (Mon, 20 Dec 2010) | 2 lines
RESOLVED - issue RF-9811: CDK: attributes import errors are silently ignored
https://issues.jboss.org/browse/RF-9811
.......
r20705 | alexsmirnov | 2010-12-20 16:08:20 -0800 (Mon, 20 Dec 2010) | 2 lines
RESOLVED - issue RF-10063: Switch CSV to RichFaces AJAX behavior
https://issues.jboss.org/browse/RF-10063
.......
Property changes on: branches/4.0.0.M5
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
/trunk:1-20691
+ /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
/trunk:1-20691,20702-20705
Modified:
branches/4.0.0.M5/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
---
branches/4.0.0.M5/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -237,7 +237,7 @@
} catch (CdkException e) {
log.error(e);
} catch (FileNotFoundException e) {
- log.debug("No properties description found at " + attributes);
+ log.error("No properties description found at " + attributes);
}
}
}
Modified:
branches/4.0.0.M5/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
===================================================================
---
branches/4.0.0.M5/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl 2010-12-21
00:37:16 UTC (rev 20707)
@@ -6,9 +6,7 @@
</#if>
public ${attribute.typeName} ${attribute.getterName}() {
- <#if attribute.typeForCasting?contains("Boolean")>
- return Boolean.valueOf(getStateHelper().eval(Properties.${propertyKey}<#if
attribute.defaultValue?exists>, ${attribute.defaultValue}</#if>).toString());
- <#elseif attribute.bindingAttribute || attribute.literal >
+ <#if attribute.bindingAttribute || attribute.literal >
return (${attribute.typeForCasting})
getStateHelper().get(Properties.${propertyKey});
<#else>
return (${attribute.typeForCasting})
getStateHelper().eval(Properties.${propertyKey}<#if attribute.defaultValue?exists>,
${attribute.defaultValue}</#if>);
Modified:
branches/4.0.0.M5/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
===================================================================
---
branches/4.0.0.M5/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -98,7 +98,7 @@
BehaviorStack ajaxBehaviors = BehaviorStack.getBehaviorStack(context, true);
String eventName = getEventName();
- ajaxBehaviors.pushBehavior(context, ajaxBehavior, AjaxBehavior.BEHAVIOR_ID,
eventName);
+ ajaxBehaviors.pushBehavior(context, ajaxBehavior, getBehaviorId(),
eventName);
AttachQueueStack attachQueueStack = AttachQueueStack.getStack(context,
true);
AttachQueueInfo attachQueueInfo = new AttachQueueInfo(parent);
@@ -138,6 +138,7 @@
}
}
+
private void applyNested(FaceletContext ctx, UIComponent parent, AjaxBehavior
behavior) {
if (!ComponentHandler.isNew(parent)) {
return;
Modified: branches/4.0.0.M5/ui/validator/ui/pom.xml
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/pom.xml 2010-12-21 00:18:05 UTC (rev 20706)
+++ branches/4.0.0.M5/ui/validator/ui/pom.xml 2010-12-21 00:37:16 UTC (rev 20707)
@@ -74,6 +74,10 @@
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
Modified: branches/4.0.0.M5/ui/validator/ui/src/main/config/faces-config.xml
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/src/main/config/faces-config.xml 2010-12-21 00:18:05
UTC (rev 20706)
+++ branches/4.0.0.M5/ui/validator/ui/src/main/config/faces-config.xml 2010-12-21 00:37:16
UTC (rev 20707)
@@ -3,6 +3,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <!--
<behavior>
<behavior-id>org.richfaces.behavior.ClientValidator</behavior-id>
<behavior-class>org.richfaces.component.behavior.ClientValidatorImpl</behavior-class>
@@ -13,6 +14,7 @@
</cdk:tag>
</behavior-extension>
</behavior>
+ -->
<render-kit>
<client-behavior-renderer>
<client-behavior-renderer-type>org.richfaces.ClientValidatorRenderer</client-behavior-renderer-type>
Modified:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -36,7 +36,6 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIMessage;
import javax.faces.component.UIMessages;
-import javax.faces.component.behavior.AjaxBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialViewContext;
@@ -48,7 +47,11 @@
import javax.faces.validator.BeanValidator;
import javax.faces.validator.Validator;
+import org.ajax4jsf.component.behavior.AjaxBehavior;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
import org.richfaces.component.UIRichMessages;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
@@ -69,6 +72,7 @@
* @author asmirnov(a)exadel.com
*
*/
+@JsfBehavior(id = "org.richfaces.behavior.ClientValidator", tag = @Tag(name =
"validator", handler =
"org.richfaces.view.facelets.html.ClientValidatorHandler", type =
TagType.Facelets))
public class ClientValidatorImpl extends AjaxBehavior implements ClientValidatorBehavior
{
@@ -359,5 +363,14 @@
}
}
}
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.behavior.ClientValidatorBehavior#isImmediateSet()
+ */
+ public boolean isImmediateSet() {
+ // TODO - implement this method in RichFaces AjaxBehavior
+ return false;
+ }
+
}
Copied: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view (from rev
20705, trunk/ui/validator/ui/src/main/java/org/richfaces/view)
Copied: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets (from
rev 20705, trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets)
Copied: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html
(from rev 20705, trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html)
Deleted:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java 2010-12-21
00:08:20 UTC (rev 20705)
+++
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,43 +0,0 @@
-/*
- * $Id$
- * JBoss, Home of Professional Open Source
- * Copyright 2010, 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.view.facelets.html;
-
-import javax.faces.view.facelets.BehaviorConfig;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class ClientValidatorHandler extends AjaxHandler {
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param config
- */
- public ClientValidatorHandler(BehaviorConfig config) {
- super(config);
- }
-
-}
Copied:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java
(from rev 20705,
trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java)
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java
(rev 0)
+++
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/ClientValidatorHandler.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -0,0 +1,43 @@
+/*
+ * $Id$
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.view.facelets.html;
+
+import javax.faces.view.facelets.BehaviorConfig;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ClientValidatorHandler extends AjaxHandler {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param config
+ */
+ public ClientValidatorHandler(BehaviorConfig config) {
+ super(config);
+ }
+
+}
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -69,9 +69,9 @@
HtmlInput input = getInput(page);
input.setValueAttribute(value);
input.fireEvent("blur");
+ System.out.println(page.asXml());
HtmlElement message = page.getElementById("uiMessage");
assertThat(message.getTextContent(), matcher);
-// System.out.println(page.asXml());
}
private HtmlInput getInput(HtmlPage page) {
HtmlForm htmlForm = page.getFormByName("form");
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -11,7 +11,6 @@
import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,11 +1,8 @@
package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
-import java.util.Arrays;
import java.util.Collection;
import javax.el.ValueExpression;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,6 +1,6 @@
package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.*;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,15 +1,15 @@
package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
import javax.faces.FacesException;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
-import javax.faces.component.behavior.AjaxBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.RenderKit;
+import org.ajax4jsf.component.behavior.AjaxBehavior;
import org.jboss.test.faces.mock.Mock;
import org.jboss.test.faces.mock.MockTestRunner;
import org.jboss.test.faces.mock.Stub;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,9 +1,6 @@
package org.richfaces.el;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.Assert.*;
import javax.el.ValueExpression;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,7 +1,7 @@
package org.richfaces.el;
-import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import javax.el.ELException;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -2,14 +2,11 @@
import static org.junit.Assert.*;
-
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import org.ajax4jsf.javascript.JSFunction;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.richfaces.javascript.client.MockTestBase;
import org.richfaces.javascript.client.RunParameters;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -28,7 +28,6 @@
import org.junit.Test;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
/**
* <p class="changed_added_4_0"></p>
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -14,15 +14,15 @@
public class MessageTestBase {
- @Rule
- public final Qunit qunit;
-
public static final String COMPONENT = "form:component";
public static final String MY_MESSAGE = "form:uiMessage";
public static final String MESSAGE_INIT = "new
RichFaces.ui.Message(\"" + MY_MESSAGE + "\",
{forComponentId:\"" + COMPONENT + "\"})";
+ @Rule
+ public final Qunit qunit;
+
public MessageTestBase() {
this.qunit = createQunitPage().build();
}
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/LengthValidatorTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/LengthValidatorTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/LengthValidatorTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -3,8 +3,6 @@
*/
package org.richfaces.javascript.client.validator;
-import static org.easymock.EasyMock.anyObject;
-
import java.util.List;
import java.util.Map;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,6 +1,6 @@
package org.richfaces.javascript.client.validator;
-import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import java.util.Collections;
@@ -12,7 +12,6 @@
import javax.faces.validator.ValidatorException;
import javax.validation.ValidationException;
-
import net.sourceforge.htmlunit.corejs.javascript.JavaScriptException;
import net.sourceforge.htmlunit.corejs.javascript.NativeObject;
@@ -26,58 +25,58 @@
public abstract class ValidatorTestBase extends MockTestBase {
private static final Converter NUMBER_CONVERTER = new Converter() {
-
- public String getAsString(FacesContext context, UIComponent component, Object
value) {
-
- return String.valueOf(value);
- }
-
- public Object getAsObject(FacesContext context, UIComponent component, String
value) {
- return Double.valueOf(value);
- }
- };
+ public String getAsString(FacesContext context, UIComponent component, Object
value) {
+
+ return String.valueOf(value);
+ }
+
+ public Object getAsObject(FacesContext context, UIComponent component, String
value) {
+ return Double.valueOf(value);
+ }
+ };
+
public ValidatorTestBase(RunParameters criteria) {
super(criteria);
}
-
@Test
public void testValidator() throws Exception {
Validator validator = createValidator();
try {
- validator.validate(facesEnvironment.getFacesContext(), component,
criteria.getValue());
- validateOnClient();
+ validator.validate(facesEnvironment.getFacesContext(), component,
criteria.getValue());
+ validateOnClient();
} catch (ValidatorException e) {
// client-side script has to throw exception too.
try {
validateOnClient();
- assertFalse("JSF validator throws exception for value:
"+criteria.getValue(),true);
+ assertFalse("JSF validator throws exception for value: " +
criteria.getValue(), true);
} catch (ScriptException e2) {
// both methods throws exceptions - it's ok.
e2.printStackTrace();
Throwable cause = e2.getCause();
assertTrue(cause instanceof JavaScriptException);
- NativeObject value = (NativeObject)
((JavaScriptException)cause).getValue();
+ NativeObject value = (NativeObject) ((JavaScriptException)
cause).getValue();
assertEquals(getErrorMessage().getDetail(),
value.get("detail"));
}
}
}
-
+
protected Object validateOnClient() throws ValidationException {
- JSFunction clientSideFunction = new JSFunction("RichFaces.csv." +
getJavaScriptFunctionName(),criteria.getValue(),getErrorMessage(),getJavaScriptOptions());
+ JSFunction clientSideFunction =
+ new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(),
criteria.getValue(), getErrorMessage(),
+ getJavaScriptOptions());
return qunit.runScript(clientSideFunction.toScript());
}
-
+
protected abstract Validator createValidator();
-
@Override
protected void recordMocks() {
super.recordMocks();
expect(component.getAttributes()).andStubReturn(Collections.EMPTY_MAP);
-
expect(component.getClientId(facesEnvironment.getFacesContext())).andStubReturn("testComponent");
+
expect(component.getClientId(facesEnvironment.getFacesContext())).andStubReturn("testComponent");
expect(facesEnvironment.getApplication().createConverter("javax.faces.Number")).andStubReturn(NUMBER_CONVERTER);
}
}
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,8 +1,7 @@
package org.richfaces.renderkit.html;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
import java.util.Collection;
import java.util.Collections;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,8 +1,7 @@
package org.richfaces.validator;
-import static junit.framework.Assert.assertEquals;
-import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import java.lang.annotation.Annotation;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,8 +1,7 @@
package org.richfaces.validator;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Locale;
Modified:
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java
===================================================================
---
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java 2010-12-21
00:18:05 UTC (rev 20706)
+++
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java 2010-12-21
00:37:16 UTC (rev 20707)
@@ -1,8 +1,7 @@
package org.richfaces.validator;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Locale;