tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From freem...@apache.org
Subject svn commit: r493427 - in /tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration: IntegrationTests.java app1/pages/InstanceMixin.java
Date Sat, 06 Jan 2007 06:33:54 GMT
Author: freemant
Date: Fri Jan  5 22:33:53 2007
New Revision: 493427

URL: http://svn.apache.org/viewvc?view=rev&rev=493427
Log:
1) Fixed TAPESTRY-1223.
2) Fixed an error in assertSourcePresent() where the whole array was displayed, not the snippet.

Modified:
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/InstanceMixin.java

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?view=diff&rev=493427&r1=493426&r2=493427
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
(original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
Fri Jan  5 22:33:53 2007
@@ -512,9 +512,9 @@
             if (source.contains(snippet))
                 continue;
 
-            System.err.printf("Source content '%s' not found in:\n%s\n\n", expected, source);
+            System.err.printf("Source content '%s' not found in:\n%s\n\n", snippet, source);
 
-            throw new AssertionError("Page did not contain source '" + expected + "'.");
+            throw new AssertionError("Page did not contain source '" + snippet + "'.");
         }
     }
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/InstanceMixin.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/InstanceMixin.java?view=diff&rev=493427&r1=493426&r2=493427
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/InstanceMixin.java
(original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/InstanceMixin.java
Fri Jan  5 22:33:53 2007
@@ -12,81 +12,88 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.integration.app1.pages;
-
-import java.sql.Date;
-import java.text.DateFormat;
-import java.text.Format;
-import java.util.Calendar;
-
-import org.apache.tapestry.annotations.Component;
-import org.apache.tapestry.annotations.ComponentClass;
-import org.apache.tapestry.annotations.MixinClasses;
-import org.apache.tapestry.annotations.Mixins;
-import org.apache.tapestry.annotations.OnEvent;
-import org.apache.tapestry.annotations.Persist;
-import org.apache.tapestry.annotations.Retain;
-import org.apache.tapestry.integration.app1.components.Output;
-import org.apache.tapestry.integration.app1.mixins.Emphasis;
-
-@ComponentClass
-public class InstanceMixin
-{
-    @SuppressWarnings("unused")
-    @Component(parameters =
-    { "value=date2", "format=format", "test=showEmphasis" })
-    @Mixins("Emphasis")
-    private Output _output2;
-
-    @SuppressWarnings("unused")
-    @Component(parameters =
-    { "value=date3", "format=format", "test=showEmphasis" })
-    @MixinClasses(Emphasis.class)
-    private Output _output3;
-
-    @Retain
-    private final Format _format = DateFormat.getDateInstance(DateFormat.MEDIUM);
-
-    @Retain
-    private final Date _date1 = new Date(99, Calendar.JUNE, 13);
-
-    @Retain
-    private final Date _date2 = new Date(101, Calendar.JULY, 15);
-
-    @Retain
-    private final Date _date3 = new Date(105, Calendar.DECEMBER, 4);
-
-    @Persist
-    private boolean _showEmphasis;
-
-    public Format getFormat()
-    {
-        return _format;
-    }
-
-    public Date getDate1()
-    {
-        return _date1;
-    }
-
-    public Date getDate2()
-    {
-        return _date2;
-    }
-
-    public Date getDate3()
-    {
-        return _date3;
-    }
-
-    public boolean getShowEmphasis()
-    {
-        return _showEmphasis;
-    }
-
-    @OnEvent(component = "toggle")
-    void toggle()
-    {
-        _showEmphasis = !_showEmphasis;
-    }
-}
+package org.apache.tapestry.integration.app1.pages;
+
+import java.sql.Date;
+import java.text.DateFormat;
+import java.text.Format;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.annotations.MixinClasses;
+import org.apache.tapestry.annotations.Mixins;
+import org.apache.tapestry.annotations.OnEvent;
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.annotations.Retain;
+import org.apache.tapestry.integration.app1.components.Output;
+import org.apache.tapestry.integration.app1.mixins.Emphasis;
+
+@ComponentClass
+public class InstanceMixin
+{
+    @SuppressWarnings("unused")
+    @Component(parameters =
+    { "value=date2", "format=format", "test=showEmphasis" })
+    @Mixins("Emphasis")
+    private Output _output2;
+
+    @SuppressWarnings("unused")
+    @Component(parameters =
+    { "value=date3", "format=format", "test=showEmphasis" })
+    @MixinClasses(Emphasis.class)
+    private Output _output3;
+
+    @Retain
+    private final Format _format = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US);
+
+    @Retain
+    private final Date _date1 = newDate(99, Calendar.JUNE, 13);
+
+    @Retain
+    private final Date _date2 = newDate(101, Calendar.JULY, 15);
+
+    @Retain
+    private final Date _date3 = newDate(105, Calendar.DECEMBER, 4);
+
+    @Persist
+    private boolean _showEmphasis;
+
+    public Format getFormat()
+    {
+        return _format;
+    }
+
+    private static Date newDate(int yearSince1900, int month, int day)
+    {
+        return new Date(new GregorianCalendar(1900 + yearSince1900, month, day).getTimeInMillis());
+    }
+
+    public Date getDate1()
+    {
+        return _date1;
+    }
+
+    public Date getDate2()
+    {
+        return _date2;
+    }
+
+    public Date getDate3()
+    {
+        return _date3;
+    }
+
+    public boolean getShowEmphasis()
+    {
+        return _showEmphasis;
+    }
+
+    @OnEvent(component = "toggle")
+    void toggle()
+    {
+        _showEmphasis = !_showEmphasis;
+    }
+}



Mime
View raw message