You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Niall Pemberton <ni...@gmail.com> on 2008/03/07 23:45:40 UTC

[lang] ExtendedMessageFormatTest fails under JDK 1.3

I just tried running the lang tests using m1 and JDK 1.3 and got the
following failures (no problem with JDK 1.4 or 1.5):

Looks like the semantics changed in how formats are handled from 1.3
to 1.4 - and the javadocs are subtely different.

http://java.sun.com/j2se/1.3/docs/api/java/text/MessageFormat.html
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html

I haven't had much time to look at this and have run out of time today.

Niall

Testsuite: org.apache.commons.lang.text.TextTestSuite
Tests run: 231, Failures: 1, Errors: 2, Time elapsed: 0.234 sec

Testcase: testExtendedFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):	Caused
an ERROR
Index: 2, Size: 2
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
	at java.util.ArrayList.RangeCheck(ArrayList.java:486)
	at java.util.ArrayList.get(ArrayList.java:302)
	at org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
	at org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
	at org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
	at org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedFormats(ExtendedMessageFormatTest.java:85)


Testcase: testExtendedAndBuiltInFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):	Caused
an ERROR
Index: 3, Size: 3
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
	at java.util.ArrayList.RangeCheck(ArrayList.java:486)
	at java.util.ArrayList.get(ArrayList.java:302)
	at org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
	at org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
	at org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
	at org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedAndBuiltInFormats(ExtendedMessageFormatTest.java:110)


Testcase: testBuiltInDateTimeFormat(org.apache.commons.lang.text.ExtendedMessageFormatTest):	FAILED
toPattern Pattern=[1: {0,date,short}], locale=[null]
expected:<...dd/MM/yy...> but was:<...short...>
junit.framework.ComparisonFailure: toPattern Pattern=[1:
{0,date,short}], locale=[null] expected:<...dd/MM/yy...> but
was:<...short...>
	at org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:264)
	at org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:236)
	at org.apache.commons.lang.text.ExtendedMessageFormatTest.testBuiltInDateTimeFormat(ExtendedMessageFormatTest.java:206)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [lang] ExtendedMessageFormatTest fails under JDK 1.3

Posted by Matt Benson <gu...@yahoo.com>.
--- Matt Benson <gu...@yahoo.com> wrote:

> weird... I don't remember seeing these before, and
> I'm
> pretty sure I ran with 1.3 at one point.  But that
> was
> the other testsuite...
> 

Okay, the weird one was where MessageFormat provides
an extra format element... I just skipped it, and the
format() tests pass.

The other part was where toPattern() results changed
from 1.3 to 1.4.  The old testcases had toPattern()
comparisons disabled pre-1.4, so that's what I did
again for now.  Now that we are using MF for the
builtins, and even using its toPattern() results, I
would have thought we wouldn't have this problem, but
apparently something else is going on.  I still want
to look into this, but for now I think disabling that
particular comparison on 1.3 is a small evil that can
be documented if we just can't get around it:  the
class is certainly usable by and large regardless.

-Matt

