maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Rosenvold (JIRA)" <j...@codehaus.org>
Subject [jira] Updated: (SUREFIRE-533) maven test java timezone
Date Fri, 24 Dec 2010 20:25:58 GMT

     [ http://jira.codehaus.org/browse/SUREFIRE-533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kristian Rosenvold updated SUREFIRE-533:
----------------------------------------

    Component/s: process forking

> maven test java timezone
> ------------------------
>
>                 Key: SUREFIRE-533
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-533
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: process forking
>         Environment: Windows XP Pro 2002
>            Reporter: Sotirios Maroudas
>         Attachments: pom.xml
>
>
> Hello maven team,
> I try to execute a junit test through maven. the method is:
>  @Test
>     public void loadData() {
>         EntityTransaction tx = null;
>         try {
>             tx = em.getTransaction();
>             tx.begin();
>             Query q1 = em.createQuery("update CnCode c set c.activationDate=current_timestamp
where c.codeType=15071010");
>             q1.executeUpdate();
>             tx.commit();
>             Query q = em.createQuery("select c from CnCode c where c.codeType=15071010");
>             List l = q.getResultList();
>             if (l.size() > 0) {
>                 CnCode c = (CnCode) l.get(0);
>                  SimpleDateFormat df=new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
>             System.out.println(df.format(c.getActivationDate().getTime()));
>             }
>             System.out.println(TimeZone.getDefault().getDSTSavings());
>             System.out.println(TimeZone.getDefault().getRawOffset());
>         } catch (RuntimeException e) {
>             if (tx != null && tx.isActive()) {
>                 tx.rollback();
>             }
>             throw e; // or display error message
>         }
> when i execute this method through maven the current_timestamp query parameter saves
the current_timestamp 2 hours before my localtime in ORACLE Database. The Database is on the
same machine with the executing code and its timezone is GMT+2.
> I then created an eclipse project and executed the same junit and the date saved correctly
in my local time. Is something happening with surefire plugin? i attach also the pom.xml
> thanks
> Sotiris Maroudas

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message