oodt-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Bennett <tbenn...@ska.ac.za>
Subject Unit test fail while building OODT
Date Wed, 17 Nov 2010 13:49:21 GMT
Hi,

Greetings from the "+" side of GMT.

I've cc'ed Chris in case I can't email ood-dev.

I have a unit test which fail while building OODT:

================
Running org.apache.oodt.cas.filemgr.versioning.TestDateTimeVersioner
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 6.497 sec
<<< FAILURE!
================

The test fails due to the fact that I'm GMT+2 (the default sign is "-" but
"+" for me will never be set by the code).  Good work by the unit test.

Here is the svn diff for my local fix. Perhaps something more water tight
can be written,  but my current fix passes the test.

Index: commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
===================================================================
--- commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
(revision
1035603)
+++ commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
(working
copy)
@@ -131,9 +131,9 @@
  }

  // Determine the sign of the offset.
- String sign = "-";
- if (String.valueOf(tzOffsetMS).indexOf("+") != -1) {
- sign = "+";
+ String sign = "+";
+ if (String.valueOf(tzOffsetMS).indexOf("-") != -1) {
+ sign = "-";
  }

  dateString = dateString.concat(sign + hourString + ":" + minuteString);

Cheers,
Tom

-- 
Thomas Bennett

SKA South Africa

Office :  +2721 506 7341
Mobile : +2779 523 7105
Email  :  tbennett@ska.ac.za

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message