[rfc][icedtea-web] PluginMessage test time zone

Lukasz Dracz ldracz at redhat.com
Wed Jun 4 15:56:52 UTC 2014



----- Original Message -----
> From: "Omair Majid" <omajid at redhat.com>
> To: "Lukasz Dracz" <ldracz at redhat.com>
> Cc: distro-pkg-dev at openjdk.java.net
> Sent: Tuesday, June 3, 2014 10:41:44 AM
> Subject: Re: [rfc][icedtea-web] PluginMessage test time zone
> 
> 
> An alternative is to explicitly set (and then restore) the locale using
> Locale.setDefault() in a @Before (and restore in an @After) method. This
> ensures the test always sees the same locale, irrespective of the system
> locale. If you are dealing with timestamps, this is often an easier
> approach to use.
> 

Thank you for your suggestion, I have looked into this and implemented it in this way.

> > +++
> > b/tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java
> > 	Tue Jun 03 10:18:24 2014 -0400
> 
> > +        Date localized = new Date();
> > +        localized.setTime(new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ
> > yyyy").parse(TEST_TIME).getTime());
> 
> Why not just:
> 
>      Date localized = new SimpleDateFormat(...).parse(...)
> 

You're right that is better way.

> Thanks,
> Omair
> 
> --
> PGP Key: 66484681 (http://pgp.mit.edu/)
> Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681
> 

I have attached the updated patch.

Thank you,
Lukasz Dracz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CreatePluginHeaderTestOkChanges-4.patch
Type: text/x-patch
Size: 4656 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140604/fc4a6b2b/CreatePluginHeaderTestOkChanges-4.patch>


More information about the distro-pkg-dev mailing list