That's really strange; I don't see those at all, and I run the integration tests many times a day. Likewise, the Bamboo server runs them after each commit.
On Nov 28, 2007 4:21 PM, Christian Edward Gruber <[EMAIL PROTECTED]> wrote: > I'm getting integration tests hanging in perpetuity from tapestry-core > on my core 2 duo macbook under the 1.5 MacOS Java runtime. I haven't > debugged them yet, but it's either threading issues, or a difference > in jvm. Anyone else notice this? > > Christian. > > > On 28-Nov-07, at 6:24 PM, [EMAIL PROTECTED] wrote: > > > Author: hlship > > Date: Wed Nov 28 15:24:06 2007 > > New Revision: 599198 > > > > URL: http://svn.apache.org/viewvc?rev=599198&view=rev > > Log: > > TAPESTRY-1816: Some tapestry-ioc tests fail on IBM JDK due to subtle > > differences in JDK implementations > > > > Removed: > > tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/ > > apache/tapestry/integration/app1/pages/AssetDemo.tml > > Modified: > > tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/ > > tapestry/internal/services/CookiesImpl.java > > tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodIterator.java > > tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodSignature.java > > tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/internal/services/ClassFabImplTest.java > > tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/services/MethodSignatureTest.java > > > > Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/ > > apache/tapestry/internal/services/CookiesImpl.java > > URL: > > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/CookiesImpl.java?rev=599198&r1=599197&r2=599198&view=diff > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/ > > tapestry/internal/services/CookiesImpl.java (original) > > +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/ > > tapestry/internal/services/CookiesImpl.java Wed Nov 28 15:24:06 2007 > > @@ -27,11 +27,11 @@ > > { > > private final Request _request; > > > > - private CookieSource _cookieSource; > > + private final CookieSource _cookieSource; > > > > private final CookieSink _cookieSink; > > > > - private int _defaultMaxAge; > > + private final int _defaultMaxAge; > > > > public CookiesImpl(Request request, > > > > > > Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/ > > apache/tapestry/ioc/services/MethodIterator.java > > URL: > > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java?rev=599198&r1=599197&r2=599198&view=diff > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodIterator.java (original) > > +++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodIterator.java Wed Nov 28 15:24:06 2007 > > @@ -18,9 +18,7 @@ > > import static > > org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap; > > > > import java.lang.reflect.Method; > > -import java.util.List; > > -import java.util.Map; > > -import java.util.NoSuchElementException; > > +import java.util.*; > > > > /** > > * Utility used to iterate over the publically visible methods of a > > class or interface. The > > @@ -40,6 +38,16 @@ > > > > private final List<MethodSignature> _signatures; > > > > + private static final Comparator<MethodSignature> COMPARATOR = > > new Comparator<MethodSignature>() > > + { > > + public int compare(MethodSignature o1, MethodSignature o2) > > + { > > + > > + return o1.getName().compareTo(o2.getName()); > > + } > > + }; > > + > > + > > public MethodIterator(Class subjectClass) > > { > > Method[] methods = subjectClass.getMethods(); > > @@ -51,6 +59,9 @@ > > > > _signatures = newList(map.values()); > > _count = _signatures.size(); > > + > > + > > + Collections.sort(_signatures, COMPARATOR); > > } > > > > private void processMethod(Method m, Map<String, > > MethodSignature> map) > > @@ -73,8 +84,8 @@ > > /** > > * Returns the next method (as a [EMAIL PROTECTED] MethodSignature}, > > returning null when all are > > * exhausted. Each method signature is returned exactly once > > (even if the same method signature > > - * is defined in multiple inherited classes or interfaces). The > > order in which method signatures > > - * are returned is not specified. > > + * is defined in multiple inherited classes or interfaces). The > > method signatures returned in > > + * ascending order, according to the "natural ordering". > > * > > * @throws NoSuchElementException if there are no more signatures > > */ > > @@ -94,4 +105,4 @@ > > { > > return _toString; > > } > > -} > > \ No newline at end of file > > +} > > > > Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/ > > apache/tapestry/ioc/services/MethodSignature.java > > URL: > > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java?rev=599198&r1=599197&r2=599198&view=diff > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodSignature.java (original) > > +++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/ > > tapestry/ioc/services/MethodSignature.java Wed Nov 28 15:24:06 2007 > > @@ -19,6 +19,7 @@ > > import static > > org.apache.tapestry.ioc.internal.util.InternalUtils.size; > > > > import java.lang.reflect.Method; > > +import java.util.Arrays; > > > > /** > > * A representation of a [EMAIL PROTECTED] java.lang.reflect.Method}, > > identifying the name, return type, > > @@ -47,8 +48,7 @@ > > > > private Class[] _exceptionTypes; > > > > - public MethodSignature(Class returnType, String name, Class[] > > parameterTypes, > > - Class[] exceptionTypes) > > + public MethodSignature(Class returnType, String name, Class[] > > parameterTypes, Class[] exceptionTypes) > > { > > _returnType = notNull(returnType, "returnType"); > > _name = notBlank(name, "name"); > > @@ -174,14 +174,21 @@ > > > > buffer.append(")"); > > > > - for (int i = 0; i < size(_exceptionTypes); i++) > > + int _exceptionCount = size(_exceptionTypes); > > + String _exceptionNames[] = new String[_exceptionCount]; > > + for (int i = 0; i < _exceptionCount; i++) > > { > > - if (i == 0) > > - buffer.append(" throws "); > > - else > > - buffer.append(", "); > > + _exceptionNames[i] = _exceptionTypes[i].getName(); > > + } > > + > > + Arrays.sort(_exceptionNames); > > + > > + for (int i = 0; i < _exceptionCount; i++) > > + { > > + if (i == 0) buffer.append(" throws "); > > + else buffer.append(", "); > > > > - buffer.append(_exceptionTypes[i].getName()); > > + buffer.append(_exceptionNames[i]); > > } > > > > return buffer.toString(); > > @@ -269,4 +276,4 @@ > > > > return unmatched == 0; > > } > > -} > > \ No newline at end of file > > +} > > > > Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/ > > apache/tapestry/ioc/internal/services/ClassFabImplTest.java > > URL: > > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/ClassFabImplTest.java?rev=599198&r1=599197&r2=599198&view=diff > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/internal/services/ClassFabImplTest.java (original) > > +++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/internal/services/ClassFabImplTest.java Wed Nov 28 > > 15:24:06 2007 > > @@ -76,14 +76,12 @@ > > > > cf.addField("_stringValue", String.class); > > > > - MethodSignature setStringValue = new > > MethodSignature(void.class, "setStringValue", > > - new > > Class[] > > - > > {String > > .class}, null); > > + MethodSignature setStringValue = new > > MethodSignature(void.class, "setStringValue", new Class[] > > {String.class}, > > + null); > > > > cf.addMethod(Modifier.PUBLIC, setStringValue, "_stringValue > > = $1;"); > > > > - MethodSignature getStringValue = new > > MethodSignature(String.class, "getStringValue", null, > > - null); > > + MethodSignature getStringValue = new > > MethodSignature(String.class, "getStringValue", null, null); > > > > cf.addMethod(Modifier.PUBLIC, getStringValue, "return > > _stringValue;"); > > > > @@ -120,8 +118,7 @@ > > ClassFab cf = newClassFab("Delegator", Object.class); > > > > cf.addField("_delegate", SampleService.class); > > - cf.addConstructor(new Class[] > > - {SampleService.class}, null, "_delegate = $1;"); > > + cf.addConstructor(new Class[]{SampleService.class}, null, > > "_delegate = $1;"); > > > > cf.proxyMethodsToDelegate(SampleService.class, "_delegate", > > "<Delegator>"); > > > > @@ -155,8 +152,7 @@ > > ClassFab cf = newClassFab("ToStringDelegator", Object.class); > > > > cf.addField("_delegate", ToStringService.class); > > - cf.addConstructor(new Class[] > > - {ToStringService.class}, null, "_delegate = $1;"); > > + cf.addConstructor(new Class[]{ToStringService.class}, null, > > "_delegate = $1;"); > > > > cf.proxyMethodsToDelegate(ToStringService.class, > > "_delegate", "<ToStringDelegator>"); > > > > @@ -182,11 +178,9 @@ > > ClassFab cf = newClassFab("ConstructableBean", Object.class); > > > > cf.addField("_stringValue", String.class); > > - cf.addConstructor(new Class[] > > - {String.class}, null, "{ _stringValue = $1; }"); > > + cf.addConstructor(new Class[]{String.class}, null, > > "{ _stringValue = $1; }"); > > > > - MethodSignature getStringValue = new > > MethodSignature(String.class, "getStringValue", null, > > - null); > > + MethodSignature getStringValue = new > > MethodSignature(String.class, "getStringValue", null, null); > > > > cf.addMethod(Modifier.PUBLIC, getStringValue, "return > > _stringValue;"); > > > > @@ -203,8 +197,7 @@ > > > > Constructor c = targetClass.getConstructors()[0]; > > > > - Object targetBean = c.newInstance(new Object[] > > - {"Buffy"}); > > + Object targetBean = c.newInstance(new Object[]{"Buffy"}); > > > > String actual = (String) _access.get(targetBean, > > "stringValue"); > > > > @@ -217,19 +210,14 @@ > > ClassFab cf = newClassFab("MyIntHolder", > > AbstractIntWrapper.class); > > > > cf.addField("_intValue", int.class); > > - cf.addConstructor(new Class[] > > - {int.class}, null, "{ _intValue = $1; }"); > > + cf.addConstructor(new Class[]{int.class}, null, > > "{ _intValue = $1; }"); > > > > - cf.addMethod( > > - Modifier.PUBLIC, > > - new MethodSignature(int.class, "getIntValue", null, > > null), > > - "return _intValue;"); > > + cf.addMethod(Modifier.PUBLIC, new > > MethodSignature(int.class, "getIntValue", null, null), "return > > _intValue;"); > > > > Class targetClass = cf.createClass(); > > Constructor c = targetClass.getConstructors()[0]; > > > > - AbstractIntWrapper targetBean = (AbstractIntWrapper) > > c.newInstance(new Object[] > > - {new Integer(137)}); > > + AbstractIntWrapper targetBean = (AbstractIntWrapper) > > c.newInstance(new Object[]{new Integer(137)}); > > > > assertEquals(targetBean.getIntValue(), 137); > > } > > @@ -262,8 +250,8 @@ > > > > cf.addInterface(SimpleService.class); > > > > - cf.addMethod(Modifier.PUBLIC, new > > MethodSignature(int.class, "add", new Class[] > > - {int.class, int.class}, null), "return $1 + $2;"); > > + cf.addMethod(Modifier.PUBLIC, new > > MethodSignature(int.class, "add", new Class[]{int.class, int.class}, > > null), > > + "return $1 + $2;"); > > > > Class targetClass = cf.createClass(); > > > > @@ -283,9 +271,7 @@ > > } > > catch (RuntimeException ex) > > { > > - assertExceptionRegexp( > > - ex, > > - "Unable to create class StringSubclass\ > > \:.*Cannot inherit from final class"); > > + assertExceptionRegexp(ex, "Unable to create class > > StringSubclass\\: .*"); > > } > > } > > > > @@ -315,10 +301,7 @@ > > > > try > > { > > - cf.addMethod( > > - Modifier.PUBLIC, > > - new MethodSignature(void.class, "run", null, > > null), > > - "fail;"); > > + cf.addMethod(Modifier.PUBLIC, new > > MethodSignature(void.class, "run", null, null), "fail;"); > > } > > catch (RuntimeException ex) > > { > > @@ -383,9 +366,7 @@ > > } > > catch (RuntimeException ex) > > { > > - assertEquals( > > - ex.getMessage(), > > - "Unable to add field buffy to class > > InvalidField: duplicate field: buffy"); > > + assertEquals(ex.getMessage(), "Unable to add field > > buffy to class InvalidField: duplicate field: buffy"); > > } > > > > } > > @@ -400,38 +381,27 @@ > > > > cf.addField("_map", Map.class); > > > > - cf.addConstructor(new Class[] > > - {Map.class, Runnable.class}, new Class[] > > - {IllegalArgumentException.class, > > DataFormatException.class}, "{ _map = $1; }"); > > - > > - MethodSignature sig = new MethodSignature(Map.class, > > "doTheNasty", new Class[] > > - {int.class, String.class}, new Class[] > > - {InstantiationException.class, > > IllegalAccessException.class}); > > - > > - cf.addMethod( > > - Modifier.PUBLIC + Modifier.FINAL + > > Modifier.SYNCHRONIZED, > > - sig, > > - "{ return _map; }"); > > + cf.addConstructor(new Class[]{Map.class, Runnable.class}, > > + new Class[] > > {IllegalArgumentException.class, DataFormatException.class}, "{ _map > > = $1; }"); > > + > > + MethodSignature sig = new MethodSignature(Map.class, > > "doTheNasty", new Class[]{int.class, String.class}, > > + new Class[] > > {InstantiationException.class, > > + > > IllegalAccessException.class}); > > + > > + cf.addMethod(Modifier.PUBLIC + Modifier.FINAL + > > Modifier.SYNCHRONIZED, sig, "{ return _map; }"); > > > > String toString = cf.toString(); > > > > - assertContains(toString, "public class FredRunnable extends " > > - + BaseLocatable.class.getName() + "\n" > > - + " implements java.lang.Runnable, > > java.io.Serializable"); > > + assertContains(toString, > > + "public class FredRunnable extends " + > > BaseLocatable.class.getName() + "\n" + " implements > > java.lang.Runnable, java.io.Serializable"); > > > > assertContains(toString, "private java.util.Map _map;"); > > > > - assertContains( > > - toString, > > - "public FredRunnable(java.util.Map $1, > > java.lang.Runnable $2)\n" > > - + " throws > > java.lang.IllegalArgumentException, java.util.zip.DataFormatException > > \n" > > - + "{ _map = $1; }"); > > - > > - assertContains( > > - toString, > > - "public final synchronized java.util.Map > > doTheNasty(int $1, java.lang.String $2)\n" > > - + " throws > > java.lang.InstantiationException, java.lang.IllegalAccessException\n" > > - + "{ return _map; }"); > > + assertContains(toString, > > + "public FredRunnable(java.util.Map $1, > > java.lang.Runnable $2)\n" + " throws > > java.lang.IllegalArgumentException, java.util.zip.DataFormatException > > \n" + "{ _map = $1; }"); > > + > > + assertContains(toString, > > + "public final synchronized java.util.Map > > doTheNasty(int $1, java.lang.String $2)\n" + " throws > > java.lang.InstantiationException, java.lang.IllegalAccessException > > \n" + "{ return _map; }"); > > > > } > > > > > > Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/ > > apache/tapestry/ioc/services/MethodSignatureTest.java > > URL: > > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/services/MethodSignatureTest.java?rev=599198&r1=599197&r2=599198&view=diff > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/services/MethodSignatureTest.java (original) > > +++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/ > > tapestry/ioc/services/MethodSignatureTest.java Wed Nov 28 15:24:06 > > 2007 > > @@ -118,7 +118,7 @@ > > m = find(Class.class, "newInstance"); > > > > assertEquals(m.toString(), > > - "java.lang.Object newInstance() throws > > java.lang.InstantiationException, java.lang.IllegalAccessException"); > > + "java.lang.Object newInstance() throws > > java.lang.IllegalAccessException, java.lang.InstantiationException"); > > } > > > > @Test > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