> --- Niall Pemberton <ni...@gmail.com>
> wrote:
> 
> > I just tried running the lang tests using m1 and
> JDK
> > 1.3 and got the
> > following failures (no problem with JDK 1.4 or
> 1.5):
> > 
> > Looks like the semantics changed in how formats
> are
> > handled from 1.3
> > to 1.4 - and the javadocs are subtely different.
> > 
> >
>
http://java.sun.com/j2se/1.3/docs/api/java/text/MessageFormat.html
> >
>
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
> > 
> > I haven't had much time to look at this and have
> run
> > out of time today.
> > 
> > Niall
> > 
> > Testsuite:
> > org.apache.commons.lang.text.TextTestSuite
> > Tests run: 231, Failures: 1, Errors: 2, Time
> > elapsed: 0.234 sec
> > 
> > Testcase:
> >
>
testExtendedFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> > Caused
> > an ERROR
> > Index: 2, Size: 2
> > java.lang.IndexOutOfBoundsException: Index: 2,
> Size:
> > 2
> > 	at
> > java.util.ArrayList.RangeCheck(ArrayList.java:486)
> > 	at java.util.ArrayList.get(ArrayList.java:302)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedFormats(ExtendedMessageFormatTest.java:85)
> > 
> > 
> > Testcase:
> >
>
testExtendedAndBuiltInFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> > Caused
> > an ERROR
> > Index: 3, Size: 3
> > java.lang.IndexOutOfBoundsException: Index: 3,
> Size:
> > 3
> > 	at
> > java.util.ArrayList.RangeCheck(ArrayList.java:486)
> > 	at java.util.ArrayList.get(ArrayList.java:302)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedAndBuiltInFormats(ExtendedMessageFormatTest.java:110)
> > 
> > 
> > Testcase:
> >
>
testBuiltInDateTimeFormat(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> > FAILED
> > toPattern Pattern=[1: {0,date,short}],
> locale=[null]
> > expected:<...dd/MM/yy...> but was:<...short...>
> > junit.framework.ComparisonFailure: toPattern
> > Pattern=[1:
> > {0,date,short}], locale=[null]
> > expected:<...dd/MM/yy...> but
> > was:<...short...>
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:264)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:236)
> > 	at
> >
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testBuiltInDateTimeFormat(ExtendedMessageFormatTest.java:206)
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail:
> > dev-help@commons.apache.org
> > 
> > 
> 
> 
> 
>      
>
____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search. 
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@commons.apache.org
> For additional commands, e-mail:
> dev-help@commons.apache.org
> 
> 



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [lang] ExtendedMessageFormatTest fails under JDK 1.3

Posted by Matt Benson <gu...@yahoo.com>.
weird... I don't remember seeing these before, and I'm
pretty sure I ran with 1.3 at one point.  But that was
the other testsuite...

--- Niall Pemberton <ni...@gmail.com> wrote:

> I just tried running the lang tests using m1 and JDK
> 1.3 and got the
> following failures (no problem with JDK 1.4 or 1.5):
> 
> Looks like the semantics changed in how formats are
> handled from 1.3
> to 1.4 - and the javadocs are subtely different.
> 
>
http://java.sun.com/j2se/1.3/docs/api/java/text/MessageFormat.html
>
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
> 
> I haven't had much time to look at this and have run
> out of time today.
> 
> Niall
> 
> Testsuite:
> org.apache.commons.lang.text.TextTestSuite
> Tests run: 231, Failures: 1, Errors: 2, Time
> elapsed: 0.234 sec
> 
> Testcase:
>
testExtendedFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> Caused
> an ERROR
> Index: 2, Size: 2
> java.lang.IndexOutOfBoundsException: Index: 2, Size:
> 2
> 	at
> java.util.ArrayList.RangeCheck(ArrayList.java:486)
> 	at java.util.ArrayList.get(ArrayList.java:302)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedFormats(ExtendedMessageFormatTest.java:85)
> 
> 
> Testcase:
>
testExtendedAndBuiltInFormats(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> Caused
> an ERROR
> Index: 3, Size: 3
> java.lang.IndexOutOfBoundsException: Index: 3, Size:
> 3
> 	at
> java.util.ArrayList.RangeCheck(ArrayList.java:486)
> 	at java.util.ArrayList.get(ArrayList.java:302)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.applyPattern(ExtendedMessageFormat.java:196)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:127)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormat.<init>(ExtendedMessageFormat.java:112)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testExtendedAndBuiltInFormats(ExtendedMessageFormatTest.java:110)
> 
> 
> Testcase:
>
testBuiltInDateTimeFormat(org.apache.commons.lang.text.ExtendedMessageFormatTest):
> FAILED
> toPattern Pattern=[1: {0,date,short}], locale=[null]
> expected:<...dd/MM/yy...> but was:<...short...>
> junit.framework.ComparisonFailure: toPattern
> Pattern=[1:
> {0,date,short}], locale=[null]
> expected:<...dd/MM/yy...> but
> was:<...short...>
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:264)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.checkBuiltInFormat(ExtendedMessageFormatTest.java:236)
> 	at
>
org.apache.commons.lang.text.ExtendedMessageFormatTest.testBuiltInDateTimeFormat(ExtendedMessageFormatTest.java:206)
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@commons.apache.org
> For additional commands, e-mail:
> dev-help@commons.apache.org
> 
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org