You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oodt.apache.org by Thomas Bennett <tb...@ska.ac.za> on 2010/11/17 14:49:21 UTC

Unit test fail while building OODT

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

Re: Unit test fail while building OODT

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hey Tom,

> Greetings from the "+" side of GMT.

Haha, nice to have you + siders on the list! :)

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

Thanks!

> 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.

Thanks a lot, glad it caught this issue.

> 
> 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);

Cool, let me test it out on the - side of the GMT and see if it works here too. Appreciate the patch and I'll open up an issue (and provide you credit of course!) for this. in fact,  I had a little time, so went ahead and opened the issue here [1], as OODT-62. We can collaborate there and work on it, thanks Tom!

Cheers,
Chris

[1] http://issues.apache.org/jira/browse/OODT-62

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++