You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by uk...@apache.org on 2014/06/27 10:46:25 UTC
git commit: TAP5-1493: Trying to diagnose the test failure
Repository: tapestry-5
Updated Branches:
refs/heads/master b02c35148 -> 42e69d2b4
TAP5-1493: Trying to diagnose the test failure
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/42e69d2b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/42e69d2b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/42e69d2b
Branch: refs/heads/master
Commit: 42e69d2b47f458313afd5b3211b2a4fc02159c89
Parents: b02c351
Author: uklance <uk...@gmail.com>
Authored: Fri Jun 27 09:45:43 2014 +0100
Committer: uklance <uk...@gmail.com>
Committed: Fri Jun 27 09:45:43 2014 +0100
----------------------------------------------------------------------
.../services/PropertyConduitSourceImplTest.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/42e69d2b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java
index cc99472..7ab48ef 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java
@@ -14,6 +14,7 @@
package org.apache.tapestry5.internal.services;
+import java.lang.reflect.Method;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -30,6 +31,7 @@ import org.apache.tapestry5.internal.bindings.PropBindingFactoryTest;
import org.apache.tapestry5.internal.test.InternalBaseTestCase;
import org.apache.tapestry5.internal.util.Holder;
import org.apache.tapestry5.internal.util.IntegerRange;
+import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.services.PropertyConduitSource;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -882,7 +884,22 @@ public class PropertyConduitSourceImplTest extends InternalBaseTestCase
// example from Howard
assertConduitPropertyType(AbstractFoo.class, "bar", AbstractBar.class);
- assertConduitPropertyType(Foo.class, "bar", Bar.class);
+ try {
+ assertConduitPropertyType(Foo.class, "bar", Bar.class);
+ } catch (AssertionError e) {
+ List<Method> matches = CollectionFactory.newList();
+ for (Method method : Foo.class.getMethods()) {
+ if (method.getName().equals("getBar")) {
+ matches.add(method);
+ }
+ }
+ if (matches.size() < 2) {
+ throw e;
+ } else {
+ String msg = String.format("%s (possible candidates %s)", e.getMessage(), matches);
+ throw new AssertionError(msg, e);
+ }
+ }
// example from Robert
assertConduitPropertyType(RobertMyClass.class, "foo.robertBarValue", int.class);