myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r982217 - /myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
Date Wed, 04 Aug 2010 11:29:36 GMT
Author: matzew
Date: Wed Aug  4 11:29:34 2010
New Revision: 982217

URL: http://svn.apache.org/viewvc?rev=982217&view=rev
Log:
TRINIDAD-1851 - Test failures when building against Mojarra 2.0.3

looks like a valid call against getValueExpression() has been added to their NumberConverter.
The issue with our mock approach is that we explicitly say ALLOWED or NOT ALLOWED.
I added some code to indicate that we do not care about getValueExpression() being called
or not. This allows us building against different MyFaces and Mojarra versions

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java?rev=982217&r1=982216&r2=982217&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
Wed Aug  4 11:29:34 2010
@@ -47,6 +47,8 @@ public abstract class NumberConverterTes
   {
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
     NumberConverter converter = getNumberConverter();
 
@@ -69,6 +71,8 @@ public abstract class NumberConverterTes
   {
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
     NumberConverter converter  = getNumberConverter();
 
@@ -84,6 +88,8 @@ public abstract class NumberConverterTes
   {
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     setFacesContext(facesContext);
     try
     {
@@ -125,6 +131,8 @@ public abstract class NumberConverterTes
     {
       Mock mock = mock(UIComponent.class);
       UIComponent component = (UIComponent) mock.proxy();
+      mock.stubs().method("getValueExpression");
+
 
       setFacesContext(facesContext);
       try
@@ -167,6 +175,8 @@ public abstract class NumberConverterTes
     NumberConverter restoreConverter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
 
     for (int i = 0; i < _LOCALES.length; i++)
@@ -224,6 +234,7 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
 
     converter.setLocale(Locale.US);
     converter.setType("currency");
@@ -253,6 +264,7 @@ public abstract class NumberConverterTes
     NumberConverter converter   = getNumberConverter();
     Mock mock = buildMockUIComponent(2);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
 
     converter.setLocale(Locale.US);
     converter.setType("currency");
@@ -297,6 +309,8 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     converter.setLocale(Locale.US);
     converter.setType("currency");
     Double  value = new Double(99);
@@ -323,6 +337,8 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     converter.setLocale(Locale.US);
 
     String[] inputs = {"23.10", "44.90876", "11111", "67859.0001"};
@@ -352,6 +368,8 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     converter.setLocale(Locale.US);
 
     String[] inputs = {"23.10", "44.90876", "11111", "67859.0001"};
@@ -387,6 +405,7 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
 
     String input = "1234.56";
 
@@ -415,6 +434,8 @@ public abstract class NumberConverterTes
     NumberConverter converter = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     converter.setLocale(Locale.US);
     setFacesContext(facesContext);
     try
@@ -438,6 +459,8 @@ public abstract class NumberConverterTes
     String[] inputValues = {"123ABC", "22.22.2" };
     Mock mock = buildMockUIComponent(inputValues.length * 3);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
+
     MockUIComponentWrapper wrapper = new MockUIComponentWrapper(mock, component);
 
     for (int i = 0; i < inputValues.length; i++)
@@ -460,6 +483,7 @@ public abstract class NumberConverterTes
     NumberConverter converter   = getNumberConverter();
     Mock mock = mock(UIComponent.class);
     UIComponent component = (UIComponent) mock.proxy();
+    mock.stubs().method("getValueExpression");
 
     setFacesContext(facesContext);
     try



Mime
View raw message