tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r596535 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/components/Output.java test/java/org/apache/tapestry/corelib/components/OutputTest.java
Date Tue, 20 Nov 2007 04:11:11 GMT
Author: hlship
Date: Mon Nov 19 20:11:11 2007
New Revision: 596535

URL: http://svn.apache.org/viewvc?rev=596535&view=rev
Log:
TAPESTRY-1871: Null date displayed in a Grid raises error

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/OutputTest.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java?rev=596535&r1=596534&r2=596535&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java
Mon Nov 19 20:11:11 2007
@@ -66,6 +66,8 @@
 
     boolean beginRender(MarkupWriter writer)
     {
+        if (_value == null) return false;
+
         String formatted = _format.format(_value);
 
         if (InternalUtils.isNonBlank(formatted))

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/OutputTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/OutputTest.java?rev=596535&r1=596534&r2=596535&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/OutputTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/OutputTest.java
Mon Nov 19 20:11:11 2007
@@ -57,6 +57,27 @@
     }
 
     @Test
+    public void null_output()
+    {
+        MarkupWriter writer = createMarkupWriter();
+        ComponentResources resources = mockComponentResources();
+
+        replay();
+
+        Output component = new Output();
+
+        component.setup(null, _format, null, resources);
+
+        writer.element("root");
+        assertFalse(component.beginRender(writer));
+        writer.end();
+
+        verify();
+
+        assertEquals(writer.toString(), "<root></root>");
+    }
+
+    @Test
     public void output_with_element_and_informals()
     {
         String elementName = "span";



Mime
View raw message