jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Maven Surefire
  • Maven Surefire
  • SUREFIRE-533

maven test java timezone

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: process forking
  • Labels:
    None
  • Environment:
    Windows XP Pro 2002
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    pom.xml
    05/Sep/08 3:10 AM
    3 kB
    Sotirios Maroudas

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 17/Dec/08 9:54 PM

likely environmental but moved to correct place. What version of the surefire plugin are you using?

Show
Brett Porter added a comment - 17/Dec/08 9:54 PM likely environmental but moved to correct place. What version of the surefire plugin are you using?
Hide
Permalink
Kristian Rosenvold added a comment - 13/Dec/11 3:05 PM

I cannot reproduce this issue, please produce a sample demo project to illustrate this problem if you want this reopened

Show
Kristian Rosenvold added a comment - 13/Dec/11 3:05 PM I cannot reproduce this issue, please produce a sample demo project to illustrate this problem if you want this reopened

People

  • Assignee:
    Unassigned
    Reporter:
    Sotirios Maroudas
Vote (0)
Watch (0)

Dates

  • Created:
    05/Sep/08 3:10 AM
    Updated:
    13/Dec/11 3:05 PM
    Resolved:
    13/Dec/11 3:05 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.