myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1622142 - in /myfaces/core/trunk/impl/src/test: java/org/apache/myfaces/application/NavigationHandlerImplTest.java resources/org/apache/myfaces/application/simple-if-rules-config-4.xml
Date Tue, 02 Sep 2014 22:12:30 GMT
Author: lu4242
Date: Tue Sep  2 22:12:30 2014
New Revision: 1622142

URL: http://svn.apache.org/r1622142
Log:
Add case do not match when outcome null and <from-outcome> defined

Added:
    myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-4.xml
      - copied, changed from r1621907, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-3.xml
Modified:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java?rev=1622142&r1=1622141&r2=1622142&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
Tue Sep  2 22:12:30 2014
@@ -687,4 +687,25 @@ public class NavigationHandlerImplTest e
         assertNotNull(facesContext.getViewRoot());
         assertEquals("/viewExpired.xhtml", facesContext.getViewRoot().getViewId());
     }
+    
+    @Test
+    public void testIfDoNotMatchWhenOutcomeNull() throws Exception
+    {
+        loadTextFacesConfig("simple-if-rules-config-4.xml");
+
+        externalContext.getRequestMap().put("test", new TestBean());
+        
+        facesContext.getViewRoot().setViewId("/a.jsp");
+        
+        NavigationHandlerImpl nh = new NavigationHandlerImpl();
+
+        NavigationCase nc = nh.getNavigationCase(facesContext, null, null);
+
+        Assert.assertNull(nc);
+        
+        nc = nh.getNavigationCase(facesContext, null, "go");
+
+        Assert.assertEquals("/b.jsp", nc.getToViewId(facesContext));
+    }
+    
 }

Copied: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-4.xml
(from r1621907, myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-3.xml)
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-4.xml?p2=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-4.xml&p1=myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-3.xml&r1=1621907&r2=1622142&rev=1622142&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-3.xml
(original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/application/simple-if-rules-config-4.xml
Tue Sep  2 22:12:30 2014
@@ -22,16 +22,9 @@ Licensed to the Apache Software Foundati
   <navigation-rule>
     <from-view-id>/a.jsp</from-view-id>
     <navigation-case>
-        <from-action>go</from-action>
+        <from-outcome>go</from-outcome>
         <if>#{test.true}</if>
         <to-view-id>/b.jsp</to-view-id>
     </navigation-case>
   </navigation-rule>
-  <navigation-rule>
-    <from-view-id>/a.jsp</from-view-id>
-    <navigation-case>
-        <from-action>go</from-action>
-        <to-view-id>/c.jsp</to-view-id>
-    </navigation-case>
-  </navigation-rule>
 </faces-config>



Mime
View raw message